2020-01-04 15:32:59 +00:00
{ lib , stdenv , fetchFromGitHub , cmake , gcc , boost , eigen , libxml2 , openmpi , python3 , python3Packages }:
2019-12-11 14:39:54 +00:00
stdenv . mkDerivation rec {
pname = " p r e c i c e " ;
2020-01-04 15:32:59 +00:00
version = " 2 0 2 0 - 0 1 - 2 0 " ;
# Todo next release switch back to versioning but for python3 support master is needed
2019-12-11 14:39:54 +00:00
src = fetchFromGitHub {
owner = " p r e c i c e " ;
repo = pname ;
2020-01-04 15:32:59 +00:00
rev = " 9 f 7 7 8 2 9 0 4 1 6 4 1 6 2 5 5 f c 7 3 a 4 9 5 e 9 6 2 d e f 3 0 1 6 4 8 b 0 " ;
sha256 = " 1 i j 4 3 q j b f 1 a q 3 l h 9 1 g q p v i a j c 8 l y l 7 q k x f c c m j 5 m d 5 v w f 8 8 v j a i p " ;
2019-12-11 14:39:54 +00:00
} ;
2020-01-04 15:32:59 +00:00
cmakeFlags = [
" - D B U I L D _ S H A R E D _ L I B S = O N "
" - D P E T S C = o f f "
" - D P Y T H O N _ L I B R A R I E S = ${ python3 . libPrefix } "
" - D P Y T H O N _ I N C L U D E _ D I R = ${ python3 } / i n c l u d e / ${ python3 . libPrefix } m "
] ;
2019-12-11 14:39:54 +00:00
nativeBuildInputs = [ cmake gcc ] ;
2020-01-04 15:32:59 +00:00
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 " $ o u t " /lib/cmake/precice/preciceTargets.cmake \
- - replace ' INTERFACE_INCLUDE_DIRECTORIES " ' ' ${ _IMPORT_PREFIX } / i n c l u d e ; ' ' I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S " ' $ out/include ' ; '
'' ; # C h e c k i f t h i s c a n b e r e m o v e d a f t e r u p s t r e a m P R 5 7 7
2019-12-11 14:39:54 +00:00
meta = {
description = " p r e C I C E s t a n d s f o r P r e c i s e C o d e I n t e r a c t i o n C o u p l i n g E n v i r o n m e n t " ;
license = with lib . licenses ; [ gpl3 ] ;
homepage = " h t t p s : / / w w w . p r e c i c e . o r g / " ;
platforms = lib . platforms . linux ;
maintainers = with lib . maintainers ; [ Scriptkiddi ] ;
} ;
}
2020-01-04 15:32:59 +00:00