about summary refs log tree commit diff
path: root/pkgs/development/libraries/json-fortran
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2023-03-17 12:01:17 +0000
committerGitHub <noreply@github.com>2023-03-17 12:01:17 +0000
commit23949862041c26b37f9927920ce43e20739b716f (patch)
tree219c7adbba001e5e933abc7956639f6211ad8c8d /pkgs/development/libraries/json-fortran
parentf5629a45189a88cd0c362b5c694f74d5c700967d (diff)
parent9b0777ffb3ab046e329af80a177d663387bf8f0f (diff)
downloadnixlib-23949862041c26b37f9927920ce43e20739b716f.tar
nixlib-23949862041c26b37f9927920ce43e20739b716f.tar.gz
nixlib-23949862041c26b37f9927920ce43e20739b716f.tar.bz2
nixlib-23949862041c26b37f9927920ce43e20739b716f.tar.lz
nixlib-23949862041c26b37f9927920ce43e20739b716f.tar.xz
nixlib-23949862041c26b37f9927920ce43e20739b716f.tar.zst
nixlib-23949862041c26b37f9927920ce43e20739b716f.zip
Merge master into staging-next
Diffstat (limited to 'pkgs/development/libraries/json-fortran')
-rw-r--r--pkgs/development/libraries/json-fortran/default.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/pkgs/development/libraries/json-fortran/default.nix b/pkgs/development/libraries/json-fortran/default.nix
new file mode 100644
index 000000000000..422248520fc4
--- /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 ];
+  };
+}