Merge pull request #83185 from idontgetoutmuch/octave-for-macos

Build octave on macos
This commit is contained in:
Michael Raskin 2020-03-23 08:17:27 +00:00 committed by GitHub
commit db4ccddb35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -49,6 +49,8 @@
# - JIT compiler for loops: # - JIT compiler for loops:
, enableJIT ? false , enableJIT ? false
, llvm ? null , llvm ? null
, libiconv
, darwin
}: }:
let let
@ -107,6 +109,9 @@ stdenv.mkDerivation rec {
++ (stdenv.lib.optional (gnuplot != null) gnuplot) ++ (stdenv.lib.optional (gnuplot != null) gnuplot)
++ (stdenv.lib.optional (python != null) python) ++ (stdenv.lib.optional (python != null) python)
++ (stdenv.lib.optionals (!stdenv.isDarwin) [ libGL libGLU libX11 ]) ++ (stdenv.lib.optionals (!stdenv.isDarwin) [ libGL libGLU libX11 ])
++ (stdenv.lib.optionals (stdenv.isDarwin) [ libiconv
darwin.apple_sdk.frameworks.Accelerate
darwin.apple_sdk.frameworks.Cocoa ])
; ;
nativeBuildInputs = [ nativeBuildInputs = [
pkgconfig pkgconfig
@ -135,6 +140,7 @@ stdenv.mkDerivation rec {
"--with-blas=openblas" "--with-blas=openblas"
"--with-lapack=openblas" "--with-lapack=openblas"
] ]
++ (if stdenv.isDarwin then [ "--enable-link-all-dependencies" ] else [ ])
++ stdenv.lib.optionals enableReadline [ "--enable-readline" ] ++ stdenv.lib.optionals enableReadline [ "--enable-readline" ]
++ stdenv.lib.optionals openblas.blas64 [ "--enable-64" ] ++ stdenv.lib.optionals openblas.blas64 [ "--enable-64" ]
++ stdenv.lib.optionals stdenv.isDarwin [ "--with-x=no" ] ++ stdenv.lib.optionals stdenv.isDarwin [ "--with-x=no" ]
@ -161,7 +167,7 @@ stdenv.mkDerivation rec {
# https://savannah.gnu.org/bugs/?func=detailitem&item_id=56425 is the best attempt to fix JIT # https://savannah.gnu.org/bugs/?func=detailitem&item_id=56425 is the best attempt to fix JIT
broken = enableJIT; broken = enableJIT;
platforms = if overridePlatforms == null then platforms = if overridePlatforms == null then
(with stdenv.lib.platforms; linux ++ darwin) (with stdenv.lib; platforms.linux ++ platforms.darwin)
else overridePlatforms; else overridePlatforms;
}; };
} }