PKGBUILDs/community/gap/PKGBUILD

138 lines
5 KiB
Bash
Raw Normal View History

2019-06-22 19:09:39 +00:00
# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: TDY <tdy@archlinux.info>
# Contributor: Rémy Oudompheng <oudomphe@clipper.ens.fr>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - rm -fr "$pkgdir"/usr/lib/gap/pkg/digraphs-*/bin/lib/ for aarch64
2022-08-28 21:49:01 +00:00
# - strip -m32 flags
2019-06-22 19:09:39 +00:00
pkgbase=gap
pkgname=(gap gap-doc gap-packages)
2022-08-28 18:19:39 +00:00
pkgver=4.12.0
2022-10-07 12:47:25 +00:00
pkgrel=4
2021-12-08 13:50:01 +00:00
pkgdesc='Groups, Algorithms, Programming: a system for computational discrete algebra'
2019-06-22 19:09:39 +00:00
arch=(x86_64)
2021-12-08 13:50:01 +00:00
url='https://www.gap-system.org/'
2019-06-22 19:09:39 +00:00
license=(GPL)
2021-03-03 01:27:21 +00:00
source=(https://github.com/gap-system/gap/releases/download/v$pkgver/$pkgbase-$pkgver.tar.gz
2022-10-07 12:47:25 +00:00
https://github.com/gap-system/gap/commit/dce6fa96.patch)
2022-08-28 18:19:39 +00:00
sha256sums=('6005d0c0316fe8803d84681f30be64eace83a9542f975f5cb3dedfadd4391849'
2022-10-07 12:47:25 +00:00
'd8a362a6c1d27f2925d8b3f8eddc9aaafac1699fb568a035768d039b34ba6eb3')
2022-06-02 18:23:31 +00:00
makedepends=(libxaw givaro mpfi cddlib boost libsemigroups c-xsc zeromq fplll wget chrpath fmt eigen normaliz)
2019-06-22 19:09:39 +00:00
prepare() {
cd gap-$pkgver
2022-10-02 22:08:52 +00:00
# Fix including headers when no garbage collector is specified
patch -p1 < ../dce6fa96.patch
2019-06-22 19:09:39 +00:00
# Use system libsemigroups
2022-08-28 18:19:39 +00:00
sed -e 's|test "$with_external_libsemigroups" = yes|true|' -i pkg/semigroups/configure
2022-06-02 18:23:31 +00:00
# Use system normaliz
sed -e 's|.\/build-normaliz.sh|true|' -i bin/BuildPackages.sh
2019-06-22 19:09:39 +00:00
# Fix https://bugs.archlinux.org/task/55174
2022-08-28 18:19:39 +00:00
sed -e '/xgap/d' -i pkg/sonata/PackageInfo.g
2019-06-22 19:09:39 +00:00
sed -e '/XGAP/d' -i pkg/cryst/PackageInfo.g
2022-08-28 21:49:01 +00:00
# Strip -m32 flags
sed -e '/-m32/d' -i bin/BuildPackages.sh
2019-06-22 19:09:39 +00:00
}
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
2022-10-07 12:47:25 +00:00
make DESTDIR="$srcdir"/gap-$pkgver/tmp-install install-libgap
2019-06-22 19:09:39 +00:00
cd pkg
2021-12-24 16:47:49 +00:00
export CXXFLAGS+=" -I/usr/include/eigen3" # Fix build of semigroups
2022-10-07 12:47:25 +00:00
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
2022-08-28 18:19:39 +00:00
../bin/BuildPackages.sh --strict
2019-06-22 19:09:39 +00:00
}
2022-08-28 18:19:39 +00:00
_standardpkgs=(gapdoc primgrp smallgrp transgrp atlasrep autpgrp alnuth crisp ctbllib factint fga irredsol laguna
polenta polycyclic resclasses sophus tomlib)
2019-06-22 19:09:39 +00:00
package_gap() {
depends=(gmp zlib)
optdepends=('gap-packages: extra packages' 'gap-doc: documentation')
cd gap-$pkgver
2022-10-07 12:47:25 +00:00
make DESTDIR="$pkgdir" install-bin install-gaproot install-sysinfo install-headers install-libgap
2019-06-22 19:09:39 +00:00
for _pkg in ${_standardpkgs[@]}; do
2022-10-07 12:47:25 +00:00
cp -r pkg/$_pkg "$pkgdir"/usr/share/gap/pkg
2019-06-22 19:09:39 +00:00
done
2022-05-29 14:43:58 +00:00
# Add provides for bundled packages
2022-10-07 12:47:25 +00:00
for _f in "$pkgdir"/usr/share/gap/pkg/*/PackageInfo.g; do
2022-08-29 00:01:05 +00:00
_pkg=$(cat $_f | sed -ze 's|:=\n|:=|g' | grep PackageName | tr '\n' ' ' | cut -d '"' -f2 | tr '[:upper:]' '[:lower:]')
_ver=$(cat $_f | sed -ze 's|:=\n|:=|g' | grep Version | tr '\n' ' ' | cut -d '"' -f2)
2022-08-28 18:19:39 +00:00
_prov="gap-$_pkg=${_ver/-/.}"
2022-05-29 14:43:58 +00:00
provides+=($_prov)
done
2019-06-22 19:09:39 +00:00
}
package_gap-doc() {
depends=(gap)
pkgdesc="Documentation for GAP"
cd gap-$pkgver
mkdir -p "$pkgdir"/usr/lib/gap
cp -r doc "$pkgdir"/usr/lib/gap
}
package_gap-packages() {
depends=(gap)
2021-03-03 01:27:21 +00:00
optdepends=('libxaw: xgap package' 'c-xsc: float package' 'mpfi: float package'
2019-06-22 19:09:39 +00:00
'libmpc: float package' 'fplll: float package' 'zeromq: ZeroMQ interface package' 'planarity: digraph package'
2022-06-02 18:23:31 +00:00
'curl: curl interface package' 'libsemigroups: semigroups package' 'cddlib: CddLib interface package'
2022-10-07 12:47:25 +00:00
'normaliz: NormalizInterface package' 'pari: alnuth package' 'singular: singular package' 'polymake: polymaking package')
2019-06-22 19:09:39 +00:00
pkgdesc="Extra packages for GAP"
cd gap-$pkgver
2019-10-14 23:18:54 +00:00
mkdir -p "$pkgdir"/usr/{bin,lib/gap}
2019-06-22 19:09:39 +00:00
cp -r pkg "$pkgdir"/usr/lib/gap
2022-10-07 12:47:25 +00:00
chmod 755 "$pkgdir"/usr/lib/gap/pkg
2019-06-22 19:09:39 +00:00
2019-10-14 23:18:54 +00:00
# fix xgap launch script
2020-04-19 16:42:03 +00:00
sed -e "s|/build/gap/src/gap-$pkgver|/usr/lib/gap|g" -e 's|^GAP=.*|GAP=/usr/lib/gap/gap|g' \
2022-08-28 18:19:39 +00:00
"$pkgdir"/usr/lib/gap/pkg/xgap/xgap.sh > "$pkgdir"/usr/bin/xgap
2019-10-14 23:18:54 +00:00
chmod 755 "$pkgdir"/usr/bin/xgap
2022-08-28 18:19:39 +00:00
rm "$pkgdir"/usr/lib/gap/pkg/xgap/xgap.sh
2019-10-14 23:18:54 +00:00
2019-06-22 19:09:39 +00:00
# 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
2022-08-28 18:19:39 +00:00
rm -fr "$pkgdir"/usr/lib/gap/pkg/digraphs/bin/lib/
2019-06-22 19:09:39 +00:00
# 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
2022-08-28 18:19:39 +00:00
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
2020-12-07 14:06:09 +00:00
rm -r "$pkgdir"/usr/lib/gap/pkg/log
2022-05-29 14:43:58 +00:00
# Add provides for bundled packages
2022-08-28 18:19:39 +00:00
for _f in "$pkgdir"/usr/lib/gap/pkg/*/PackageInfo.g; do
2022-08-29 00:01:05 +00:00
_pkg=$(cat $_f | sed -ze 's|:=\n|:=|g' | grep PackageName | tr '\n' ' ' | cut -d '"' -f2 | tr '[:upper:]' '[:lower:]')
_ver=$(cat $_f | sed -ze 's|:=\n|:=|g' | grep Version | tr '\n' ' ' | cut -d '"' -f2)
2022-08-28 18:19:39 +00:00
_prov="gap-$_pkg=${_ver/-/.}"
2022-05-29 14:43:58 +00:00
provides+=($_prov)
done
2019-06-22 19:09:39 +00:00
}