# Contributor: Jakub Jirutka # Maintainer: Jakub Jirutka pkgname=ponyc pkgver=0.21.3 pkgrel=2 pkgdesc="An open-source, actor-model, capabilities-secure, high performance programming language" url="https://www.ponylang.org" arch="x86_64 aarch64" license="BSD-2-Clause" # LLVM 5 support is denoted as experimental, but libponyc.tests segfault on # LLVM 3.9.1 and 4.0.0 (see https://github.com/ponylang/ponyc/issues/2689). case "$CARCH" in aarch64) _llvmver=5;; *) _llvmver=3.9;; esac depends="binutils-gold clang" checkdepends="libressl-dev pcre2-dev" makedepends="clang-dev libexecinfo-dev libunwind-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 fix-aarch64.patch fix-atomic-initializer.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=true prefix=/usr verbose=true LLVM_CONFIG=/usr/lib/llvm$_llvmver/bin/llvm-config " # gcc 6.4.0 doesn't support flag -mcx16 which ponyc needs on aarch64. export CC=clang export CXX=clang++ 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 } # NOTE: libponyc.tests segfaults on some aarch64 machines when libnuma is # installed (e.g. on our 96cores machine). 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 4ff47633e878890d9400b7ab7d7fad42119707d8b1f69c0192266f4b2d386be698bb0e8f2accae9b440bcfece39e1c6baf10047436dc184b1c3885c2ac33d569 fix-aarch64.patch f78ff44de59fe486bdfa8a7fbde14786825e549b23759ef798ba7632d556203de49b522562a04cfcab1ef3ef323e226ff9217abebafcb414e647ebd17877b67d fix-atomic-initializer.patch 0dac51826c0fcd47e6d4e7fe9928a5221c66da2f24d7931d7c53e591d325375b88e98cc0b3b6d538f9ec9bcbba906de7c00fff5434e427c94cea4bd2fb0477f6 makefile-remove-march-mtune.patch 46c0125b60cd1db89d7ae958602b087acb2ae1fd8298cd9141828999693a9e39b60d2dac338853406081fc1c138e506243357618197ffd118fe4ac9737bd1565 fix-tests.patch"