summaryrefslogtreecommitdiff
path: root/community/sage-mathematics
diff options
context:
space:
mode:
authorNicolás Reynolds <fauno@endefensadelsl.org>2013-12-27 23:55:53 +0000
committerNicolás Reynolds <fauno@endefensadelsl.org>2013-12-27 23:55:53 +0000
commit65eeff79fff8a1bfdf67ca51d147384f46f4d5c0 (patch)
treefbfdff322b28d9a3c37e6e31c94caf1d8e48dac1 /community/sage-mathematics
parentd53c44f055929b18d7d1b25f8367ee5836c435fc (diff)
Fri Dec 27 23:54:04 UTC 2013
Diffstat (limited to 'community/sage-mathematics')
-rw-r--r--community/sage-mathematics/PKGBUILD168
-rw-r--r--community/sage-mathematics/SAGE-notebook.desktop19
-rw-r--r--community/sage-mathematics/fix-pil.patch12
-rw-r--r--community/sage-mathematics/sage-mathematics.install4
4 files changed, 118 insertions, 85 deletions
diff --git a/community/sage-mathematics/PKGBUILD b/community/sage-mathematics/PKGBUILD
index 3046bc23a..1a6718f5c 100644
--- a/community/sage-mathematics/PKGBUILD
+++ b/community/sage-mathematics/PKGBUILD
@@ -1,111 +1,155 @@
-# $Id: PKGBUILD 96935 2013-09-09 01:33:22Z dwallace $
-# Maintainer: Daniel Wallace <danielwallace at gtmanfred dot com>
-# Contributor: Antonio Rojas < nqn1976 @ gmail.com >
-# Contributor: Thomas Dziedzic < gostrc at gmail >
-# Contributor: Osman Ugus <ugus11@yahoo.com>
-# Contributor: Stefan Husmann <stefan-husmann@t-online.de>
+# $Id: PKGBUILD 102937 2013-12-24 15:23:39Z arcanis $
+# Maintainer: Evgeniy Alekseev <arcanis.arch at gmail dot com>
+# Contributor: Daniel Wallace <danielwallace at gtmanfred dot com>
+# Contributor: Antonio Rojas <nqn1976 at gmail dot com>
+# Contributor: Thomas Dziedzic <gostrc at gmail dot com>
+# Contributor: Osman Ugus <ugus11 at yahoo dot com>
+# Contributor: Stefan Husmann <stefan-husmann at t-online dot de>
# Special thanks to Nareto for moving the compile from the .install to the PKGBUILD
pkgname=sage-mathematics
-pkgver=5.11
-pkgrel=1
-pkgdesc='SAGE: Open Source Mathematics Software, a viable free alternative to Magma, Maple, Mathematica, and Matlab.'
-url='http://www.sagemath.org'
+pkgver=6.0
+pkgrel=2
+pkgdesc="SAGE: Open Source Mathematics Software, a viable free alternative to Magma, Maple, Mathematica, and Matlab"
arch=('i686' 'x86_64')
+url="http://www.sagemath.org"
license=('GPL')
-#depends=('xz' 'java-environment=7' 'desktop-file-utils' 'libxmu' 'libtiff' 'sqlite' 'libjpeg-turbo')
-depends=('desktop-file-utils')
-makedepends=('gcc-fortran' 'freetype2')
+#depends=('desktop-file-utils' 'java-environment=7' 'libjpeg-turbo' 'libtiff' 'libxmu' 'sqlite' 'xz')
+depends=('freetype2>=2.3.5')
+makedepends=('gcc-fortran' 'gendesk' 'desktop-file-utils')
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'
'cairo: R plots')
-install="${pkgname}.install"
source=("http://sage.math.washington.edu/home/release/sage-${pkgver}/sage-${pkgver}.tar"
- 'SAGE-notebook.desktop'
- 'sage.service')
+ "fix-pil.patch"
+ "sage.service")
+install="${pkgname}.install"
+md5sums=('da1bacf90fc291e736aaa71431e8874e'
+ 'de54cb818d74c070a524fc3fd5208b2c'
+ '985da1c1d1dcdc3ea9aa73035cb7996b')
-build() {
- cd sage-${pkgver}
+prepare() {
+ # create *.desktop file
+ gendesk -n \
+ --pkgname="sage-notebook" \
+ --pkgdesc="sage notebook" \
+ --name="sage" \
+ --exec="/opt/sage/sage -notebook" \
+ --terminal=true \
+ --categories="Science;Math" \
+ --custom="StartupNotify=true
+X-DCOP-ServiceType=
+X-KDE-SubstituteUID=false
+X-KDE-Username="
+
+ # create DOT_SAGE directory
+ if [[ -d ${srcdir}/build ]]; then
+ rm -rf "${srcdir}/build"
+ fi
+ mkdir "${srcdir}/build"
+
+ # according to FS#34769
+ # NOTE: there is an error in pil build (freetype/fterrors.h not found)
+ cd "${srcdir}/sage-${pkgver}/upstream/"
+ tar xjfv pil-1.1.6.tar.bz2
+ rm -r pil-1.1.6.tar.bz2
+ patch -p0 -i "${srcdir}/fix-pil.patch"
+ tar cjvf pil-1.1.6.tar.bz2 pil-1.1.6
+ rm -rf pil-1.1.6
+ # fix checksums
+ SUMS=$(md5sum pil-1.1.6.tar.bz2 | awk '{print $1}')
+ sed "s/md5=[0-9a-f]\{32\}/md5=${SUMS}/" -i "${srcdir}/sage-${pkgver}/build/pkgs/pil/checksums.ini"
+ SUMS=$(sha1sum pil-1.1.6.tar.bz2 | awk '{print $1}')
+ sed "s/sha1=[0-9a-f]\{40\}/sha1=${SUMS}/" -i "${srcdir}/sage-${pkgver}/build/pkgs/pil/checksums.ini"
+ SUMS=$(cksum pil-1.1.6.tar.bz2 | awk '{print $1}')
+ sed "s/cksum=[0-9a-f]\{10\}/cksum=${SUMS}/" -i "${srcdir}/sage-${pkgver}/build/pkgs/pil/checksums.ini"
+ # disable freetype build
+ rm -rf freetype-*
+ sed -i -e 's/FREETYPE/#FREETYPE/' "${srcdir}/sage-${pkgver}/build/install"
+}
+build() {
+ cd "sage-${pkgver}"
+
# 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
+
export MAKE="make -j$(nproc)"
-
+
# use archlinux's fortran rather then the one that ships with sage to compile sage's fortran
export FC=/usr/bin/gfortran
-
+
# disable building with debugging support
export SAGE_DEBUG='no'
-
+
# enable fat binaries (disables processor specific optimizations)
# comment out if you're only building it for yourself
export SAGE_FAT_BINARY='yes'
-
+
# can't write to root in a clean chroot
- mkdir "$srcdir/buiild"
- export DOT_SAGE="$srcdir/build"
-
- # Singular is broken
+ export DOT_SAGE="${srcdir}/build"
+
+ # singular is broken
export CPP='/usr/bin/cpp'
-
+
# only build sage, no documents
#make build
make
- ./sage --bdist "$pkgver"
+ ./sage --bdist "${pkgver}"
}
<< COMMENT
check() {
- cd sage-${pkgver}
-
+ cd "sage-${pkgver}"
+
+ make test
+
# uncomment if we want to run all the tests (warning: very long)
#make ptestlong
}
COMMENT
package() {
- cd sage-${pkgver}
-
+ cd "sage-${pkgver}"
+
# cp because make install is experimental and will corrupt the install
- install -d ${pkgdir}/opt/sage
- cp -dpr --no-preserve=ownership dist/sage-"$pkgver-$CARCH-Linux/"* ${pkgdir}/opt/sage/
-
+ 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
-
- desktop-file-install ${srcdir}/SAGE-notebook.desktop \
- --dir ${pkgdir}/usr/share/applications
-
- # create link to main binary
- install -d ${pkgdir}/usr/bin
- ln -s /opt/sage/sage ${pkgdir}/usr/bin/sage
-
+ install -d "${pkgdir}/usr/share"
+ mv "${pkgdir}/opt/sage/local/share/texmf" "${pkgdir}/usr/share"
+
# remove build logs
- rm -f ${pkgdir}/opt/sage/*.log
- rm -rf ${pkgdir}/opt/sage/spkg/logs
-
+ rm -f "${pkgdir}/opt/sage/*.log"
+ rm -rf "${pkgdir}/opt/sage/spkg/logs"
+
# 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
-
+ rm -f "${pkgdir}/opt/sage/spkg/base/*spkg"
+ rm -f "${pkgdir}/opt/sage/spkg/standard/*spkg"
+
+ # according to FS#37090
+ # install scripts
+ install -d "${pkgdir}/usr/bin"
+ ./sage -c "install_scripts('${pkgdir}/usr/bin', ignore_existing=True)"
+ # rename scripts to avoid conflicts
+ for ITEM in $(ls "${pkgdir}/usr/bin"); do
+ mv "${pkgdir}/usr/bin/${ITEM}" "${pkgdir}/usr/bin/sage-${ITEM}"
+ done
+ ln -s "/opt/sage/sage" "${pkgdir}/usr/bin/sage"
+
# install a systemd user unit
- install -Dm755 $srcdir/sage.service $pkgdir/usr/lib/systemd/user/sage.service
+ install -Dm644 "${srcdir}/sage.service" "${pkgdir}/usr/lib/systemd/user/sage.service"
+ # install *.desktop and icon files
+ install -Dm644 "${srcdir}/sage-notebook.desktop" \
+ "${pkgdir}/usr/share/applications/SAGE-notebook.desktop"
+ install -Dm644 "${pkgdir}/opt/sage/local/lib/python2.7/site-packages/sagenb-0.10.7.2-py2.7.egg/sagenb/data/sage/images/icon128x128.png" \
+ "${pkgdir}/usr/share/pixmaps/SAGE-notebook.png"
}
# vim :set ts=2 sw=2 et:
-md5sums=('ceeccaa83f45a4fb674acf10f76543d8'
- 'b82f94383829eee26648feb977e2d89b'
- '985da1c1d1dcdc3ea9aa73035cb7996b')
-md5sums=('ceeccaa83f45a4fb674acf10f76543d8'
- 'b82f94383829eee26648feb977e2d89b'
- '985da1c1d1dcdc3ea9aa73035cb7996b')
diff --git a/community/sage-mathematics/SAGE-notebook.desktop b/community/sage-mathematics/SAGE-notebook.desktop
deleted file mode 100644
index e3c1d4d7f..000000000
--- a/community/sage-mathematics/SAGE-notebook.desktop
+++ /dev/null
@@ -1,19 +0,0 @@
-[Desktop Entry]
-Version=1.0
-Name=SAGE
-Comment=SAGE NOTEBOOK
-Comment[en_US]=SAGE NOTEBOOK
-Exec=/opt/sage/sage -notebook
-GenericName=
-GenericName[de]=
-Icon=/opt/sage/devel/ext-main/notebook/images/sageicon.png
-MimeType=
-Name[de]=SAGE
-StartupNotify=true
-Terminal=true
-Type=Application
-Categories=Science;Math;
-X-DCOP-ServiceType=
-X-KDE-SubstituteUID=false
-X-KDE-Username=
-GenericName[en_US]=
diff --git a/community/sage-mathematics/fix-pil.patch b/community/sage-mathematics/fix-pil.patch
new file mode 100644
index 000000000..a17f26833
--- /dev/null
+++ b/community/sage-mathematics/fix-pil.patch
@@ -0,0 +1,12 @@
+diff -ruN pil-1.1.6.orig/_imagingft.c pil-1.1.6/_imagingft.c
+--- pil-1.1.6.orig/_imagingft.c 2013-12-23 17:45:39.991183855 +0400
++++ pil-1.1.6/_imagingft.c 2013-12-23 17:49:06.297861197 +0400
+@@ -65,7 +65,7 @@
+ const char* message;
+ } ft_errors[] =
+
+-#include <freetype/fterrors.h>
++#include <freetype2/fterrors.h>
+
+ /* -------------------------------------------------------------------- */
+ /* font objects */
diff --git a/community/sage-mathematics/sage-mathematics.install b/community/sage-mathematics/sage-mathematics.install
index 3da751689..6c55dad2b 100644
--- a/community/sage-mathematics/sage-mathematics.install
+++ b/community/sage-mathematics/sage-mathematics.install
@@ -2,10 +2,6 @@ post_install() {
cd /opt/sage
update-desktop-database -q
- # set HOME because when sage updates its sage_root (after being moved) it will write files to ~/.sage with root ownership
- # the files it writes to ~/.sage can be safely ignored
- HOME=/tmp ./sage -c
-
# add sagemath user for the daemon
useradd -r -c 'Sage daemon' -d /opt/sage -s /bin/false sagemath