about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libxc
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libxc')
-rw-r--r--nixpkgs/pkgs/development/libraries/libxc/default.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libxc/default.nix b/nixpkgs/pkgs/development/libraries/libxc/default.nix
new file mode 100644
index 000000000000..b46bc9626302
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libxc/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchFromGitLab, cmake, gfortran, perl }:
+
+stdenv.mkDerivation rec {
+  pname = "libxc";
+  version = "5.1.6";
+
+  src = fetchFromGitLab {
+    owner = "libxc";
+    repo = "libxc";
+    rev = version;
+    sha256 = "07iljmv737kx24kd33x9ndf5l854mwslg9x2psqm12k07jmq9wjw";
+  };
+
+  buildInputs = [ gfortran ];
+  nativeBuildInputs = [ perl cmake ];
+
+  preConfigure = ''
+    patchShebangs ./
+  '';
+
+  cmakeFlags = [ "-DENABLE_FORTRAN=ON" "-DBUILD_SHARED_LIBS=ON" ];
+
+  preCheck = ''
+    export LD_LIBRARY_PATH=$(pwd)
+  '';
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Library of exchange-correlation functionals for density-functional theory";
+    homepage = "https://www.tddft.org/programs/Libxc/";
+    license = licenses.mpl20;
+    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ markuskowa ];
+  };
+}