anchor.diff:      sha256 = "0dr5i7b2mklnrcy6y6q9snahbxv2l7s38090my553g5kl5xb3r8x";
     };
   
  +  prePatch = ''
  +    rm -r External/libwfa
  +    cp -r ${srcLibwfa} External/libwfa
  +    chmod -R u+w External/
  +  '';
  +
     nativeBuildInputs = [ perl cmake texLive makeWrapper ];
  -  buildInputs = [ gfortran openblas hdf5-cpp python ];
  +  buildInputs = [ gfortran openblas hdf5-cpp python armadillo ];
  +
  +  # tests are not running right now.
  +  doCheck = false;
  +
  +  doInstallCheck = true;
  +
  +  enableParallelBuilding = true;
   
     cmakeFlags = [
       "-DOPENMP=ON"
       "-DLINALG=OpenBLAS"
  -    "-DTOOLS=OFF"
  +    "-DTOOLS=ON"
       "-DHDF5=ON"
  +    "-DFDE=ON"
  +    "-DWFA=ON"
       "-DCTEST=ON"
       "-DOPENBLASROOT=${openblas}"
     ];
   
     postConfigure = ''
  +    # The Makefile will install pymolcas during the build grrr.
       mkdir -p $out/bin
       export PATH=$PATH:$out/bin
  -
  -    echo ${python}
     '';
   
     postFixup = ''
  
positive.code: 
    installCheckPhase = ''
       #
       # Minimal check if installation is runs
       #
  
       export MOLCAS_WORKDIR=./
  
negative.code: 
       $out/bin/pymolcas $inp.inp > $inp.out
  
       echo "Check for sucessful run:"
       grep "Happy landing" $inp.status
       echo "Check for correct energy:"
       grep "Total SCF energy" $inp.out | grep 74.880174
    '';
  
    checkPhase = ''
      make test
    '';
  
    meta = with stdenv.lib; {
      description = "Quantum chemistry software package";
      homepage = https://gitlab.com/Molcas/OpenMolcas;
      maintainers = [ maintainers.markuskowa ];
      license = licenses.lgpl21;
      platforms = platforms.linux;
    };
  }
  
  