From da4d161cf9641170e46dba2df49c80d0f0b348e0 Mon Sep 17 00:00:00 2001 From: Phillip Seeber Date: Wed, 15 Mar 2023 10:42:08 +0100 Subject: [PATCH] json-fortran: init at 8.3.0 --- .../libraries/json-fortran/default.nix | 37 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 39 insertions(+) create mode 100644 pkgs/development/libraries/json-fortran/default.nix diff --git a/pkgs/development/libraries/json-fortran/default.nix b/pkgs/development/libraries/json-fortran/default.nix new file mode 100644 index 00000000000..422248520fc --- /dev/null +++ b/pkgs/development/libraries/json-fortran/default.nix @@ -0,0 +1,37 @@ +{ stdenv, lib, fetchFromGitHub, gfortran, cmake }: + +stdenv.mkDerivation rec { + pname = "json-fortran"; + version = "8.3.0"; + + src = fetchFromGitHub { + owner = "jacobwilliams"; + repo = pname; + rev = version; + hash = "sha256-96W9bzWEZ3EN4wtnDT3G3pvLdcI4SIhGJWBVPU3rNZ4="; + }; + + 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 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6b3b9f9e41e..b6872bd27df 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20827,6 +20827,8 @@ with pkgs; jsoncpp = callPackage ../development/libraries/jsoncpp { }; + json-fortran = callPackage ../development/libraries/json-fortran { }; + jsonnet = callPackage ../development/compilers/jsonnet { }; jsonnet-bundler = callPackage ../development/tools/jsonnet-bundler { };