summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 14e4a81de687d6817f8cecafdb9f62bdf79d3980 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Maintainer: Arvid Norlander <VorpalBlade@users.noreply.github.com>
pkgname=cfunge-git
pkgver=1,001.r1.b7bf640
pkgrel=1
pkgdesc="A fast Befunge interpreter in C"
arch=('x86_64' 'i686' 'arm7h' 'aarch64')
url="https://github.com/VorpalBlade/cfunge"
license=('GPL3')
depends=('libbsd')
makedepends=('git' 'cmake' 'ninja')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=('cfunge::git+https://github.com/VorpalBlade/cfunge'
        'mycology::git+https://github.com/Deewiant/Mycology')
md5sums=('SKIP'
         'SKIP')

pkgver() {
	cd "$srcdir/${pkgname%-git}"
	printf "%s" "$(git describe --long --tags | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"
}

prepare() {
	cd "$srcdir/${pkgname%-git}"
	# There isn't a sane way to deal with submodules apparently in PKGBUILDs.
	git submodule init
	git config submodule.tests/mycology/src.url "$srcdir/mycology"
	git -c protocol.file.allow=always submodule update
}

build() {
	mkdir -p "$srcdir/build"
	cd "$srcdir/build"
	cmake -GNinja "$srcdir/${pkgname%-git}" -DCMAKE_INSTALL_PREFIX=/usr
	ninja
}

check() {
	cd "$srcdir/build"
	ninja -k0 test
}

package() {
	cd "$srcdir/build"
	DESTDIR="$pkgdir/" ninja install
}