about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/science/chemistry/simple-dftd3/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/science/chemistry/simple-dftd3/default.nix')
-rw-r--r--nixpkgs/pkgs/development/libraries/science/chemistry/simple-dftd3/default.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/science/chemistry/simple-dftd3/default.nix b/nixpkgs/pkgs/development/libraries/science/chemistry/simple-dftd3/default.nix
new file mode 100644
index 000000000000..57139f8bcd00
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/chemistry/simple-dftd3/default.nix
@@ -0,0 +1,46 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, gfortran
+, cmake
+, mctc-lib
+, mstore
+, toml-f
+, blas
+}:
+
+assert !blas.isILP64;
+
+stdenv.mkDerivation rec {
+  pname = "simple-dftd3";
+  version = "0.7.0";
+
+  src = fetchFromGitHub {
+    owner = "dftd3";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-5OvmMgjD8ujjKHkuw4NT8hEXKh5YPxuBl/Mu6g2/KIA=";
+  };
+
+  nativeBuildInputs = [ cmake gfortran ];
+
+  buildInputs = [ mctc-lib mstore toml-f blas ];
+
+  postInstall = ''
+    substituteInPlace $out/lib/pkgconfig/s-dftd3.pc \
+      --replace "''${prefix}/" ""
+  '';
+
+  doCheck = true;
+  preCheck = ''
+    export OMP_NUM_THREADS=2
+  '';
+
+  meta = with lib; {
+    description = "Reimplementation of the DFT-D3 program";
+    license = with licenses; [ lgpl3Only gpl3Only ];
+    homepage = "https://github.com/dftd3/simple-dftd3";
+    platforms = [ "x86_64-linux" ];
+    maintainers = [ maintainers.sheepforce ];
+  };
+}