nixpkgs/pkgs/by-name/ne/netcdfcxx4/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

40 lines
994 B
Nix

{ lib, stdenv, fetchFromGitHub, netcdf, hdf5, curl, cmake, ninja }:
stdenv.mkDerivation rec {
pname = "netcdf-cxx4";
version = "4.3.1";
src = fetchFromGitHub {
owner = "Unidata";
repo = "netcdf-cxx4";
rev = "v${version}";
sha256 = "sha256-GZ6n7dW3l8Kqrk2Xp2mxRTUWWQj0XEd2LDTG9EtrfhY=";
};
patches = [
# This fix is included upstream, remove with next upgrade
./cmake-h5free.patch
];
preConfigure = ''
cmakeFlags+="-Dabs_top_srcdir=$(readlink -f ./)"
'';
nativeBuildInputs = [ cmake ninja ];
buildInputs = [ netcdf hdf5 curl ];
doCheck = true;
enableParallelChecking = false;
preCheck = ''
export HDF5_PLUGIN_PATH=${netcdf}/lib/hdf5-plugins
'';
meta = {
description = "C++ API to manipulate netcdf files";
mainProgram = "ncxx4-config";
homepage = "https://www.unidata.ucar.edu/software/netcdf/";
license = lib.licenses.free;
platforms = lib.platforms.unix;
broken = stdenv.hostPlatform.isDarwin;
};
}