PKGBUILDs/community/gap/PKGBUILD

124 lines
4.2 KiB
Bash
Raw Normal View History

2018-11-08 14:46:55 +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>
# - fix semigroups.so rpath fix for aarch64
pkgbase=gap
pkgname=(gap gap-doc gap-packages)
2019-03-09 16:48:24 +00:00
pkgver=4.10.1
2019-04-07 16:50:35 +00:00
pkgrel=3
2018-11-08 14:46:55 +00:00
pkgdesc="Groups, Algorithms, Programming: a system for computational discrete algebra"
arch=(x86_64)
url="https://www.gap-system.org/"
license=(GPL)
2018-12-23 16:33:57 +00:00
source=("https://www.gap-system.org/pub/gap/gap-${pkgver%.*}/tar.gz/gap-$pkgver.tar.gz" gap.sh
2019-02-13 20:20:37 +00:00
gap-polymake-3.3.patch)
2019-03-09 16:48:24 +00:00
sha256sums=('b2d8800e338a6a9afdf92b06368c2e1a16b8adebffcd4c10319c1b3a4e827e45'
2018-12-23 16:33:57 +00:00
'143fb8a79a52c007903cce13407850df309ef803a9b00398d05169355917de46'
2019-02-13 20:20:37 +00:00
'c92849b2643e0e21ffdcfa230fb23fe4a276ec15402f178d5d69ddb0e537fbbe')
2018-11-08 14:46:55 +00:00
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-*
2019-03-02 17:25:14 +00:00
# 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
2018-12-23 16:33:57 +00:00
2019-02-13 20:20:37 +00:00
cd pkg/PolymakeInterface*
patch -p2 -i "$srcdir"/gap-polymake-3.3.patch # Fix build of PolymakeInterface with polymake 3.3
2018-11-08 14:46:55 +00:00
}
build() {
cd gap-$pkgver
./configure --prefix=/usr --with-gmp=system
2019-03-02 17:25:14 +00:00
# https://bugzilla.gnome.org/show_bug.cgi?id=655517
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
2018-11-08 14:46:55 +00:00
make
2019-03-09 16:48:24 +00:00
make libgap.la
2018-11-08 14:46:55 +00:00
2019-03-02 17:25:14 +00:00
# Install libgap so we can link packages against it
mkdir -p tmp-install
2019-03-09 16:48:24 +00:00
libtool --mode=install install libgap.la "$srcdir"/gap-$pkgver/tmp-install
2019-03-02 17:25:14 +00:00
2018-11-08 14:46:55 +00:00
cd pkg
export MAKEFLAGS='-j1' # Fix build of carat package
2019-03-17 22:43:14 +00:00
export CXXFLAGS+=" -I/usr/include/cxsc" # Find c-xsc headers
2019-03-09 16:48:24 +00:00
export LDFLAGS+=" -L$srcdir/gap-$pkgver/tmp-install -lgap" # See https://trac.sagemath.org/ticket/27372
export LD_LIBRARY_PATH="$srcdir"/gap-$pkgver/tmp-install
2018-11-08 14:46:55 +00:00
../bin/BuildPackages.sh
}
2018-12-23 16:33:57 +00:00
_standardpkgs=(GAPDoc-* primgrp-* SmallGrp-* transgrp atlasrep autpgrp-* alnuth-* crisp-* ctbllib FactInt-* fga irredsol-* laguna-*
polenta-* polycyclic-* resclasses-* sophus-* tomlib-*)
2018-11-08 14:46:55 +00:00
package_gap() {
2018-12-23 16:33:57 +00:00
depends=(gmp zlib)
2018-11-08 14:46:55 +00:00
optdepends=('gap-packages: extra packages' 'gap-doc: documentation')
2018-12-23 16:33:57 +00:00
conflicts=(libgap)
replaces=(gap-data libgap gap-4.8 gap-4.8-data)
2018-11-08 14:46:55 +00:00
cd gap-$pkgver
2019-03-09 16:48:24 +00:00
install -Dm644 src/*.h -t "$pkgdir"/usr/include/gap
2018-12-23 16:33:57 +00:00
install -Dm644 gen/config.h -t "$pkgdir"/usr/include/gap
2019-03-09 16:48:24 +00:00
install -Dm644 src/hpc/*.h -t "$pkgdir"/usr/include/gap/hpc
install -d "$pkgdir"/usr/lib
libtool --mode=install install libgap.la "$pkgdir"/usr/lib
2018-11-08 14:46:55 +00:00
mkdir -p "$pkgdir"/usr/{bin,lib/gap/pkg}
cp -r grp lib "$pkgdir"/usr/lib/gap
2018-12-23 16:33:57 +00:00
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
2018-11-08 14:46:55 +00:00
}
package_gap-doc() {
depends=(gap)
2018-12-23 16:33:57 +00:00
replaces=(gap-4.8-doc)
2018-11-08 14:46:55 +00:00
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)
2018-12-23 16:33:57 +00:00
replaces=(gap-4.8-packages)
2018-11-08 14:46:55 +00:00
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
2018-12-23 16:33:57 +00:00
for _pkg in ${_standardpkgs[@]}; do
rm -r "$pkgdir"/usr/lib/gap/pkg/$_pkg
done
2018-11-08 14:46:55 +00:00
# fix RPATH
if [[ $CARCH == "aarch64" ]]; then
2019-03-09 16:48:24 +00:00
chrpath -r \$ORIGIN/../lib/ "$pkgdir"/usr/lib/gap/pkg/semigroups-*/bin/aarch64-*/semigroups.so
chrpath -d "$pkgdir"/usr/lib/gap/pkg/NormalizInterface-*/bin/aarch64-*/NormalizInterface.so
2018-11-08 14:46:55 +00:00
fi
2019-03-02 17:25:14 +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
2018-11-08 14:46:55 +00:00
}