2010-09-28 01:43:23 +08:00
#
# Platform Packages for Chakra, part of chakra-project.org
#
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
# include global config
source ../_buildscripts/${ current_repo } -${ _arch } -cfg.conf
pkgname = sage-mathematics
2011-06-23 12:02:26 +08:00
pkgver = 4.7
2010-09-28 01:43:23 +08:00
pkgrel = 1
pkgdesc = 'SAGE: Open Source Mathematics Software, a viable free alternative to Magma, Maple, Mathematica, and Matlab.'
url = 'http://www.sagemath.org'
arch = ( 'i686' 'x86_64' )
license = ( 'GPL' )
2011-06-23 12:02:26 +08:00
depends = ( 'ppl' )
makedepends = ( 'gcc-fortran' 'gcc-libs' 'desktop-file-utils' 'imagemagick' 'texlive-core' )
2010-09-28 01:43:23 +08:00
optdepends = ( 'imagemagick: some plotting functionality benefits from it'
'texlive-core: some plotting functionality benefits from it' )
options = ( '!makeflags' )
install = " ${ pkgname } .install "
source = ( " http://sage.math.washington.edu/home/release/sage- ${ pkgver } /sage- ${ pkgver } .tar "
'SAGE-notebook.desktop' )
2011-06-23 12:02:26 +08:00
md5sums = ( 'db4d891feed487e1696b8d01ae3b6469'
2011-07-10 05:31:15 +08:00
'dc391f12b7d17dd37326343ec0e99bbd' )
2010-09-28 01:43:23 +08:00
build( ) {
cd sage-${ pkgver }
# modularization of sage, sort of :)
2011-07-11 10:15:47 +08:00
#mkdir -p spkg/installed
#touch spkg/installed/readline-6.1
mkdir -p spkg/installed
touch spkg/installed/ppl-0.11.2
2010-09-28 01:43:23 +08:00
# fix "missing sage.all error" during build
unset CFLAGS
unset CXXFLAGS
# fix build errors
unset LDFLAGS
# enable multiple threads while building, is this really needed? check if uses MAKEFLAGS
2011-06-23 12:02:26 +08:00
export SAGE_BUILD_THREADS = $( lscpu | awk '/^CPU\(s\):/ { print $2 }' )
2010-09-28 01:43:23 +08:00
export MAKE = " make -j ${ SAGE_BUILD_THREADS } "
2011-06-23 12:02:26 +08:00
# use Chakra's fortran rather then the one that ships with sage to compile sage's fortran
export SAGE_FORTRAN = '/usr/bin/gfortran'
export SAGE_FORTRAN_LIB = '/usr/lib/libgfortran.so'
2010-09-28 01:43:23 +08:00
# disable building with debugging support
2011-06-23 12:02:26 +08:00
export SAGE_DEBUG = 'no'
2010-09-28 01:43:23 +08:00
# enable fat binaries (disables processor specific optimizations)
# comment out if you're only building it for yourself
export SAGE_FAT_BINARY = 'yes'
2011-06-23 12:02:26 +08:00
# can't write to root in a clean chroot
export DOT_SAGE = '/build/src/'
# only build sage, no documents
#make build
2010-09-28 01:43:23 +08:00
make
2011-06-23 12:02:26 +08:00
# uncomment if we want to run all the tests (warning: very long)
#make ptestlong
2010-09-28 01:43:23 +08:00
}
package( ) {
cd sage-${ pkgver }
# cp because make install is experimental and will corrupt the install
2011-06-23 12:02:26 +08:00
install -d ${ pkgdir } /opt/sage
2010-09-28 01:43:23 +08:00
cp -r * ${ pkgdir } /opt/sage
2011-06-23 12:02:26 +08:00
# move SageTeX files to more appropriate directory
install -d ${ pkgdir } /usr/share
mv ${ pkgdir } /opt/sage/local/share/texmf \
${ pkgdir } /usr/share
desktop-file-install ${ srcdir } /SAGE-notebook.desktop \
--dir ${ pkgdir } /usr/share/applications
2010-09-28 01:43:23 +08:00
2011-06-23 12:02:26 +08:00
# create link to main binary
2010-09-28 01:43:23 +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
2010-09-28 01:43:23 +08:00
rm -f ${ pkgdir } /opt/sage/install.log
rm -rf ${ pkgdir } /opt/sage/spkg/logs
2011-06-23 12:02:26 +08:00
# remove source packages, since they are rarely needed, they are 300mb in size (compressed), and no need to compile them, put them into aur/sage-mathematics-spkgs
2010-09-28 01:43:23 +08:00
rm -f ${ pkgdir } /opt/sage/spkg/base/*spkg
rm -f ${ pkgdir } /opt/sage/spkg/standard/*spkg
}