core/sage-mathematics/PKGBUILD

83 lines
2.5 KiB
Bash
Raw Normal View History

2013-03-24 08:34:14 +08:00
# Maintainer: Manu
pkgname=sage-mathematics
2013-03-24 08:34:14 +08:00
pkgver=5.8
pkgrel=1
2013-03-24 08:34:14 +08:00
pkgdesc='SAGE: Open Source Mathematics Software, a viable free alternative to Magma, Maple, Mathematica, and Matlab.'
url='http://www.sagemath.org'
2013-03-24 08:34:14 +08:00
arch=('x86_64')
license=('GPL')
2013-03-24 08:34:14 +08:00
depends=('desktop-file-utils')
makedepends=('gcc-fortran' )
optdepends=('imagemagick: some plotting functionality benefits from it'
'texlive-core: some plotting functionality benefits from it, also to use SageTeX'
'openssh: to use the notebook in secure mode'
'ffmpeg: to show animations')
options=('!makeflags')
install="${pkgname}.install"
source=("http://sage.math.washington.edu/home/release/sage-${pkgver}/sage-${pkgver}.tar"
'SAGE-notebook.desktop')
md5sums=('b91d6c20798f396a9c875527c78b3587'
'b82f94383829eee26648feb977e2d89b')
2012-04-26 13:31:30 +08:00
build() {
2013-03-24 08:34:14 +08:00
cd sage-${pkgver}
2013-03-24 08:34:14 +08:00
# fix "missing sage.all error" during build
unset CFLAGS
unset CXXFLAGS
2012-04-26 13:31:30 +08:00
2013-03-24 08:34:14 +08:00
# fix build errors
unset LDFLAGS
2013-03-24 08:34:14 +08:00
# enable multiple threads while building, is this really needed? check if uses MAKEFLAGS
export SAGE_BUILD_THREADS=$(lscpu | awk '/^CPU\(s\):/ { print $2 }')
export MAKE="make -j${SAGE_BUILD_THREADS}"
2011-06-23 12:02:26 +08:00
2013-03-24 08:34:14 +08:00
# use archlinux's fortran rather then the one that ships with sage to compile sage's fortran
export FC=/usr/bin/gfortran
2012-04-26 13:31:30 +08:00
# disable building with debugging support
2011-06-23 12:02:26 +08:00
export SAGE_DEBUG='no'
# enable fat binaries (disables processor specific optimizations)
# comment out if you're only building it for yourself
2013-03-24 08:34:14 +08:00
export SAGE_FAT_BINARY='yes'
2011-06-23 12:02:26 +08:00
2013-03-24 08:34:14 +08:00
# can't write to root in a clean chroot
export DOT_SAGE='/build/src/'
2011-06-23 12:02:26 +08:00
2013-03-24 08:34:14 +08:00
# only build sage, no documents
#make build
make
./sage --bdist "$pkgver"
}
package() {
2013-03-24 08:34:14 +08:00
cd sage-${pkgver}
# cp because make install is experimental and will corrupt the install
2013-03-24 08:34:14 +08:00
install -d ${pkgdir}/opt/sage
cp -dpr --no-preserve=ownership dist/sage-"$pkgver-$CARCH-Linux/"* ${pkgdir}/opt/sage/
# move SageTeX files to more appropriate directory
install -d ${pkgdir}/usr/share
mv ${pkgdir}/opt/sage/local/share/texmf \
${pkgdir}/usr/share
2011-06-23 12:02:26 +08:00
2013-03-24 08:34:14 +08:00
desktop-file-install ${srcdir}/SAGE-notebook.desktop \
--dir ${pkgdir}/usr/share/applications
2011-06-23 12:02:26 +08:00
# create link to main binary
2013-03-24 08:34:14 +08:00
install -d ${pkgdir}/usr/bin
ln -s /opt/sage/sage ${pkgdir}/usr/bin/sage
2011-06-23 12:02:26 +08:00
# remove build logs
2013-03-24 08:34:14 +08:00
rm -f ${pkgdir}/opt/sage/*.log
rm -rf ${pkgdir}/opt/sage/spkg/logs
2013-03-24 08:34:14 +08:00
# remove source packages, since they are rarely needed, they are 300mb in size (compressed)
rm -f ${pkgdir}/opt/sage/spkg/base/*spkg
rm -f ${pkgdir}/opt/sage/spkg/standard/*spkg
}