precice: fix output and cmake

This commit is contained in:
Scriptkiddi
2020-01-27 09:30:00 +01:00
committed by Lassulus
parent 45158b5c65
commit 50f3a9f100
2 changed files with 134 additions and 12 deletions
+22 -12
View File
@@ -1,26 +1,35 @@
{ lib, stdenv, fetchFromGitHub, cmake, gcc, boost, eigen, libxml2, openmpi, python2, python2Packages }:
{ lib, stdenv, fetchFromGitHub, cmake, gcc, boost, eigen, libxml2, openmpi, python3, python3Packages }:
stdenv.mkDerivation rec {
pname = "precice";
version = "1.6.1";
version = "2020-01-20";
# Todo next release switch back to versioning but for python3 support master is needed
src = fetchFromGitHub {
owner = "precice";
repo = pname;
rev = "v${version}";
sha256 = "00631zw6cpm67j35cwad04nwgfcvlxa8p660fwz30pgj2hzdx3d2";
rev = "9f778290416416255fc73a495e962def301648b0";
sha256 = "1ij43qjbf1aq3lh91gqpviajc8lyl7qkxfccmj5md5vwf88vjaip";
};
preConfigure = ''
cmakeFlags="-DBUILD_SHARED_LIBS=ON -DPETSC=off"
'';
cmakeFlags = [
"-DBUILD_SHARED_LIBS=ON"
"-DPETSC=off"
"-DPYTHON_LIBRARIES=${python3.libPrefix}"
"-DPYTHON_INCLUDE_DIR=${python3}/include/${python3.libPrefix}m"
];
nativeBuildInputs = [ cmake gcc ];
buildInputs = [ boost eigen libxml2 openmpi python2 python2Packages.numpy ];
installPhase = ''
mkdir -p $out/lib
cp libprecice.so libprecice.so.1.6.1 $out/lib/
'';
buildInputs = [ boost eigen libxml2 openmpi python3 python3Packages.numpy ];
patches = [
./0001-Fix-the-install-target-dirs-to-use-the-CMAKE-flags.patch # CMake Packaging is not perfect upstream, after this PR it is https://github.com/precice/precice/pull/577/files
];
enableParallelBuilding = true;
postInstall = ''
substituteInPlace "$out"/lib/cmake/precice/preciceTargets.cmake \
--replace 'INTERFACE_INCLUDE_DIRECTORIES "''${_IMPORT_PREFIX}/include;' 'INTERFACE_INCLUDE_DIRECTORIES "'$out/include';'
''; # Check if this can be removed after upstream PR 577
meta = {
description = "preCICE stands for Precise Code Interaction Coupling Environment";
@@ -31,3 +40,4 @@ stdenv.mkDerivation rec {
};
}