gnudatalanguage: Init at 1.0.0

*   Generate PlPlot drivers by
    injecting wxGtk31 (if enableWX == true)
    and/or xorg.libX11 (if enableXWin == true,
    default to false)
    into the buildInputs of plplot
    with plplot.overrideAttrs
*   Override hdf4 and hdf5 with
    custom mpi (if
    enableMPI == true and libraryMPI == mpich)
    and szip (if enableSzip == true, default to false)
This commit is contained in:
Shamrock Lee 2020-09-25 03:10:22 +00:00
parent 3c024373c1
commit d80b0c0171
3 changed files with 211 additions and 5 deletions

View File

@ -0,0 +1,203 @@
{ stdenv
, lib
, fetchFromGitHub
, cmake
, wrapGAppsHook
, readline
, ncurses
, zlib
, gsl
, openmp
, graphicsmagick
, fftw
, fftwFloat
, fftwLongDouble
, proj
, shapelib
, expat
, udunits
, eigen
, pslib
, eccodes
, glpk
, libpng
, plplot
, libtiff
, libgeotiff
, libjpeg
# We enable it in hdf4 and use libtirpc as a dependency here from the passthru
# of hdf4
, enableLibtirpc ? stdenv.isLinux
, libtirpc
, python3
, enableMPI ? (stdenv.isLinux || stdenv.isDarwin)
# Choose MPICH over OpenMPI because it currently builds on AArch and Darwin
, mpi
# Unfree optional dependency for hdf4 and hdf5
, enableSzip ? false
, szip
, enableHDF4 ? true
, hdf4
, hdf4-forced ? null
, enableHDF5 ? true
# HDF5 format version (API version) 1.10 and 1.12 is not fully compatible
# Specify if the API version should default to 1.10
# netcdf currently depends on hdf5 with `usev110Api=true`
# If you wish to use HDF5 API version 1.12 (`useHdf5v110Api=false`),
# you will need to turn NetCDF off.
, useHdf5v110Api ? true
, hdf5
, hdf5-forced ? null
, enableNetCDF ? true
, netcdf
, 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.
, enableWX ? (stdenv.isLinux || stdenv.isDarwin)
# X11: OFF by default for platform consistency. Use X where WX is not available
, enableXWin ? (!stdenv.isLinux && !stdenv.isDarwin)
}:
let
hdf4-custom =
if hdf4-forced != null
then hdf4-forced
else
hdf4.override {
uselibtirpc = enableLibtirpc;
szipSupport = enableSzip;
inherit szip;
};
hdf5-custom =
if hdf5-forced != null
then hdf5-forced
else
hdf5.override {
usev110Api = useHdf5v110Api;
mpiSupport = enableMPI;
inherit mpi;
szipSupport = enableSzip;
inherit szip;
};
netcdf-custom =
if netcdf-forced != null
then netcdf-forced
else
netcdf.override {
hdf5 = hdf5-custom;
};
enablePlplotDrivers = enableWX || enableXWin;
plplot-with-drivers =
if plplot-forced != null
then plplot-forced
else
plplot.override {
inherit
enableWX
enableXWin
;
};
in
stdenv.mkDerivation rec {
pname = "gnudatalanguage";
version = "1.0.0";
src = fetchFromGitHub {
owner = pname;
repo = "gdl";
rev = "v${version}";
sha256 = "sha256-Y9LVRaWjQqpWqjNngxB406PE/rl/9S8rs0u0CK5ivUA=";
};
buildInputs = [
readline
ncurses
zlib
gsl
openmp
graphicsmagick
fftw
fftwFloat
fftwLongDouble
proj
shapelib
expat
mpi
udunits
eigen
pslib
eccodes
glpk
libpng
libtiff
libgeotiff
libjpeg
hdf4-custom
hdf5-custom
netcdf-custom
plplot-with-drivers
] ++ lib.optional enableXWin plplot-with-drivers.libX11
++ lib.optional enableWX plplot-with-drivers.wxWidgets
++ lib.optional enableMPI mpi
++ lib.optional enableLibtirpc hdf4-custom.libtirpc
++ lib.optional enableSzip szip;
propagatedBuildInputs = [
(python3.withPackages (ps: with ps; [ numpy ]))
];
nativeBuildInputs = [
cmake
] ++ lib.optional enableWX wrapGAppsHook;
cmakeFlags = lib.optional (!enableHDF4) "-DHDF=OFF"
++ [ (if enableHDF5 then "-DHDF5DIR=${hdf5-custom}" else "-DHDF5=OFF") ]
++ lib.optional (!enableNetCDF) "-DNETCDF=OFF"
++ lib.optional (!enablePlplotDrivers) "-DINTERACTIVE_GRAPHICS=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;
# 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'")
'';
passthru = {
hdf4 = hdf4-custom;
hdf5 = hdf5-custom;
netcdf = netcdf-custom;
plplot = plplot-with-drivers;
python = python3;
inherit
enableMPI
mpi
useHdf5v110Api
enableSzip
enableWX
enableXWin
;
};
meta = with lib; {
description = "Free incremental compiler of IDL";
longDescription = ''
GDL (GNU Data Language) is a free/libre/open source incremental compiler
compatible with IDL (Interactive Data Language) and to some extent with PV-WAVE.
GDL is aimed as a drop-in replacement for IDL.
'';
homepage = "https://github.com/gnudatalanguage/gdl";
license = licenses.gpl2Only;
maintainers = with maintainers; [ ShamrockLee ];
platforms = platforms.all;
mainProgram = "gdl";
};
}

View File

@ -21,11 +21,8 @@ in stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake ];
buildInputs = [
]
++ lib.optional enableWX wxWidgets
++ lib.optional enableXWin libX11
;
buildInputs = lib.optional enableWX wxWidgets
++ lib.optional enableXWin libX11;
passthru = {
inherit

View File

@ -12858,6 +12858,12 @@ with pkgs;
inherit (beam.packages.erlangR21) lfe lfe_1_3;
gnudatalanguage = callPackage ../development/interpreters/gnudatalanguage {
inherit (llvmPackages) openmp;
# MPICH currently build on Darwin
mpi = mpich;
};
groovy = callPackage ../development/interpreters/groovy { };
inherit (callPackages ../applications/networking/cluster/hadoop {