27 # eccodes is broken on darwin
28 enableGRIB ? stdenv.hostPlatform.isLinux,
30 enableGLPK ? stdenv.hostPlatform.isLinux,
32 # We enable it in hdf4 and use libtirpc as a dependency here from the passthru
34 enableLibtirpc ? stdenv.hostPlatform.isLinux,
37 enableMPI ? (stdenv.hostPlatform.isLinux || stdenv.hostPlatform.isDarwin),
38 # Choose MPICH over OpenMPI because it currently builds on AArch and Darwin
40 # Unfree optional dependency for hdf4 and hdf5
47 # HDF5 format version (API version) 1.10 and 1.12 is not fully compatible
48 # Specify if the API version should default to 1.10
49 # netcdf currently depends on hdf5 with `usev110Api=true`
50 # If you wish to use HDF5 API version 1.12 (`useHdf5v110Api=false`),
51 # you will need to turn NetCDF off.
52 useHdf5v110Api ? true,
59 # wxWidgets is preferred over X11 for this project but we only have it on Linux
61 enableWX ? (stdenv.hostPlatform.isLinux || stdenv.hostPlatform.isDarwin),
64 # X11: OFF by default for platform consistency. Use X where WX is not available
65 enableXWin ? (!stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isDarwin),
70 if hdf4-forced != null then
74 uselibtirpc = enableLibtirpc;
75 szipSupport = enableSzip;
79 if hdf5-forced != null then
84 usev110Api = useHdf5v110Api;
85 mpiSupport = enableMPI;
87 szipSupport = enableSzip;
90 // lib.optionalAttrs enableMPI {
95 if netcdf-forced != null then
101 enablePlplotDrivers = enableWX || enableXWin;
102 plplot-with-drivers =
103 if plplot-forced != null then
113 stdenv.mkDerivation rec {
114 pname = "gnudatalanguage";
117 src = fetchFromGitHub {
121 sha256 = "sha256-IrCLL8MQp0SkWj7sbfZlma5FrnMbgdl4E/1nPGy0Y60=";
151 ++ lib.optional enableXWin plplot-with-drivers.libX11
152 ++ lib.optional enableGRIB eccodes
153 ++ lib.optional enableGLPK glpk
154 ++ lib.optional enableWX wxGTK32
155 ++ lib.optional (enableWX && stdenv.hostPlatform.isDarwin) Cocoa
156 ++ lib.optional enableMPI mpi
157 ++ lib.optional enableLibtirpc hdf4-custom.libtirpc
158 ++ lib.optional enableSzip szip;
160 propagatedBuildInputs = [
161 (python3.withPackages (ps: with ps; [ numpy ]))
164 nativeBuildInputs = [
166 ] ++ lib.optional enableWX wrapGAppsHook3;
169 lib.optional (!enableHDF4) "-DHDF=OFF"
170 ++ [ (if enableHDF5 then "-DHDF5DIR=${hdf5-custom}" else "-DHDF5=OFF") ]
171 ++ lib.optional (!enableNetCDF) "-DNETCDF=OFF"
172 ++ lib.optional (!enablePlplotDrivers) "-DINTERACTIVE_GRAPHICS=OFF"
173 ++ lib.optional (!enableGRIB) "-DGRIB=OFF"
174 ++ lib.optional (!enableGLPK) "-DGLPK=OFF"
175 ++ lib.optional (!enableWX) "-DWXWIDGETS=OFF"
176 ++ lib.optional enableSzip "-DSZIPDIR=${szip}"
177 ++ lib.optionals enableXWin [
179 "-DX11DIR=${plplot-with-drivers.libX11}"
181 ++ lib.optionals enableMPI [
186 # Tests are failing on Hydra:
187 # ./src/common/dpycmn.cpp(137): assert ""IsOk()"" failed in GetClientArea(): invalid wxDisplay object
188 doCheck = stdenv.hostPlatform.isLinux;
190 # Opt-out unstable tests
191 # https://github.com/gnudatalanguage/gdl/issues/482
192 # https://github.com/gnudatalanguage/gdl/issues/1079
193 # https://github.com/gnudatalanguage/gdl/issues/460
195 checkFlagsArray+=("ARGS=-E '${
196 lib.concatMapStringsSep "|" (test: test + ".pro") [
197 "test_byte_conversion"
209 netcdf = netcdf-custom;
210 plplot = plplot-with-drivers;
223 description = "Free incremental compiler of IDL";
225 GDL (GNU Data Language) is a free/libre/open source incremental compiler
226 compatible with IDL (Interactive Data Language) and to some extent with PV-WAVE.
227 GDL is aimed as a drop-in replacement for IDL.
229 homepage = "https://github.com/gnudatalanguage/gdl";
230 license = licenses.gpl2Only;
231 maintainers = with maintainers; [ ShamrockLee ];
232 platforms = platforms.all;