Julia update; use Tcl/Tk

This commit is contained in:
Michael Raskin 2012-12-09 02:51:06 +04:00
parent a2c2d8e28a
commit 47f0815655

View File

@ -1,14 +1,14 @@
{ stdenv, fetchgit, gfortran, perl, m4, llvm, gmp, pcre, zlib { stdenv, fetchgit, gfortran, perl, m4, llvm, gmp, pcre, zlib
, readline, fftwSinglePrec, fftw, libunwind, suitesparse, glpk, fetchurl , readline, fftwSinglePrec, fftw, libunwind, suitesparse, glpk, fetchurl
, ncurses, libunistring, lighttpd, patchelf, openblas, liblapack , ncurses, libunistring, lighttpd, patchelf, openblas, liblapack
, tcl, tk , tcl, tk, xproto, libX11
} : } :
let let
realGcc = stdenv.gcc.gcc; realGcc = stdenv.gcc.gcc;
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "julia"; pname = "julia";
date = "20121122"; date = "20121209";
name = "${pname}-git-${date}"; name = "${pname}-git-${date}";
grisu_ver = "1.1.1"; grisu_ver = "1.1.1";
@ -60,21 +60,20 @@ stdenv.mkDerivation rec {
src = fetchgit { src = fetchgit {
url = "git://github.com/JuliaLang/julia.git"; url = "git://github.com/JuliaLang/julia.git";
rev = "53598b026b6fd9f79eba02cbc4e2d6c38ca32bd7"; rev = "5e984360db6ab528938b470d31352f2c3999c681";
sha256 = "159yasgfbbj6px16kgwf7bg478giv8zbm5hg90ipncp1ls2lv3jy"; sha256 = "1kpywih2zz5nfih3byhdqfh09jqb68llq1dsbwkdwmvqv34dd67k";
}; };
buildInputs = [ gfortran perl m4 gmp pcre llvm readline zlib buildInputs = [ gfortran perl m4 gmp pcre llvm readline zlib
fftw fftwSinglePrec libunwind suitesparse glpk ncurses libunistring patchelf fftw fftwSinglePrec libunwind suitesparse glpk ncurses libunistring patchelf
openblas liblapack openblas liblapack tcl tk xproto libX11
]; ];
configurePhase = '' configurePhase = ''
for i in GMP LLVM PCRE LAPACK OPENBLAS BLAS READLINE FFTW LIBUNWIND SUITESPARSE GLPK LIGHTTPD ZLIB; for i in GMP LLVM PCRE LAPACK OPENBLAS BLAS READLINE FFTW LIBUNWIND SUITESPARSE GLPK LIGHTTPD ZLIB;
do do
sed -e "s@USE_SYSTEM_$i=0@USE_SYSTEM_$i=1@" -i Make.inc; makeFlags="$makeFlags USE_SYSTEM_$i=1 "
done done
sed -e 's@-lcurses@@g' -i Make.inc
copy_kill_hash(){ copy_kill_hash(){
cp "$1" "$2/$(basename "$1" | sed -e 's/^[a-z0-9]*-//')" cp "$1" "$2/$(basename "$1" | sed -e 's/^[a-z0-9]*-//')"
@ -89,8 +88,6 @@ stdenv.mkDerivation rec {
''export NIX_LDFLAGS="$NIX_LDFLAGS -L${realGcc}/lib -L${realGcc}/lib64 -lpcre -llapack -lm -lfftw3f -lfftw3 -lglpk -lunistring -lz "''} ''export NIX_LDFLAGS="$NIX_LDFLAGS -L${realGcc}/lib -L${realGcc}/lib64 -lpcre -llapack -lm -lfftw3f -lfftw3 -lglpk -lunistring -lz "''}
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -fPIC " export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -fPIC "
sed -e 's@ cpp @ gcc -E @g' -i base/Makefile
export LDFLAGS="-L${suitesparse}/lib -L$out/lib/julia -Wl,-rpath,$out/lib/julia" export LDFLAGS="-L${suitesparse}/lib -L$out/lib/julia -Wl,-rpath,$out/lib/julia"
export GLPK_PREFIX="${glpk}/include" export GLPK_PREFIX="${glpk}/include"
@ -107,20 +104,17 @@ stdenv.mkDerivation rec {
''; '';
preBuild = '' preBuild = ''
make -C test/unicode all SHELL="${stdenv.shell}"
make -C extras glpk_h.jl GLPK_PREFIX="$GLPK_PREFIX" SHELL="${stdenv.shell}"
mkdir -p usr/lib mkdir -p usr/lib
ln -s libuv.a usr/lib/uv.a ln -s libuv.a usr/lib/uv.a
''; '';
postInstall = '' postInstall = ''
ld -E --whole-archive --shared ${suitesparse}/lib/lib*[a-z].a -o "$out"/lib/libsuitesparse-shared.so make -C deps install-tk-wrapper
for i in umfpack cholmod amd camd colamd btf cxsparse ldl rbio spqr suitesparseconfig; do
ln -s "libsuitesparse-shared.so" "$out/lib/lib$i.so" (
done cd $out/share/julia/test/
ln -s "${lighttpd}/sbin/lighttpd" "$out/sbin/" $out/bin/julia runtests.jl all
ln -s "${lighttpd}/lib/"* "$out/lib/" ) || true
''; '';
meta = { meta = {