-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
template
51 lines (43 loc) · 1.53 KB
/
template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Template file for 'palp'
pkgname=palp
version=2.21
revision=1
build_style=gnu-makefile
checkdepends="singular"
short_desc="Package for analyzing lattice polytopes"
maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
license="GPL-3.0-only"
homepage="http://hep.itp.tuwien.ac.at/~kreuzer/CY/CYpalp.html"
distfiles="http://hep.itp.tuwien.ac.at/~kreuzer/CY/palp/palp-${version}.tar.gz"
checksum=7e4a7bf219998a844c0bcce0a176e49d0743cb4b505a0e195329bf2ec196ddd7
# build procedure taken from sagemath, see
# https://git.sagemath.org/sage.git/plain/build/pkgs/palp/spkg-install.in
# https://github.com/archlinux/svntogit-community/blob/packages/palp/trunk/PKGBUILD
do_build() {
: ${make_cmd:=make}
mkdir bin
mv Global.h Global.h-template
for dim in 4 5 6 11; do
echo Building PALP optimized for $dim dimensions
sed "s/^#define[^a-zA-Z]*POLY_Dmax.*/#define POLY_Dmax $dim/" Global.h-template > Global.h
${make_cmd} \
CC="$CC" CXX="$CXX" LD="$LD" AR="$AR" RANLIB="$RANLIB" \
CPP="$CPP" AS="$AS" OBJCOPY="$OBJCOPY" OBJDUMP="$OBJDUMP" \
CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" \
${makejobs} ${make_build_args} ${make_build_target}
for file in poly class cws nef mori; do
mv ${file}.x bin/${file}-${dim}d.x
done
# make sure we rebuild after changing Global.h to avoid races
${make_cmd} cleanall
done
}
do_install() {
for file in poly class cws nef mori; do
for dim in 4 5 6 11; do
vbin bin/${file}-${dim}d.x
done
# symlink for the default dimension
ln -sf ${file}-6d.x ${DESTDIR}/usr/bin/${file}.x
done
}