Commit a19281a3 authored by Markus Kowalewski's avatar Markus Kowalewski
Browse files

octopus: refactor

* switch to finalAttrs
* remove "with lib" from meta
* fix typo/bug in nativeBuildInputs
* fix checks, target is outdated
parent dfc4f555
Loading
Loading
Loading
Loading
+13 −9
Original line number Diff line number Diff line
@@ -29,14 +29,14 @@
assert (!blas.isILP64) && (!lapack.isILP64);
assert (blas.isILP64 == arpack.isILP64);

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
  pname = "octopus";
  version = "16.2";

  src = fetchFromGitLab {
    owner = "octopus-code";
    repo = "octopus";
    tag = version;
    tag = finalAttrs.version;
    hash = "sha256-L97igB+bdZ19zpbffHi8DVSJXKtUyDqauUB+l5zzFwQ=";
  };

@@ -82,9 +82,8 @@ stdenv.mkDerivation rec {
    (lib.cmakeBool "OCTOPUS_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
  ];

  nativeCheckInputs = lib.optional.enableMpi mpi;
  doCheck = false;
  checkTarget = "check-short";
  nativeCheckInputs = lib.optional enableMpi mpi;
  doCheck = false; # requires installed data

  postPatch = ''
    patchShebangs ./
@@ -94,15 +93,20 @@ stdenv.mkDerivation rec {
    patchShebangs testsuite/oct-run_testsuite.sh
  '';

  postInstall = ''
    mkdir -p $testsuite
    moveToOutput share/octopus/testsuite $testsuite
  '';

  enableParallelBuilding = true;

  passthru = lib.attrsets.optionalAttrs enableMpi { inherit mpi; };

  meta = with lib; {
  meta = {
    description = "Real-space time dependent density-functional theory code";
    homepage = "https://octopus-code.org";
    maintainers = with maintainers; [ markuskowa ];
    license = with licenses; [
    maintainers = with lib.maintainers; [ markuskowa ];
    license = with lib.licenses; [
      gpl2Only
      asl20
      lgpl3Plus
@@ -110,4 +114,4 @@ stdenv.mkDerivation rec {
    ];
    platforms = [ "x86_64-linux" ];
  };
}
})