mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-22 05:19:00 +02:00
Merge pull request #79864 from doronbehar/improve-octave
octave: Use qt5 and other improvements
This commit is contained in:
commit
b41a7eeb18
|
@ -1,8 +1,54 @@
|
||||||
{ stdenv, fetchurl, gfortran, readline, ncurses, perl, flex, texinfo, qhull
|
{ stdenv
|
||||||
, libsndfile, portaudio, libX11, graphicsmagick, pcre, pkgconfig, libGL, libGLU, fltk
|
, fetchurl
|
||||||
, fftw, fftwSinglePrec, zlib, curl, qrupdate, openblas, arpack, libwebp, gl2ps
|
, gfortran
|
||||||
, qt ? null, qscintilla ? null, ghostscript ? null, llvm ? null, hdf5 ? null,glpk ? null
|
, ncurses
|
||||||
, suitesparse ? null, gnuplot ? null, jdk ? null, python ? null, overridePlatforms ? null
|
, perl
|
||||||
|
, flex
|
||||||
|
, texinfo
|
||||||
|
, qhull
|
||||||
|
, libsndfile
|
||||||
|
, portaudio
|
||||||
|
, libX11
|
||||||
|
, graphicsmagick
|
||||||
|
, pcre
|
||||||
|
, pkgconfig
|
||||||
|
, libGL
|
||||||
|
, libGLU
|
||||||
|
, fltk
|
||||||
|
# Both are needed for discrete Fourier transform
|
||||||
|
, fftw
|
||||||
|
, fftwSinglePrec
|
||||||
|
, zlib
|
||||||
|
, curl
|
||||||
|
, qrupdate
|
||||||
|
, openblas
|
||||||
|
, arpack
|
||||||
|
, libwebp
|
||||||
|
, gl2ps
|
||||||
|
, ghostscript ? null
|
||||||
|
, hdf5 ? null
|
||||||
|
, glpk ? null
|
||||||
|
, suitesparse ? null
|
||||||
|
, gnuplot ? null
|
||||||
|
# - Include support for GNU readline:
|
||||||
|
, enableReadline ? true
|
||||||
|
, readline ? null
|
||||||
|
# - Build Java interface:
|
||||||
|
, enableJava ? true
|
||||||
|
, jdk ? null
|
||||||
|
, python ? null
|
||||||
|
, overridePlatforms ? null
|
||||||
|
, sundials_2 ? null
|
||||||
|
# - Build Octave Qt GUI:
|
||||||
|
, enableQt ? false
|
||||||
|
, qtbase ? null
|
||||||
|
, qtsvg ? null
|
||||||
|
, qtscript ? null
|
||||||
|
, qscintilla ? null
|
||||||
|
, qttools ? null
|
||||||
|
# - JIT compiler for loops:
|
||||||
|
, enableJIT ? false
|
||||||
|
, llvm ? null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
@ -20,33 +66,63 @@ in
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = "5.2.0";
|
version = "5.2.0";
|
||||||
pname = "octave";
|
pname = "octave";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "mirror://gnu/octave/${pname}-${version}.tar.gz";
|
url = "mirror://gnu/octave/${pname}-${version}.tar.gz";
|
||||||
sha256 = "1qcmcpsq1lfka19fxzvxjwjhg113c39a9a0x8plkhvwdqyrn5sig";
|
sha256 = "1qcmcpsq1lfka19fxzvxjwjhg113c39a9a0x8plkhvwdqyrn5sig";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ gfortran readline ncurses perl flex texinfo qhull
|
buildInputs = [
|
||||||
graphicsmagick pcre pkgconfig fltk zlib curl openblas libsndfile fftw
|
readline
|
||||||
fftwSinglePrec portaudio qrupdate arpack libwebp gl2ps ]
|
ncurses
|
||||||
++ (stdenv.lib.optional (qt != null) qt)
|
perl
|
||||||
++ (stdenv.lib.optional (qscintilla != null) qscintilla)
|
flex
|
||||||
++ (stdenv.lib.optional (ghostscript != null) ghostscript)
|
qhull
|
||||||
++ (stdenv.lib.optional (llvm != null) llvm)
|
graphicsmagick
|
||||||
++ (stdenv.lib.optional (hdf5 != null) hdf5)
|
pcre
|
||||||
++ (stdenv.lib.optional (glpk != null) glpk)
|
fltk
|
||||||
++ (stdenv.lib.optional (suitesparse != null) suitesparse)
|
zlib
|
||||||
++ (stdenv.lib.optional (jdk != null) jdk)
|
curl
|
||||||
++ (stdenv.lib.optional (gnuplot != null) gnuplot)
|
openblas
|
||||||
++ (stdenv.lib.optional (python != null) python)
|
libsndfile
|
||||||
++ (stdenv.lib.optionals (!stdenv.isDarwin) [ libGL libGLU libX11 ])
|
fftw
|
||||||
;
|
fftwSinglePrec
|
||||||
|
portaudio
|
||||||
# makeinfo is required by Octave at runtime to display help
|
qrupdate
|
||||||
prePatch = ''
|
arpack
|
||||||
substituteInPlace libinterp/corefcn/help.cc \
|
libwebp
|
||||||
--replace 'Vmakeinfo_program = "makeinfo"' \
|
gl2ps
|
||||||
'Vmakeinfo_program = "${texinfo}/bin/makeinfo"'
|
]
|
||||||
'';
|
++ (stdenv.lib.optionals enableQt [
|
||||||
|
qtbase
|
||||||
|
qtsvg
|
||||||
|
qscintilla
|
||||||
|
])
|
||||||
|
++ (stdenv.lib.optional (ghostscript != null) ghostscript)
|
||||||
|
++ (stdenv.lib.optional (hdf5 != null) hdf5)
|
||||||
|
++ (stdenv.lib.optional (glpk != null) glpk)
|
||||||
|
++ (stdenv.lib.optional (suitesparse != null) suitesparse)
|
||||||
|
++ (stdenv.lib.optional (enableJava) jdk)
|
||||||
|
++ (stdenv.lib.optional (sundials_2 != null) sundials_2)
|
||||||
|
++ (stdenv.lib.optional (gnuplot != null) gnuplot)
|
||||||
|
++ (stdenv.lib.optional (python != null) python)
|
||||||
|
++ (stdenv.lib.optionals (!stdenv.isDarwin) [ libGL libGLU libX11 ])
|
||||||
|
;
|
||||||
|
nativeBuildInputs = [
|
||||||
|
pkgconfig
|
||||||
|
gfortran
|
||||||
|
# Listed here as well because it's outputs are split
|
||||||
|
fftw
|
||||||
|
fftwSinglePrec
|
||||||
|
texinfo
|
||||||
|
]
|
||||||
|
++ (stdenv.lib.optional (sundials_2 != null) sundials_2)
|
||||||
|
++ (stdenv.lib.optional enableJIT llvm)
|
||||||
|
++ (stdenv.lib.optionals enableQt [
|
||||||
|
qtscript
|
||||||
|
qttools
|
||||||
|
])
|
||||||
|
;
|
||||||
|
|
||||||
doCheck = !stdenv.isDarwin;
|
doCheck = !stdenv.isDarwin;
|
||||||
|
|
||||||
|
@ -55,15 +131,16 @@ stdenv.mkDerivation rec {
|
||||||
# See https://savannah.gnu.org/bugs/?50339
|
# See https://savannah.gnu.org/bugs/?50339
|
||||||
F77_INTEGER_8_FLAG = if openblas.blas64 then "-fdefault-integer-8" else "";
|
F77_INTEGER_8_FLAG = if openblas.blas64 then "-fdefault-integer-8" else "";
|
||||||
|
|
||||||
configureFlags =
|
configureFlags = [
|
||||||
[ "--enable-readline"
|
"--with-blas=openblas"
|
||||||
"--enable-dl"
|
"--with-lapack=openblas"
|
||||||
"--with-blas=openblas"
|
]
|
||||||
"--with-lapack=openblas"
|
++ stdenv.lib.optionals enableReadline [ "--enable-readline" ]
|
||||||
]
|
++ stdenv.lib.optionals openblas.blas64 [ "--enable-64" ]
|
||||||
++ stdenv.lib.optional openblas.blas64 "--enable-64"
|
++ stdenv.lib.optionals stdenv.isDarwin [ "--with-x=no" ]
|
||||||
++ stdenv.lib.optionals stdenv.isDarwin ["--with-x=no"]
|
++ stdenv.lib.optionals enableQt [ "--with-qt=5" ]
|
||||||
;
|
++ stdenv.lib.optionals enableJIT [ "--enable-jit" ]
|
||||||
|
;
|
||||||
|
|
||||||
# Keep a copy of the octave tests detailed results in the output
|
# Keep a copy of the octave tests detailed results in the output
|
||||||
# derivation, because someone may care
|
# derivation, because someone may care
|
||||||
|
@ -81,6 +158,8 @@ stdenv.mkDerivation rec {
|
||||||
license = stdenv.lib.licenses.gpl3Plus;
|
license = stdenv.lib.licenses.gpl3Plus;
|
||||||
maintainers = with stdenv.lib.maintainers; [raskin];
|
maintainers = with stdenv.lib.maintainers; [raskin];
|
||||||
description = "Scientific Pragramming Language";
|
description = "Scientific Pragramming Language";
|
||||||
|
# https://savannah.gnu.org/bugs/?func=detailitem&item_id=56425 is the best attempt to fix JIT
|
||||||
|
broken = enableJIT;
|
||||||
platforms = if overridePlatforms == null then
|
platforms = if overridePlatforms == null then
|
||||||
(with stdenv.lib.platforms; linux ++ darwin)
|
(with stdenv.lib.platforms; linux ++ darwin)
|
||||||
else overridePlatforms;
|
else overridePlatforms;
|
||||||
|
|
61
pkgs/development/libraries/sundials/2.x.nix
Normal file
61
pkgs/development/libraries/sundials/2.x.nix
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
{ stdenv
|
||||||
|
, cmake
|
||||||
|
, fetchurl
|
||||||
|
, python
|
||||||
|
# GNU Octave needs KLU for ODE solvers
|
||||||
|
, suitesparse
|
||||||
|
, liblapack
|
||||||
|
, gfortran
|
||||||
|
, lapackSupport ? true }:
|
||||||
|
|
||||||
|
let liblapackShared = liblapack.override {
|
||||||
|
shared = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
in stdenv.mkDerivation rec {
|
||||||
|
pname = "sundials";
|
||||||
|
version = "2.7.0";
|
||||||
|
|
||||||
|
buildInputs = [ python ] ++ stdenv.lib.optionals (lapackSupport) [
|
||||||
|
gfortran
|
||||||
|
suitesparse
|
||||||
|
];
|
||||||
|
nativeBuildInputs = [ cmake ];
|
||||||
|
|
||||||
|
src = fetchurl {
|
||||||
|
url = "https://computation.llnl.gov/projects/${pname}/download/${pname}-${version}.tar.gz";
|
||||||
|
sha256 = "01513g0j7nr3rh7hqjld6mw0mcx5j9z9y87bwjc16w2x2z3wm7yk";
|
||||||
|
};
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
(fetchurl {
|
||||||
|
# https://github.com/LLNL/sundials/pull/19
|
||||||
|
url = "https://github.com/LLNL/sundials/commit/1350421eab6c5ab479de5eccf6af2dcad1eddf30.patch";
|
||||||
|
sha256 = "0g67lixp9m85fqpb9rzz1hl1z8ibdg0ldwq5z6flj5zl8a7cw52l";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
cmakeFlags = [
|
||||||
|
"-DEXAMPLES_INSTALL_PATH=${placeholder "out"}/share/examples"
|
||||||
|
] ++ stdenv.lib.optionals (lapackSupport) [
|
||||||
|
"-DSUNDIALS_INDEX_TYPE=int32_t"
|
||||||
|
# GNU Octave needs KLU for ODE solvers
|
||||||
|
"-DKLU_ENABLE=ON"
|
||||||
|
"-DKLU_INCLUDE_DIR=${suitesparse}/include"
|
||||||
|
"-DKLU_LIBRARY_DIR=${suitesparse}/lib"
|
||||||
|
"-DLAPACK_ENABLE=ON"
|
||||||
|
"-DLAPACK_LIBRARIES=${liblapackShared}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary};${liblapackShared}/lib/libblas${stdenv.hostPlatform.extensions.sharedLibrary}"
|
||||||
|
];
|
||||||
|
|
||||||
|
# flaky tests, and patch in https://github.com/LLNL/sundials/pull/21 doesn't apply cleanly for sundials_3
|
||||||
|
doCheck = false;
|
||||||
|
checkPhase = "make test";
|
||||||
|
|
||||||
|
meta = with stdenv.lib; {
|
||||||
|
description = "Suite of nonlinear differential/algebraic equation solvers";
|
||||||
|
homepage = https://computation.llnl.gov/projects/sundials;
|
||||||
|
platforms = platforms.all;
|
||||||
|
maintainers = with maintainers; [ flokli idontgetoutmuch ];
|
||||||
|
license = licenses.bsd3;
|
||||||
|
};
|
||||||
|
}
|
|
@ -9247,23 +9247,19 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
octave = callPackage ../development/interpreters/octave {
|
octave = callPackage ../development/interpreters/octave {
|
||||||
qt = null;
|
python = python3;
|
||||||
qscintilla = null;
|
|
||||||
ghostscript = null;
|
|
||||||
graphicsmagick = null;
|
|
||||||
llvm = null;
|
|
||||||
hdf5 = null;
|
|
||||||
glpk = null;
|
|
||||||
suitesparse = null;
|
|
||||||
jdk = null;
|
|
||||||
openblas = if stdenv.isDarwin then openblasCompat else openblas;
|
openblas = if stdenv.isDarwin then openblasCompat else openblas;
|
||||||
};
|
};
|
||||||
|
octave-jit = callPackage ../development/interpreters/octave {
|
||||||
octaveFull = (lowPrio (octave.override {
|
python = python3;
|
||||||
qt = qt4;
|
|
||||||
inherit qscintilla;
|
|
||||||
overridePlatforms = ["x86_64-linux" "x86_64-darwin"];
|
|
||||||
openblas = if stdenv.isDarwin then openblasCompat else openblas;
|
openblas = if stdenv.isDarwin then openblasCompat else openblas;
|
||||||
|
enableJIT = true;
|
||||||
|
};
|
||||||
|
octaveFull = (lowPrio (libsForQt512.callPackage ../development/interpreters/octave {
|
||||||
|
python = python3;
|
||||||
|
openblas = if stdenv.isDarwin then openblasCompat else openblas;
|
||||||
|
enableQt = true;
|
||||||
|
overridePlatforms = ["x86_64-linux" "x86_64-darwin"];
|
||||||
}));
|
}));
|
||||||
|
|
||||||
ocropus = callPackage ../applications/misc/ocropus { };
|
ocropus = callPackage ../applications/misc/ocropus { };
|
||||||
|
@ -14432,7 +14428,13 @@ in
|
||||||
withQt5 = false;
|
withQt5 = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
sundials = callPackage ../development/libraries/sundials { };
|
sundials = callPackage ../development/libraries/sundials {
|
||||||
|
python = python3;
|
||||||
|
};
|
||||||
|
|
||||||
|
sundials_2 = callPackage ../development/libraries/sundials/2.x.nix {
|
||||||
|
python = python3;
|
||||||
|
};
|
||||||
|
|
||||||
sutils = callPackage ../tools/misc/sutils { };
|
sutils = callPackage ../tools/misc/sutils { };
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue