PKGBUILDs/extra/gap/PKGBUILD

167 lines
5.4 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
2024-03-18 00:09:48 +00:00
pkgname=(gap
gap-packages)
2024-06-13 19:01:14 +00:00
pkgver=4.13.1
pkgrel=1
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/'
2024-03-18 00:09:48 +00:00
license=(GPL-2.0-or-later)
2024-03-19 19:20:48 +00:00
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)
2024-06-13 19:01:14 +00:00
sha256sums=('9794dbdba6fb998e0a2d0aa8ce21fc8848ad3d3f9cc9993b0b8e20be7e1dbeba'
'8e6bd0fd2b36f13322ea1e484b5839090b4151d2e24cc7477ad62677bc2a2701')
2024-03-19 19:20:48 +00:00
makedepends=(bliss
boost
2024-03-18 00:09:48 +00:00
c-xsc
cddlib
chrpath
eigen
fmt
fplll
givaro
jq
libsemigroups
libxaw
mpfi
normaliz
2024-03-19 19:20:48 +00:00
planarity
2024-03-18 00:09:48 +00:00
wget
zeromq)
2019-06-22 19:09:39 +00:00
prepare() {
2024-03-19 19:20:48 +00:00
cd gap-$pkgver
2019-06-22 19:09:39 +00:00
2022-06-02 18:23:31 +00:00
# Use system normaliz
2022-12-19 02:55:36 +00:00
rm pkg/normalizinterface/prerequisites.sh
# Use system nauty
rm -r pkg/grape/{configure,Makefile*,nauty*}
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() {
2024-03-19 19:20:48 +00:00
cd gap-$pkgver
2019-06-22 19:09:39 +00:00
./configure --prefix=/usr --with-gmp=system
make
# Install libgap so we can link packages against it
mkdir -p tmp-install
2024-03-19 19:20:48 +00:00
make DESTDIR="$srcdir"/gap-$pkgver/tmp-install install-libgap
2019-06-22 19:09:39 +00:00
cd pkg
2024-06-13 19:01:14 +00:00
export CFLAGS+=" -Wno-incompatible-pointer-types" # Fix build with GCC 14
2024-01-14 15:29:22 +00:00
export CXXFLAGS+=" -std=gnu++14" # Fix build of normalizinterface
2024-03-19 19:20:48 +00:00
export LDFLAGS+=" -L$srcdir/gap-$pkgver/tmp-install/usr/lib -lgap" # See https://trac.sagemath.org/ticket/27372
2022-10-07 12:47:25 +00:00
export LD_LIBRARY_PATH="$srcdir"/gap-$pkgver/tmp-install/usr/lib
2024-01-14 15:29:22 +00:00
../bin/BuildPackages.sh --strict \
2024-03-19 19:20:48 +00:00
--add-package-config-Semigroups --with-external-libsemigroups \
--add-package-config-Digraphs "--with-external-planarity --with-external-bliss"
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
2023-07-11 23:06:18 +00:00
polenta polycyclic radiroot resclasses sophus tomlib utils autodoc)
2019-06-22 19:09:39 +00:00
package_gap() {
2024-03-19 19:20:48 +00:00
depends=(glibc
gmp
perl
readline
sh
2024-03-18 00:09:48 +00:00
zlib)
2022-10-12 12:35:55 +00:00
optdepends=('gap-packages: extra packages')
conflicts=(gap-doc)
provides=(gap-doc)
replaces=(gap-doc)
2024-03-19 19:20:48 +00:00
cd gap-$pkgver
2019-06-22 19:09:39 +00:00
2022-10-12 12:35:55 +00:00
make DESTDIR="$pkgdir" install
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-12 12:35:55 +00:00
for _pkg in $(ls "$pkgdir"/usr/share/gap/pkg); do
2022-10-21 12:49:51 +00:00
_ver=$(jq .[\"${_pkg}\"].Version "$srcdir"/package-infos-$pkgver.json | sed -e 's/"//g')
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-packages() {
2024-03-19 19:20:48 +00:00
depends=(gap
gcc-libs
glibc
perl
sh)
optdepends=('bliss: digraph package'
'c-xsc: float package'
2024-03-18 00:09:48 +00:00
'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'
2024-03-19 19:20:48 +00:00
cd gap-$pkgver
2019-06-22 19:09:39 +00:00
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
2024-03-19 19:20:48 +00:00
# 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
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
2022-12-19 02:55:36 +00:00
# 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
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
2024-03-19 19:20:48 +00:00
rm -r "$pkgdir"/usr/lib/gap/pkg/*/gen
2022-05-29 14:43:58 +00:00
# Add provides for bundled packages
2022-10-12 12:35:55 +00:00
for _pkg in $(ls "$pkgdir"/usr/lib/gap/pkg); do
2022-10-21 12:49:51 +00:00
_ver=$(jq .[\"${_pkg}\"].Version "$srcdir"/package-infos-$pkgver.json | sed -e 's/"//g')
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
}