aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ponyc/APKBUILD
blob: 2d7554b009a821d1cef063b507ea446e214518f4 (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ponyc
pkgver=0.21.3
pkgrel=0
pkgdesc="An open-source, actor-model, capabilities-secure, high performance programming language"
url="https://www.ponylang.org"
arch="x86_64"  # TODO: enable aarch64, armhf
license="BSD-2-Clause"
_llvmver=3.9
depends="binutils-gold gcc"
checkdepends="libressl-dev pcre2-dev"
makedepends="libexecinfo-dev llvm$_llvmver-dev ncurses-dev paxmark zlib-dev"
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/ponylang/$pkgname/archive/$pkgver.tar.gz
	makefile-no-mtune.patch
	fix-tests.patch"
builddir="$srcdir/$pkgname-$pkgver"

_arch="$CARCH"
case "$CARCH" in
	x86_64) _arch=x86-64;;
	arm*) _arch=armv7;;
esac

_make_opts="arch=$_arch
	config=release
	default_pic=1
	llvm_version=$_llvmver
	prefix=/usr
	verbose=1
	"

build() {
	cd "$builddir"

	make $_make_opts

	paxmark m build/release/ponyc \
		build/release/libponyc.tests

	mkdir docs
	build/release/ponyc packages/stdlib -rexpr -g -o docs
}

check() {
	cd "$builddir"
	make test -j1 $_make_opts
}

package() {
	cd "$builddir"/build/release

	# ponyc expects the standard packages to be in the same directory.
	install -m 755 -D ponyc "$pkgdir"/usr/lib/pony/$pkgver/bin/ponyc
	mkdir -p "$pkgdir"/usr/bin
	ln -sf ../lib/pony/$pkgver/bin/ponyc "$pkgdir"/usr/bin/ponyc

	mkdir -p "$pkgdir"/usr/lib
	cp libponyc.a libponyrt.a libponyrt-pic.a "$pkgdir"/usr/lib/

	cd ../..

	cp -r packages "$pkgdir"/usr/lib/pony/$pkgver/

	mkdir -p "$pkgdir"/usr/share/doc/$pkgname
	cp -r docs/stdlib-docs/docs "$pkgdir"/usr/share/doc/$pkgname/stdlib
}

# Note: libponyrt*.a and probably even libponyc.a are needed in runtime.
dev() {
	pkgdesc="$pkgdesc (development files)"
	depends="$pkgname=$pkgver-r$pkgrel"

	cd "$builddir"
	install -m 644 -D src/libponyrt/pony.h "$subpkgdir"/usr/include/pony.h
	install -m 644 -D src/common/pony/detail/atomics.h \
		"$subpkgdir"/usr/include/pony/detail/atomics.h
}

sha512sums="f89389142d77e93038c77d3fbe9e64c13ce76b9737430969fcdf2916023d0b7195f4d551895eab999798594352b40848be8dcc63af6927e8cc62b7c7000be65d  ponyc-0.21.3.tar.gz
2bb535b0dad3ea9aab02192c131980e5363db348bdc7f993a8e52d08fb5b08223d93c0713a9c1d420844545b5528b80403b9fdba3e0c34dd59f13366db9088c7  makefile-no-mtune.patch
46c0125b60cd1db89d7ae958602b087acb2ae1fd8298cd9141828999693a9e39b60d2dac338853406081fc1c138e506243357618197ffd118fe4ac9737bd1565  fix-tests.patch"