Unverified Commit 1517ed31 authored by Markus Kowalewski's avatar Markus Kowalewski Committed by GitHub
Browse files

simple-dftd3 and dftd4 fixes and python bindings (#449145)

parents 9bfda15c 2eb657f1
Loading
Loading
Loading
Loading
+45 −0
Original line number Diff line number Diff line
{
  buildPythonPackage,
  meson-python,
  ninja,
  setuptools,
  pkg-config,
  dftd4,
  cffi,
  numpy,
}:

buildPythonPackage {
  inherit (dftd4)
    pname
    version
    src
    meta
    ;

  pyproject = true;

  buildInputs = [ dftd4 ];

  nativeBuildInputs = [
    pkg-config
    ninja
  ];

  build-system = [
    meson-python
    setuptools
  ];

  dependencies = [
    cffi
    numpy
  ];

  preConfigure = ''
    cd python
  '';

  pythonImportsCheck = [ "dftd4" ];
  doCheck = true;
}
+1 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ stdenv.mkDerivation rec {
  '';

  cmakeFlags = [
    "-DCMAKE_POLICY_VERSION_MINIMUM=3.5"
    "-DENABLE_FORTRAN=ON"
    "-DBUILD_SHARED_LIBS=ON"
    "-DENABLE_XHOST=OFF"
+4 −1
Original line number Diff line number Diff line
@@ -45,7 +45,10 @@ stdenv.mkDerivation rec {
  # Required for build with gcc-14
  env.NIX_CFLAGS_COMPILE = "-std=c++14";

  cmakeFlags = [ "-DENABLE_OPENMP=ON" ];
  cmakeFlags = [
    "-DENABLE_OPENMP=ON"
    "-DCMAKE_POLICY_VERSION_MINIMUM=3.5"
  ];

  hardeningDisable = [ "format" ];

+11 −0
Original line number Diff line number Diff line
{
  buildPythonPackage,
  python,
  simple-dftd3,
  cffi,
  numpy,
@@ -44,4 +45,14 @@ buildPythonPackage {
  preCheck = ''
    find . -name "_libdftd3*" -exec cp {} ./dftd3/. \;
  '';

  pythonImportsCheck = [ "dftd3" ];
  doCheck = true;

  # Parameters need to be present in the python site packages directory, but they
  # are originally only present in the fortran package. This is a consequence of
  # building the python bindings separately from the fortran library.
  postInstall = ''
    ln -s ${simple-dftd3}/share/s-dftd3/parameters.toml $out/${python.sitePackages}/dftd3/.
  '';
}
+4 −0
Original line number Diff line number Diff line
@@ -3653,6 +3653,10 @@ self: super: with self; {
  dfdiskcache = callPackage ../development/python-modules/dfdiskcache { };
  dftd4 = callPackage ../by-name/df/dftd4/python.nix {
    inherit (pkgs) dftd4;
  };
  diagrams = callPackage ../development/python-modules/diagrams { };
  diceware = callPackage ../development/python-modules/diceware { };