# Contributor: Sören Tempel # Maintainer: Sören Tempel pkgname=idris2 pkgver=0.6.0 # XXX: For chez-scheme rebuilds, re-bootstrap from -stage0 and # afterwards self-host by depending on idris2-bootstrap again. pkgrel=1 pkgdesc="Purely functional programming language with first class types" url="https://www.idris-lang.org" arch="x86 x86_64" # limited by chez-scheme license="BSD-3-Clause" depends="chez-scheme gmp-dev" makedepends="idris2-bootstrap>=$pkgver bash py3-sphinx py3-sphinx_rtd_theme" subpackages="$pkgname-doc $pkgname-api" source="https://github.com/idris-lang/Idris2/archive/v$pkgver/idris2-$pkgver.tar.gz" builddir="$srcdir/Idris2-$pkgver" # Perform the idris2 self-hosting step by re-compiling Idris2 # using the previous version of Idris2 or idris2-stage0. This # allows us to (a) compile the Idris2 API and (b) backport # patches from upstream. # # See also https://lists.alpinelinux.org/~alpine/devel/%3C33KG0XO61I4IL.2Z7RTAZ5J3SY6%408pit.net%3E provides="idris2-bootstrap=$pkgver" provider_priority=100 # highest case "$CARCH" in x86) options="!check" ;; # XXX: https://github.com/idris-lang/Idris2/issues/1617 esac # TODO: Install idris libs to /usr/lib/idris-$pkgver instead of /usr/idris-$pkgver # TODO: Self-hosting step (maybe split into idris2 and idris2-bootstrap?) # TODO: https://github.com/idris-lang/Idris2/pull/1123 build() { make -j1 PREFIX=/usr SCHEME=chez make -C docs html } check() { # XXX: The repl005 test case is known to fail in CI environments. # See: https://github.com/idris-lang/Idris2/pull/2728 make except=idris2/repl005 test } package() { # Idris2 Makefile doesn't honor $DESTDIR # See https://github.com/idris-lang/Idris2/pull/1123 export IDRIS2_BOOT=./build/exec/idris2 make -j1 IDRIS2_PREFIX="$pkgdir/usr" \ PREFIX="$pkgdir/usr" install install-api install-libdocs # Move package documentation to more sensible location. mkdir -p "$pkgdir"/usr/share/doc/$pkgname/ mv "$pkgdir"/usr/idris2-$pkgver/docs/ \ "$pkgdir"/usr/share/doc/$pkgname/pkgs # Install additional documentation files install -m644 CHANGELOG.md CONTRIBUTING.md \ CONTRIBUTORS README.md "$pkgdir"/usr/share/doc/$pkgname/ cp -r docs/build/html "$pkgdir"/usr/share/doc/$pkgname/ # We don't want to ship directories in $PATH. The /usr/bin/idris2 # file installed by default is just a shell script which sets up # LD_LIBRARY_PATH and executes idris2_app/idris2.so. We don't # need to modify LD_LIBRARY_PATH hence we can skip using the # script. # # See also: The Nix package for idris2 in nix/package.nix. mv "$pkgdir"/usr/bin/idris2_app/idris2.so "$pkgdir"/usr/bin/idris2 rm -r "$pkgdir"/usr/bin/idris2_app # Make sure idris2 --install works by default. # See https://github.com/idris-lang/Idris2/issues/737 mkdir -p "$pkgdir"/etc/profile.d/ cat > "$pkgdir"/etc/profile.d/idris2.sh <<-EOF export IDRIS2_PREFIX="$HOME/.idris2" export IDRIS2_PACKAGE_PATH="/usr/idris2-$pkgver" export IDRIS2_LIBS="/usr/idris2-$pkgver/lib" export IDRIS2_DATA="/usr/idris2-$pkgver/support" EOF } api() { depends="" pkgdesc="Idris API for developing support tools (e.g. external code generator)" amove usr/idris2-$pkgver/idris2-$pkgver } sha512sums=" 342ab3d9e38c8150c7eec997e9cbadd4aa12ccb18994b6b008f165deb20fd5fc79f4944387316cbba03e56fa1545b0afbb277988449af5b21d20f81207f6f367 idris2-0.6.0.tar.gz "