mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-08 22:45:43 +00:00
127 lines
4.5 KiB
Bash
127 lines
4.5 KiB
Bash
# 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>
|
|
# - fix semigroups.so rpath fix for aarch64
|
|
|
|
pkgbase=gap
|
|
pkgname=(gap gap-doc gap-packages)
|
|
pkgver=4.10.0
|
|
pkgrel=7
|
|
pkgdesc="Groups, Algorithms, Programming: a system for computational discrete algebra"
|
|
arch=(x86_64)
|
|
url="https://www.gap-system.org/"
|
|
license=(GPL)
|
|
source=("https://www.gap-system.org/pub/gap/gap-${pkgver%.*}/tar.gz/gap-$pkgver.tar.gz" gap.sh
|
|
gap-sagemath-1.patch gap-sagemath-2.patch gap-sagemath-3.patch
|
|
gap-polymake-3.3.patch)
|
|
sha256sums=('314b8d949c0bb01ef8bee199b29571d42714df660aba0d76ded254f58295904f'
|
|
'143fb8a79a52c007903cce13407850df309ef803a9b00398d05169355917de46'
|
|
'e5f0a71ae5cdcc6596330834ef9fb0a0183890a9cf874a7eb88b819b0030a33b'
|
|
'3b66e6b320f56119b1d8eb804a94ee3a7ea71af10bd4f99a61bae32840e62c87'
|
|
'511414a8d085a9ef9de5f921fdd45e4bbb3f33c2d88b821da06dfc267c182ddc'
|
|
'c92849b2643e0e21ffdcfa230fb23fe4a276ec15402f178d5d69ddb0e537fbbe')
|
|
makedepends=(libxaw givaro mpfi normaliz boost c-xsc zeromq fplll polymake wget chrpath)
|
|
|
|
prepare() {
|
|
cd gap-$pkgver
|
|
|
|
# Use system normaliz
|
|
sed -e '/build-normaliz.sh/d' -i bin/BuildPackages.sh
|
|
# Disable anupq package, it's i686 only
|
|
rm -r pkg/anupq-*
|
|
# 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
|
|
|
|
# Patches to make sagemath work with GAP's libgap
|
|
patch -p1 -i ../gap-sagemath-1.patch
|
|
patch -p1 -i ../gap-sagemath-2.patch
|
|
patch -p1 -i ../gap-sagemath-3.patch
|
|
|
|
cd pkg/PolymakeInterface*
|
|
patch -p2 -i "$srcdir"/gap-polymake-3.3.patch # Fix build of PolymakeInterface with polymake 3.3
|
|
}
|
|
|
|
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 MAKEFLAGS='-j1' # Fix build of carat package
|
|
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
|
|
}
|
|
|
|
_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' 'gap-doc: documentation')
|
|
conflicts=(libgap)
|
|
replaces=(gap-data libgap gap-4.8 gap-4.8-data)
|
|
cd gap-$pkgver
|
|
|
|
make DESTDIR="$pkgdir" install-headers install-libgap
|
|
# Install missing header
|
|
install -Dm644 gen/config.h -t "$pkgdir"/usr/include/gap
|
|
|
|
mkdir -p "$pkgdir"/usr/{bin,lib/gap/pkg}
|
|
cp -r grp lib "$pkgdir"/usr/lib/gap
|
|
for _pkg in ${_standardpkgs[@]}; do
|
|
cp -r pkg/$_pkg "$pkgdir"/usr/lib/gap/pkg
|
|
done
|
|
install -Dm755 gap -t "$pkgdir"/usr/lib/gap
|
|
# Install launcher script
|
|
install -Dm755 "$srcdir"/gap.sh "$pkgdir"/usr/bin/gap
|
|
}
|
|
|
|
package_gap-doc() {
|
|
depends=(gap)
|
|
replaces=(gap-4.8-doc)
|
|
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)
|
|
replaces=(gap-4.8-packages)
|
|
optdepends=('normaliz: Normaliz interface package' 'libxaw: xgap package' 'c-xsc: float package' 'mpfi: float package'
|
|
'libmpc: float package' 'fplll: float package' 'zeromq: ZeroMQ interface package'
|
|
'polymake: Polymake interface package' 'curl: curl interface package')
|
|
pkgdesc="Extra packages for GAP"
|
|
cd gap-$pkgver
|
|
|
|
mkdir -p "$pkgdir"/usr/lib/gap
|
|
cp -r pkg "$pkgdir"/usr/lib/gap
|
|
|
|
# provided by main gap package
|
|
for _pkg in ${_standardpkgs[@]}; do
|
|
rm -r "$pkgdir"/usr/lib/gap/pkg/$_pkg
|
|
done
|
|
|
|
# fix RPATH
|
|
if [[ $CARCH == "aarch64" ]]; then
|
|
chrpath -r \$ORIGIN/../lib/ "$pkgdir"/usr/lib/gap/pkg/semigroups-*/bin/aarch64-unknown-linux-gnu-default64/semigroups.so
|
|
chrpath -d "$pkgdir"/usr/lib/gap/pkg/NormalizInterface-*/bin/aarch64-unknown-linux-gnu-default64/NormalizInterface.so
|
|
fi
|
|
|
|
# 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
|
|
}
|