26 # eccodes is broken on darwin
27 , enableGRIB ? stdenv.isLinux
29 , enableGLPK ? stdenv.isLinux
31 # We enable it in hdf4 and use libtirpc as a dependency here from the passthru
33 , enableLibtirpc ? stdenv.isLinux
36 , enableMPI ? (stdenv.isLinux || stdenv.isDarwin)
37 # Choose MPICH over OpenMPI because it currently builds on AArch and Darwin
39 # Unfree optional dependency for hdf4 and hdf5
46 # HDF5 format version (API version) 1.10 and 1.12 is not fully compatible
47 # Specify if the API version should default to 1.10
48 # netcdf currently depends on hdf5 with `usev110Api=true`
49 # If you wish to use HDF5 API version 1.12 (`useHdf5v110Api=false`),
50 # you will need to turn NetCDF off.
51 , useHdf5v110Api ? true
56 , netcdf-forced ? null
57 , plplot-forced ? null
58 # wxWidgets is preferred over X11 for this project but we only have it on Linux
60 , enableWX ? (stdenv.isLinux || stdenv.isDarwin)
63 # X11: OFF by default for platform consistency. Use X where WX is not available
64 , enableXWin ? (!stdenv.isLinux && !stdenv.isDarwin)
69 if hdf4-forced != null
73 uselibtirpc = enableLibtirpc;
74 szipSupport = enableSzip;
78 if hdf5-forced != null
82 usev110Api = useHdf5v110Api;
83 mpiSupport = enableMPI;
85 szipSupport = enableSzip;
89 if netcdf-forced != null
95 enablePlplotDrivers = enableWX || enableXWin;
97 if plplot-forced != null
107 stdenv.mkDerivation rec {
108 pname = "gnudatalanguage";
111 src = fetchFromGitHub {
115 sha256 = "sha256-IrCLL8MQp0SkWj7sbfZlma5FrnMbgdl4E/1nPGy0Y60=";
143 ] ++ lib.optional enableXWin plplot-with-drivers.libX11
144 ++ lib.optional enableGRIB eccodes
145 ++ lib.optional enableGLPK glpk
146 ++ lib.optional enableWX wxGTK32
147 ++ lib.optional (enableWX && stdenv.isDarwin) Cocoa
148 ++ lib.optional enableMPI mpi
149 ++ lib.optional enableLibtirpc hdf4-custom.libtirpc
150 ++ lib.optional enableSzip szip;
152 propagatedBuildInputs = [
153 (python3.withPackages (ps: with ps; [ numpy ]))
156 nativeBuildInputs = [
158 ] ++ lib.optional enableWX wrapGAppsHook;
160 cmakeFlags = lib.optional (!enableHDF4) "-DHDF=OFF"
161 ++ [ (if enableHDF5 then "-DHDF5DIR=${hdf5-custom}" else "-DHDF5=OFF") ]
162 ++ lib.optional (!enableNetCDF) "-DNETCDF=OFF"
163 ++ lib.optional (!enablePlplotDrivers) "-DINTERACTIVE_GRAPHICS=OFF"
164 ++ lib.optional (!enableGRIB) "-DGRIB=OFF"
165 ++ lib.optional (!enableGLPK) "-DGLPK=OFF"
166 ++ lib.optional (!enableWX) "-DWXWIDGETS=OFF"
167 ++ lib.optional enableSzip "-DSZIPDIR=${szip}"
168 ++ lib.optionals enableXWin [ "-DX11=ON" "-DX11DIR=${plplot-with-drivers.libX11}" ]
169 ++ lib.optionals enableMPI [ "-DMPI=ON" "-DMPIDIR=${mpi}" ];
171 # Tests are failing on Hydra:
172 # ./src/common/dpycmn.cpp(137): assert ""IsOk()"" failed in GetClientArea(): invalid wxDisplay object
173 doCheck = stdenv.isLinux;
175 # Opt-out unstable tests
176 # https://github.com/gnudatalanguage/gdl/issues/482
177 # https://github.com/gnudatalanguage/gdl/issues/1079
178 # https://github.com/gnudatalanguage/gdl/issues/460
180 checkFlagsArray+=("ARGS=-E '${lib.concatMapStringsSep "|" (test: test + ".pro") [
181 "test_byte_conversion"
192 netcdf = netcdf-custom;
193 plplot = plplot-with-drivers;
206 description = "Free incremental compiler of IDL";
208 GDL (GNU Data Language) is a free/libre/open source incremental compiler
209 compatible with IDL (Interactive Data Language) and to some extent with PV-WAVE.
210 GDL is aimed as a drop-in replacement for IDL.
212 homepage = "https://github.com/gnudatalanguage/gdl";
213 license = licenses.gpl2Only;
214 maintainers = with maintainers; [ ShamrockLee ];
215 platforms = platforms.all;