2009-04-09 16:24:33 +01:00
|
|
|
{stdenv, fetchurl, gfortran, readline, ncurses, perl, flex,
|
2012-09-19 18:56:56 +01:00
|
|
|
bison, autoconf, automake, sourceFromHead, config, lib, atlas, gperf, python, glibc, gnuplot, texinfo, texLive, qhull, libX11}:
|
2008-12-02 22:55:45 +00:00
|
|
|
|
2009-04-09 16:24:33 +01:00
|
|
|
let commonBuildInputs = [gfortran readline ncurses perl glibc qhull libX11 texinfo]; in
|
2008-12-02 22:55:45 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation ({
|
|
|
|
NIX_LDFLAGS = "-lpthread";
|
2009-04-22 00:18:09 +01:00
|
|
|
configureFlags = "--enable-readline --enable-dl";
|
2008-12-02 22:55:45 +00:00
|
|
|
meta = {
|
|
|
|
description = "High-level interactive language for numerical computations";
|
|
|
|
homepage = http://www.octave.org;
|
|
|
|
license = "GPL-3";
|
|
|
|
};
|
|
|
|
} // (
|
2012-09-19 18:56:56 +01:00
|
|
|
if (config.octave.devVersion or false) then {
|
2008-12-02 22:55:45 +00:00
|
|
|
name = "octave-hg"; # developement version mercurial repo
|
2009-12-11 13:58:23 +00:00
|
|
|
# REGION AUTO UPDATE: { name="octave"; type = "hg"; url = "http://www.octave.org/hg/octave"; }
|
|
|
|
src = sourceFromHead "octave-03b414516dd8.tar.gz"
|
|
|
|
(fetchurl { url = "http://mawercer.de/~nix/repos/octave-03b414516dd8.tar.gz"; sha256 = "30877f1e2ff1a456e7a76153aabf7c59ce7c7a8b63eda0515b1eead6a4351ce7"; });
|
|
|
|
# END
|
2008-12-02 22:55:45 +00:00
|
|
|
# HOME is set to $TMP because octave needs to access ${HOME}/.octave_hist while running targets
|
|
|
|
# in doc/interpreter.. Maybe this can be done better. This hack is fastest :)
|
|
|
|
preConfigure = ''
|
|
|
|
# glob is contained in glibc! Don't know why autotools want to use -lglob
|
|
|
|
sed -i 's/-lglob//' configure.in
|
|
|
|
./autogen.sh
|
|
|
|
export HOME=$TMP
|
|
|
|
'';
|
2009-04-08 21:06:03 +01:00
|
|
|
buildInputs = commonBuildInputs ++ [ flex bison autoconf automake gperf gnuplot texLive ]
|
2012-09-19 18:56:56 +01:00
|
|
|
++ lib.optionals (config.octave.atlas or true) [ python atlas ];
|
2008-12-02 22:55:45 +00:00
|
|
|
# it does build, but documentation doesn't.. So just remove that directory
|
|
|
|
# from the buildfile
|
|
|
|
buildPhase = ''
|
|
|
|
sed -i octMakefile \
|
|
|
|
-e 's/^\(INSTALL_SUBDIRS = .*\)doc \(.*\)$/\1 \2/' \
|
|
|
|
-e 's/^\(SUBDIRS = .*\)doc \(.*\)$/\1 \2/' \
|
|
|
|
-e 's/\$(MAKE) -C doc/#/'
|
|
|
|
make
|
|
|
|
'';
|
|
|
|
} else {
|
2009-04-08 21:06:03 +01:00
|
|
|
name = "octave-3.1.55";
|
2008-12-02 22:55:45 +00:00
|
|
|
src = fetchurl {
|
2009-04-08 21:06:03 +01:00
|
|
|
url = ftp://ftp.octave.org/pub/octave/bleeding-edge/octave-3.1.55.tar.bz2;
|
|
|
|
sha256 = "1lm4v85kdic4n5yxwzrdb0v6dc6nw06ljgx1q8hfkmi146kpg7s6";
|
2008-12-02 22:55:45 +00:00
|
|
|
};
|
|
|
|
buildInputs = commonBuildInputs ++ [ flex bison autoconf automake python ]
|
2012-09-19 18:56:56 +01:00
|
|
|
++ lib.optionals (config.octave.atlas or true) [ python atlas ];
|
2008-12-02 22:55:45 +00:00
|
|
|
}
|
|
|
|
))
|