depot/third_party/nixpkgs/pkgs/development/libraries/nco/default.nix
Default email c7f94ff3ce Project import generated by Copybara.
GitOrigin-RevId: b85ed9dcbf187b909ef7964774f8847d554fab3b
2023-08-22 22:05:09 +02:00

62 lines
1.2 KiB
Nix

{ antlr2
, coreutils
, curl
, fetchFromGitHub
, flex
, gsl
, lib
, libtool
, netcdf
, netcdfcxx4
, stdenv
, udunits
, which
}:
stdenv.mkDerivation (finalAttrs: {
pname = "nco";
version = "5.1.7";
src = fetchFromGitHub {
owner = "nco";
repo = "nco";
rev = finalAttrs.version;
hash = "sha256-CdIZ0ql8QBM7UcEyTmt4P9gZyO8jrkLipAOsJUkpG8g=";
};
nativeBuildInputs = [
antlr2
flex
which
];
buildInputs = [
coreutils
curl
gsl
netcdf
netcdfcxx4
udunits
];
postPatch = ''
substituteInPlace src/nco/nco_fl_utl.c \
--replace "/bin/cp" "${coreutils}/bin/cp"
substituteInPlace src/nco/nco_fl_utl.c \
--replace "/bin/mv" "${coreutils}/bin/mv"
'';
makeFlags = lib.optionals stdenv.isDarwin [ "LIBTOOL=${libtool}/bin/libtool" ];
enableParallelBuilding = true;
meta = {
description = "NetCDF Operator toolkit";
homepage = "https://nco.sourceforge.net/";
license = lib.licenses.bsd3;
longDescription = "The NCO (netCDF Operator) toolkit manipulates and analyzes data stored in netCDF-accessible formats, including DAP, HDF4, and HDF5";
maintainers = with lib.maintainers; [ bzizou ];
platforms = lib.platforms.unix;
};
})