2023-03-24 00:07:29 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, gfortran, cmake }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "json-fortran";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "9.0.2";
|
2023-03-24 00:07:29 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jacobwilliams";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-mAdagehmj1s6nTDaJqwaYrirfkyIwiTWYge0ZWQBc6g=";
|
2023-03-24 00:07:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
gfortran
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DUSE_GNU_INSTALL_CONVENTION=ON"
|
|
|
|
];
|
|
|
|
|
|
|
|
# Due to some misconfiguration in CMake the Fortran modules end up in $out/$out.
|
|
|
|
# Move them back to the desired location.
|
|
|
|
postInstall = ''
|
|
|
|
mv $out/$out/include $out/.
|
|
|
|
rm -r $out/nix
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Modern Fortran JSON API";
|
|
|
|
homepage = "https://github.com/jacobwilliams/json-fortran";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.sheepforce ];
|
|
|
|
};
|
|
|
|
}
|