# Maintainer: Antonio Rojas # Contributor: TDY # Contributor: Rémy Oudompheng # ALARM: Kevin Mihelich # - rm -fr "$pkgdir"/usr/lib/gap/pkg/digraphs-*/bin/lib/ for aarch64 # - strip -m32 flags pkgbase=gap pkgname=(gap gap-packages) pkgver=4.12.0 pkgrel=5 pkgdesc='Groups, Algorithms, Programming: a system for computational discrete algebra' arch=(x86_64) url='https://www.gap-system.org/' license=(GPL) source=(https://github.com/gap-system/gap/releases/download/v$pkgver/$pkgbase-$pkgver.tar.gz https://github.com/gap-system/gap/releases/download/v$pkgver/package-infos.json.gz https://github.com/gap-system/gap/commit/dce6fa96.patch https://github.com/gap-system/gap/commit/c57a07a3.patch) sha256sums=('6005d0c0316fe8803d84681f30be64eace83a9542f975f5cb3dedfadd4391849' 'abca41d8ec8341d39df99291136c465217fb14f9029cbbdd6378bc37499eac7c' 'd8a362a6c1d27f2925d8b3f8eddc9aaafac1699fb568a035768d039b34ba6eb3' '6a66c31eada7a0da5f6c716a8f7ea90dceb2d41c8ad97af2e7d5b1415dbe210a') makedepends=(libxaw givaro mpfi cddlib boost libsemigroups c-xsc zeromq fplll wget chrpath fmt eigen normaliz jq) prepare() { cd gap-$pkgver # Fix including headers when no garbage collector is specified patch -p1 < ../dce6fa96.patch # Fix make install trying to install non-existant docs patch -p1 < ../c57a07a3.patch # Use system libsemigroups sed -e 's|test "$with_external_libsemigroups" = yes|true|' -i pkg/semigroups/configure # Use system normaliz sed -e 's|.\/build-normaliz.sh|true|' -i bin/BuildPackages.sh # Fix https://bugs.archlinux.org/task/55174 sed -e '/xgap/d' -i pkg/sonata/PackageInfo.g sed -e '/XGAP/d' -i pkg/cryst/PackageInfo.g # Strip -m32 flags sed -e '/-m32/d' -i bin/BuildPackages.sh } build() { cd gap-$pkgver ./configure --prefix=/usr --with-gmp=system # https://bugzilla.gnome.org/show_bug.cgi?id=655517 sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool make # Install libgap so we can link packages against it mkdir -p tmp-install make DESTDIR="$srcdir"/gap-$pkgver/tmp-install install-libgap cd pkg export CXXFLAGS+=" -I/usr/include/eigen3" # Fix build of semigroups export LDFLAGS+=" -L$srcdir/gap-$pkgver/tmp-install/usr/lib -lgap" # See https://trac.sagemath.org/ticket/27372 export LD_LIBRARY_PATH="$srcdir"/gap-$pkgver/tmp-install/usr/lib ../bin/BuildPackages.sh --strict } _standardpkgs=(gapdoc primgrp smallgrp transgrp atlasrep autpgrp alnuth crisp ctbllib factint fga irredsol laguna polenta polycyclic resclasses sophus tomlib) package_gap() { depends=(gmp zlib) optdepends=('gap-packages: extra packages') conflicts=(gap-doc) provides=(gap-doc) replaces=(gap-doc) cd gap-$pkgver make DESTDIR="$pkgdir" install for _pkg in ${_standardpkgs[@]}; do cp -r pkg/$_pkg "$pkgdir"/usr/share/gap/pkg done # Add provides for bundled packages for _pkg in $(ls "$pkgdir"/usr/share/gap/pkg); do _ver=$(jq .[\"${_pkg}\"].Version "$srcdir"/package-infos.json | sed -e 's/"//g') _prov="gap-$_pkg=${_ver/-/.}" provides+=($_prov) done } package_gap-packages() { depends=(gap) optdepends=('libxaw: xgap package' 'c-xsc: float package' 'mpfi: float package' 'libmpc: float package' 'fplll: float package' 'zeromq: ZeroMQ interface package' 'planarity: digraph package' 'curl: curl interface package' 'libsemigroups: semigroups package' 'cddlib: CddLib interface package' 'normaliz: NormalizInterface package' 'pari: alnuth package' 'singular: singular package' 'polymake: polymaking package') pkgdesc="Extra packages for GAP" cd gap-$pkgver mkdir -p "$pkgdir"/usr/{bin,lib/gap} cp -r pkg "$pkgdir"/usr/lib/gap chmod 755 "$pkgdir"/usr/lib/gap/pkg # fix xgap launch script sed -e "s|/build/gap/src/gap-$pkgver|/usr/lib/gap|g" -e 's|^GAP=.*|GAP=/usr/lib/gap/gap|g' \ "$pkgdir"/usr/lib/gap/pkg/xgap/xgap.sh > "$pkgdir"/usr/bin/xgap chmod 755 "$pkgdir"/usr/bin/xgap rm "$pkgdir"/usr/lib/gap/pkg/xgap/xgap.sh # provided by main gap package for _pkg in ${_standardpkgs[@]}; do rm -r "$pkgdir"/usr/lib/gap/pkg/$_pkg done # fix RPATH find "$pkgdir"/usr/lib/gap/pkg/ -name '*.so' | xargs chrpath -d # remove bundled planarity rm -fr "$pkgdir"/usr/lib/gap/pkg/digraphs/bin/lib/ # remove leftover binaries and source files find "$pkgdir"/usr/lib/gap/pkg -name .libs -o -name '*.o' | xargs rm -fr find "$pkgdir"/usr/lib/gap/pkg -type d -name src | xargs rm -fr rm -r "$pkgdir"/usr/lib/gap/pkg/digraphs/extern rm -r "$pkgdir"/usr/lib/gap/pkg/semigroups/libsemigroups rm -r "$pkgdir"/usr/lib/gap/pkg/caratinterface/carat* rm -r "$pkgdir"/usr/lib/gap/pkg/kbmag/standalone rm -r "$pkgdir"/usr/lib/gap/pkg/log # Add provides for bundled packages for _pkg in $(ls "$pkgdir"/usr/lib/gap/pkg); do _ver=$(jq .[\"${_pkg}\"].Version "$srcdir"/package-infos.json | sed -e 's/"//g') _prov="gap-$_pkg=${_ver/-/.}" provides+=($_prov) done }