Created
May 25, 2015 12:44
-
-
Save yuyichao/f147e831cef39e40f4ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BUILD_EXTRA=0 | |
pkgbase=julia-git | |
if ((BUILD_EXTRA)); then | |
pkgname=('julia-git' 'julia-doc-git' 'emacs-julia-mode-git') | |
else | |
pkgname=('julia-git') | |
fi | |
pkgver=0.3.0.rc3.4894.gdefb363 | |
pkgrel=1 | |
pkgdesc="Julia is a high-level, high-performance, dynamic programming language." | |
arch=('any' 'armv7h') | |
url="http://julialang.org" | |
license=('GPL') | |
makedepends=('gcc-fortran' 'arpack' 'fftw' 'git' 'gmp' 'libgit2' 'libunwind' | |
'llvm' 'mpfr' 'pcre' 'suitesparse' 'python2-sphinx' | |
'python2-sphinx_rtd_theme' 'python2-pip' 'texlive-langcjk' | |
'texlive-latexextra' 'emacs' 'openspecfun') | |
options=('!emptydirs' 'staticlibs' 'debug' 'strip') | |
source=('git://github.com/yuyichao/julia#branch=pre-compile') | |
md5sums=('SKIP') | |
pkgver() { | |
cd julia | |
git describe --tags | sed 's/^v//;s/-/./g' | |
} | |
prepare() { | |
cd julia | |
git reset --hard HEAD | |
git clean -fdx | |
git submodule init | |
git submodule sync | |
git submodule update | |
sed -i Makefile -e 's:\$(LD_LIBRARY_PATH):$(_LD_LIBRARY_PATH):g' | |
cd doc | |
# They use the Python2 version for sphinx which has on Arch a different name | |
sed -i Makefile -e 's/pip /pip2 /g' | |
rm -rf "${srcdir}/bin" | |
mkdir -p "${srcdir}/bin" | |
for c in cc gcc; do | |
cat > "${srcdir}/bin/${c}" <<EOF | |
#!/bin/bash | |
exec arm-linux-gnueabihf-${c} $CFLAGS --sysroot=$SYSROOT -Wl,-rpath-link,/usr/arm-linux-gnueabihf/lib:$SYSROOT/usr/lib "\$@" | |
EOF | |
chmod +x "${srcdir}/bin/${c}" | |
done | |
for c in c++ g++; do | |
cat > "${srcdir}/bin/${c}" <<EOF | |
#!/bin/bash | |
exec arm-linux-gnueabihf-${c} $CXXFLAGS --sysroot=$SYSROOT -Wl,-rpath-link,/usr/arm-linux-gnueabihf/lib:$SYSROOT/usr/lib "\$@" | |
EOF | |
chmod +x "${srcdir}/bin/${c}" | |
done | |
for c in gfortran; do | |
cat > "${srcdir}/bin/${c}" <<EOF | |
#!/bin/bash | |
exec arm-linux-gnueabihf-${c} --sysroot=$SYSROOT -Wl,-rpath-link,/usr/arm-linux-gnueabihf/lib:$SYSROOT/usr/lib "\$@" | |
EOF | |
chmod +x "${srcdir}/bin/${c}" | |
done | |
for c in llvm-config; do | |
cat > "${srcdir}/bin/${c}" <<EOF | |
#!/bin/bash | |
exec $SYSROOT/usr/bin/${c} "\$@" | |
EOF | |
chmod +x "${srcdir}/bin/${c}" | |
done | |
} | |
julia_opts=(prefix=/usr sysconfdir=/etc | |
USE_SYSTEM_LLVM=1 | |
USE_SYSTEM_LIBUNWIND=1 | |
USE_SYSTEM_PCRE=1 | |
USE_SYSTEM_LIBM=1 | |
USE_SYSTEM_OPENLIBM=0 | |
USE_SYSTEM_OPENSPECFUN=1 | |
USE_SYSTEM_DSFMT=0 | |
USE_SYSTEM_BLAS=1 | |
USE_SYSTEM_LAPACK=1 | |
USE_SYSTEM_FFTW=1 | |
USE_SYSTEM_GMP=1 | |
USE_SYSTEM_MPFR=1 | |
USE_SYSTEM_ARPACK=1 | |
USE_SYSTEM_SUITESPARSE=1 | |
USE_SYSTEM_RMATH=0 | |
USE_SYSTEM_LIBUV=0 | |
USE_SYSTEM_UTF8PROC=0 | |
USE_SYSTEM_LIBGIT2=1 | |
USE_INTEL_MKL=0 | |
USE_BLAS64=0 | |
USE_LLVM_SHLIB=0) | |
build() { | |
cd julia | |
export PATH="${srcdir}/bin:${PATH}" | |
make "${PWD}/usr/bin/stringreplace" "${julia_opts[@]}" | |
make release "${julia_opts[@]}" | |
make debug "${julia_opts[@]}" | |
if ! ((BUILD_EXTRA)); then | |
return | |
fi | |
(# Building doc | |
cd doc | |
make helpdb.jl | |
make man | |
make html | |
make latexpdf | |
make info) | |
(cd contrib | |
emacs --batch --eval \ | |
'(progn | |
(push "." load-path) | |
(byte-compile-file "julia-mode.el"))') | |
} | |
package_julia-git() { | |
arch=('armv7h') | |
depends=('arpack' 'fftw' 'gmp' 'libgit2' 'libunwind' 'llvm' 'mpfr' 'pcre' | |
'hicolor-icon-theme' 'xdg-utils' 'suitesparse' 'openspecfun') | |
optdepends=('gnuplot: If using the Gaston Package from julia') | |
install=julia.install | |
conflicts=('julia') | |
unset LD_PRELOAD | |
unset LD_LIBRARY_PATH | |
cd julia | |
export PATH="${srcdir}/bin:${PATH}" | |
make install DESTDIR="$pkgdir" "${julia_opts[@]}" | |
# Remove doc files | |
rm -r "$pkgdir/usr/share/doc/julia" | |
ver=$("$pkgdir/usr/bin/julia" \ | |
-f -e 'print(VERSION.major, ".", VERSION.minor, ".", VERSION.patch)') | |
provides=("julia=2:$ver") | |
} | |
package_julia-doc-git() { | |
arch=('any') | |
pkgdesc+=" (Documents)" | |
provides=('julia-doc') | |
conflicts=('julia-doc') | |
cd julia/doc/_build | |
install -D -m644 man/julialanguage.1 \ | |
"$pkgdir"/usr/share/man/man1/julialanguage.1 | |
install -D -m644 texinfo/JuliaLanguage.info \ | |
"$pkgdir"/usr/share/info/julialanguage.info | |
install -D -m644 latex/JuliaLanguage.pdf \ | |
"$pkgdir"/usr/share/doc/julia/julialanguage.pdf | |
cp -dpr --no-preserve=ownership html "$pkgdir"/usr/share/doc/julia/ | |
install ../helpdb.jl "$pkgdir"/usr/share/doc/julia/helpdb.jl | |
} | |
package_emacs-julia-mode-git() { | |
arch=('any') | |
pkgdesc="Emacs major mode for the Julia programming language" | |
provides=('emacs-julia-mode') | |
conflicts=('emacs-julia-mode') | |
cd julia/contrib | |
mkdir -p "$pkgdir/usr/share/emacs/site-lisp" | |
install -m644 julia-mode.el "$pkgdir/usr/share/emacs/site-lisp" | |
install -m644 julia-mode.elc "$pkgdir/usr/share/emacs/site-lisp" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment