Merge pull request #194964 from wegank/gnudatalangauge-darwin

This commit is contained in:
Sandro 2022-10-11 14:49:08 +02:00 committed by GitHub
commit 936a00284c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 15 deletions

View File

@ -18,13 +18,16 @@
, udunits
, eigen
, pslib
, eccodes
, glpk
, libpng
, plplot
, libtiff
, libgeotiff
, libjpeg
# eccodes is broken on darwin
, enableGRIB ? stdenv.isLinux
, eccodes
, enableGLPK ? stdenv.isLinux
, glpk
# We enable it in hdf4 and use libtirpc as a dependency here from the passthru
# of hdf4
, enableLibtirpc ? stdenv.isLinux
@ -53,9 +56,10 @@
, netcdf-forced ? null
, plplot-forced ? null
# wxWidgets is preferred over X11 for this project but we only have it on Linux
# and Darwin. Also, we use the wxWidgets dependency here from the passthru of
# plplot.
# and Darwin.
, enableWX ? (stdenv.isLinux || stdenv.isDarwin)
, wxGTK32
, Cocoa
# X11: OFF by default for platform consistency. Use X where WX is not available
, enableXWin ? (!stdenv.isLinux && !stdenv.isDarwin)
}:
@ -128,8 +132,6 @@ stdenv.mkDerivation rec {
udunits
eigen
pslib
eccodes
glpk
libpng
libtiff
libgeotiff
@ -139,7 +141,10 @@ stdenv.mkDerivation rec {
netcdf-custom
plplot-with-drivers
] ++ lib.optional enableXWin plplot-with-drivers.libX11
++ lib.optional enableWX plplot-with-drivers.wxWidgets
++ lib.optional enableGRIB eccodes
++ lib.optional enableGLPK glpk
++ lib.optional enableWX wxGTK32
++ lib.optional (enableWX && stdenv.isDarwin) Cocoa
++ lib.optional enableMPI mpi
++ lib.optional enableLibtirpc hdf4-custom.libtirpc
++ lib.optional enableSzip szip;
@ -156,19 +161,29 @@ stdenv.mkDerivation rec {
++ [ (if enableHDF5 then "-DHDF5DIR=${hdf5-custom}" else "-DHDF5=OFF") ]
++ lib.optional (!enableNetCDF) "-DNETCDF=OFF"
++ lib.optional (!enablePlplotDrivers) "-DINTERACTIVE_GRAPHICS=OFF"
++ lib.optional (!enableGRIB) "-DGRIB=OFF"
++ lib.optional (!enableGLPK) "-DGLPK=OFF"
++ lib.optional (!enableWX) "-DWXWIDGETS=OFF"
++ lib.optional enableSzip "-DSZIPDIR=${szip}"
++ lib.optionals enableXWin [ "-DX11=ON" "-DX11DIR=${plplot-with-drivers.libX11}" ]
++ lib.optionals enableMPI [ "-DMPI=ON" "-DMPIDIR=${mpi}" ];
doCheck = true;
# Tests are failing on Hydra:
# ./src/common/dpycmn.cpp(137): assert ""IsOk()"" failed in GetClientArea(): invalid wxDisplay object
doCheck = stdenv.isLinux;
# Opt-out unstable tests
# https://github.com/gnudatalanguage/gdl/issues/482
# https://github.com/gnudatalanguage/gdl/issues/1079
# https://github.com/gnudatalanguage/gdl/issues/460
preCheck = ''
checkFlagsArray+=("ARGS=-E 'test_tic_toc.pro|test_byte_conversion.pro|test_bytscl.pro|test_call_external.pro'")
checkFlagsArray+=("ARGS=-E '${lib.concatMapStringsSep "|" (test: test + ".pro") [
"test_byte_conversion"
"test_bytscl"
"test_call_external"
"test_tic_toc"
"test_timestamp"
]}'")
'';
passthru = {

View File

@ -3,14 +3,13 @@
, fetchurl
, cmake
, enableWX ? false
, wxGTK31, wxmac
, wxGTK32
, Cocoa
, enableXWin ? false
, libX11
}:
let
wxWidgets = (if stdenv.isDarwin then wxmac else wxGTK31);
in stdenv.mkDerivation rec {
stdenv.mkDerivation rec {
pname = "plplot";
version = "5.15.0";
@ -21,13 +20,13 @@ in stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake ];
buildInputs = lib.optional enableWX wxWidgets
buildInputs = lib.optional enableWX wxGTK32
++ lib.optional (enableWX && stdenv.isDarwin) Cocoa
++ lib.optional enableXWin libX11;
passthru = {
inherit
enableWX
wxWidgets
enableXWin
libX11
;

View File

@ -7502,6 +7502,7 @@ with pkgs;
plplot = callPackage ../development/libraries/plplot {
inherit (xorg) libX11;
inherit (darwin.apple_sdk.frameworks) Cocoa;
};
pxattr = callPackage ../tools/archivers/pxattr { };
@ -15323,6 +15324,7 @@ with pkgs;
gnudatalanguage = callPackage ../development/interpreters/gnudatalanguage {
inherit (llvmPackages) openmp;
inherit (darwin.apple_sdk.frameworks) Cocoa;
# MPICH currently build on Darwin
mpi = mpich;
};