# 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.13.0 pkgver=${_pkgver/-/.} pkgrel=1 pkgdesc='Groups, Algorithms, Programming: a system for computational discrete algebra' arch=(x86_64) url='https://www.gap-system.org/' license=(GPL-2.0-or-later) source=(https://github.com/gap-system/gap/releases/download/v$_pkgver/$pkgbase-$_pkgver.tar.gz package-infos-$pkgver.json.gz::https://github.com/gap-system/gap/releases/download/v$_pkgver/package-infos.json.gz) sha256sums=('cc76ecbe33d6719450a593e613fb87e9e4247faa876f632dd0f97c398f92265d' 'b3f606cc5e6f388aa311c3824042d301d75ace780f19023561ef9d78982dcb7a') makedepends=(boost c-xsc cddlib chrpath eigen fmt fplll givaro jq libsemigroups libxaw mpfi normaliz wget zeromq) prepare() { cd gap-$_pkgver rm -fr pkg/xgap # Use system normaliz rm pkg/normalizinterface/prerequisites.sh # Use system nauty rm -r pkg/grape/{configure,Makefile*,nauty*} # 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+=" -std=gnu++14" # Fix build of normalizinterface 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 \ --add-package-config-Semigroups --with-external-libsemigroups } _standardpkgs=(gapdoc primgrp smallgrp transgrp atlasrep autpgrp alnuth crisp ctbllib factint fga irredsol laguna polenta polycyclic radiroot resclasses sophus tomlib utils autodoc) 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-$pkgver.json | sed -e 's/"//g') _prov="gap-$_pkg=${_ver/-/.}" provides+=($_prov) done } package_gap-packages() { depends=(gap) optdepends=('c-xsc: float package' 'cddlib: CddLib interface package' 'curl: curl interface package' 'fplll: float package' 'libmpc: float package' 'libsemigroups: semigroups package' 'libxaw: xgap package' 'mpfi: float package' 'nauty: grape package' 'normaliz: NormalizInterface package' 'pari: alnuth package' 'planarity: digraph package' 'polymake: polymaking package' 'singular: singular package' 'zeromq: ZeroMQ interface 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 # 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 # use system nauty in grape package install -d "$pkgdir"/usr/lib/gap/pkg/grape/bin/x86_64-pc-linux-gnu-default64-kv8 ln -s /usr/bin/dreadnaut "$pkgdir"/usr/lib/gap/pkg/grape/bin/x86_64-pc-linux-gnu-default64-kv8 # 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-$pkgver.json | sed -e 's/"//g') _prov="gap-$_pkg=${_ver/-/.}" provides+=($_prov) done }