aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ponyc/APKBUILD
blob: 701274e30101b61da7c5747d6a782c276f00db5a (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
84
85
86
87
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ponyc
pkgver=0.21.3
pkgrel=1
pkgdesc="An open-source, actor-model, capabilities-secure, high performance programming language"
url="https://www.ponylang.org"
arch="x86_64 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
	disable-avx512f-for-x86-only.patch
	makefile-remove-march-mtune.patch
	fix-tests.patch"
builddir="$srcdir/$pkgname-$pkgver"

# arch per gcc, used only to define PONY_ARCH.
_arch="$CARCH"
case "$CARCH" in
	x86_64) _arch=x86-64;;
	armhf) _arch=armv6zk;;
	aarch64) _arch=armv8-a;;
esac

_make_opts="arch=$_arch
	config=release
	default_pic=1
	prefix=/usr
	verbose=1
	LLVM_CONFIG=/usr/lib/llvm$_llvmver/bin/llvm-config
	"

build() {
	cd "$builddir"

	make $_make_opts CFLAGS="-Wno-error"

	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
0f1d7e45639db17343db675a740922b2c1ef1317fd1a7678a0d30040407c91c930b7439dc12282541384336da1af5f0bc143ea0f5725eb8aa2ab3646b1cf00f7  disable-avx512f-for-x86-only.patch
0dac51826c0fcd47e6d4e7fe9928a5221c66da2f24d7931d7c53e591d325375b88e98cc0b3b6d538f9ec9bcbba906de7c00fff5434e427c94cea4bd2fb0477f6  makefile-remove-march-mtune.patch
46c0125b60cd1db89d7ae958602b087acb2ae1fd8298cd9141828999693a9e39b60d2dac338853406081fc1c138e506243357618197ffd118fe4ac9737bd1565  fix-tests.patch"