2018-07-21 00:44:44 +00:00
{ stdenv , fetchurl , boost , cmake , fftw , fftwSinglePrec , hdf5 , ilmbase
2016-10-18 15:07:46 +00:00
, libjpeg , libpng , libtiff , openexr , python2Packages } :
2015-06-25 20:56:09 +00:00
2016-10-18 15:07:46 +00:00
let
inherit ( python2Packages ) python numpy ;
# Might want to use `python2.withPackages(ps: [ps.numpy]);` here...
in stdenv . mkDerivation rec {
2019-08-15 12:41:18 +00:00
pname = " v i g r a " ;
2017-08-04 22:09:05 +00:00
version = " 1 . 1 1 . 1 " ;
2010-07-29 14:38:39 +00:00
src = fetchurl {
2015-06-25 20:56:09 +00:00
url = " h t t p s : / / g i t h u b . c o m / u k o e t h e / v i g r a / a r c h i v e / V e r s i o n - ${ stdenv . lib . replaceChars [ " . " ] [ " - " ] version } . t a r . g z " ;
2017-08-04 22:09:05 +00:00
sha256 = " 0 3 i 5 w f s c v 8 3 j b 8 v n w w h f m m 8 y f i n i w k v k 1 3 m y z h r 1 k b w b s 9 8 8 4 w d j " ;
2010-07-29 14:38:39 +00:00
} ;
2016-09-01 16:11:21 +00:00
NIX_CFLAGS_COMPILE = " - I ${ ilmbase . dev } / i n c l u d e / O p e n E X R " ;
2015-06-25 20:56:09 +00:00
2018-04-17 19:39:10 +00:00
# Fixes compilation with clang (on darwin) see https://github.com/ukoethe/vigra/issues/414
patches =
let clangPatch = fetchurl { url = " h t t p s : / / g i t h u b . c o m / u k o e t h e / v i g r a / c o m m i t / 8 1 9 5 8 d 3 0 2 4 9 4 e 1 3 7 f 9 8 a 8 b 1 d 7 8 6 9 8 4 1 5 3 2 f 9 0 3 8 8 . p a t c h " ;
sha256 = " 1 i 1 w 6 s m i j g b 5 z 8 b g 9 j a q 8 4 c c y 0 0 k 2 s x m 8 7 s 3 7 l g j p y i x 9 0 1 g j l g i " ; } ;
in [ clangPatch ] ;
2015-06-25 20:56:09 +00:00
buildInputs = [ boost cmake fftw fftwSinglePrec hdf5 ilmbase libjpeg libpng
libtiff numpy openexr python ] ;
2010-07-29 14:38:39 +00:00
2012-02-17 18:50:29 +00:00
preConfigure = " c m a k e F l a g s + = \" - D V I G R A N U M P Y _ I N S T A L L _ D I R = $ o u t / l i b / ${ python . libPrefix } / s i t e - p a c k a g e s \" " ;
2010-07-29 14:38:39 +00:00
2015-06-25 20:56:09 +00:00
cmakeFlags = [ " - D W I T H _ O P E N E X R = 1 " ]
2018-08-20 19:11:29 +00:00
++ stdenv . lib . optionals ( stdenv . hostPlatform . system == " x 8 6 _ 6 4 - l i n u x " )
2015-06-25 20:56:09 +00:00
[ " - D C M A K E _ C X X _ F L A G S = - f P I C " " - D C M A K E _ C _ F L A G S = - f P I C " ] ;
2017-11-03 00:44:23 +00:00
enableParallelBuilding = true ;
2018-08-08 19:04:28 +00:00
# fails with "./test_watersheds3d: error while loading shared libraries: libvigraimpex.so.11: cannot open shared object file: No such file or directory"
doCheck = false ;
2015-06-25 20:56:09 +00:00
meta = with stdenv . lib ; {
2010-07-29 14:38:39 +00:00
description = " N o v e l c o m p u t e r v i s i o n C + + l i b r a r y w i t h c u s t o m i z a b l e a l g o r i t h m s a n d d a t a s t r u c t u r e s " ;
2020-04-01 01:11:51 +00:00
homepage = " h t t p s : / / h c i . i w r . u n i - h e i d e l b e r g . d e / v i g r a " ;
2015-06-25 20:56:09 +00:00
license = licenses . mit ;
maintainers = [ maintainers . viric ] ;
2018-04-17 19:39:10 +00:00
platforms = platforms . unix ;
2010-07-29 14:38:39 +00:00
} ;
}