1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
6 pkgdesc='An actor model, capabilities, high performance programming language'
7 url='https://ponylang.org/'
10 depends=('llvm-libs') # 'libb2'
11 makedepends=('benchmark' 'cmake' 'gtest' 'llvm')
12 checkdepends=('pcre2')
14 optdepends=('pcre2: Needed for the regex package')
15 source=("https://github.com/ponylang/ponyc/archive/$pkgver/$pkgname-$pkgver.tar.gz"
17 sha512sums=('7558e40c6d370b1ead57ce66408f1a4d9359720c7d85aee9d4d4f089fc9591e7bcbd12bf4d34e0a1640a71a39afd81cd965c46ddc2a90943d385865df41f1eb6'
18 '7dc4591d5e3ff7d321f4397f382d700e3778b984df3d1dc95ace1689ce3f7fe63d2b35c4986aea11cf15cfa34f53b96782eebe2cc8a729f47de45f72302ea594')
23 patch -p2 -i ../shared-libs.patch
25 # Use system gmock/gtest/gbenchmark, remove -Werror (https://github.com/ponylang/ponyc/issues/3806)
26 sed -i 's|NO_DEFAULT_PATH||;s/-Werror //' CMakeLists.txt
28 # Don't build libponyc-standalone.a
29 # sed -i 's/else()/elseif(FALSE)/' src/libponyc/CMakeLists.txt
31 # System b2 - disabled: *** stack smashing detected ***: terminated
32 # sed -i 's/blake2/b2/' src/ponyc/CMakeLists.txt test/libponyc/CMakeLists.txt benchmark/libponyc/CMakeLists.txt
33 # Arguments ordering changed
34 # sed -i 's|blake2b(buf, SIGNATURE_LENGTH, array.ptr, array.size, NULL, 0);|blake2b(buf, array.ptr, NULL, SIGNATURE_LENGTH, array.size, 0);|' src/libponyc/pkg/package.c
36 # Missing LLVM components
37 sed -i 's/demangle/demangle amdgpucodegen avrcodegen bpfcodegen codegen hexagoncodegen lanaicodegen mipscodegen msp430codegen nativecodegen nvptxcodegen powerpccodegen riscvcodegen sparccodegen systemzcodegen webassemblycodegen xcorecodegen amdgpuasmparser asmparser avrasmparser bpfasmparser hexagonasmparser lanaiasmparser mipsasmparser msp430asmparser powerpcasmparser riscvasmparser sparcasmparser systemzasmparser webassemblyasmparser/' CMakeLists.txt
42 make config=release prefix=/usr arch=x86-64 libs
43 make config=release prefix=/usr arch=x86-64 configure
44 make config=release prefix=/usr arch=x86-64 build
47 build/release/ponyc packages/stdlib -rexpr -g -o docs
52 make config=release prefix=/usr arch=x86-64 test
57 make config=release arch= DESTDIR="$pkgdir"/usr/lib/pony install
59 install -dm755 "$pkgdir"/usr/{bin,lib,include/pony/detail}
60 ln -sf /usr/lib/pony/bin/ponyc "$pkgdir"/usr/bin/
61 for _lib in {libponyc,libponyrt,libponyrt-pic}.a; do
62 ln -sf /usr/lib/pony/lib/$_lib "$pkgdir"/usr/lib/
64 ln -sf /usr/lib/pony/include/pony.h "$pkgdir"/usr/include/
65 ln -sf /usr/lib/pony/include/pony/detail/atomics.h "$pkgdir"/usr/include/pony/detail/
67 # Let's include the examples as documentation is scarce.
68 install -dm755 "$pkgdir"/usr/share/doc/pony
69 cp -dr --no-preserve=ownership examples "$pkgdir"/usr/share/doc/pony
71 cp -dr docs/* "$pkgdir"/usr/share/doc/pony
73 install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE