2021-02-05 17:12:51 +00:00
{ lib , stdenv , fetchurl , boost , cmake , fftw , fftwSinglePrec , hdf5 , ilmbase
2020-04-24 23:36:52 +00:00
, libjpeg , libpng , libtiff , openexr , python2Packages } :
let
inherit ( python2Packages ) python numpy ;
# Might want to use `python2.withPackages(ps: [ps.numpy]);` here...
in stdenv . mkDerivation rec {
pname = " v i g r a " ;
version = " 1 . 1 1 . 1 " ;
src = fetchurl {
2021-02-05 17:12:51 +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 - ${ lib . replaceChars [ " . " ] [ " - " ] version } . t a r . g z " ;
2020-04-24 23:36:52 +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 " ;
} ;
NIX_CFLAGS_COMPILE = " - I ${ ilmbase . dev } / i n c l u d e / O p e n E X R " ;
# 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 ] ;
2021-01-15 22:18:51 +00:00
nativeBuildInputs = [ cmake ] ;
buildInputs = [ boost fftw fftwSinglePrec hdf5 ilmbase libjpeg libpng
2020-04-24 23:36:52 +00:00
libtiff numpy openexr python ] ;
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 \" " ;
cmakeFlags = [ " - D W I T H _ O P E N E X R = 1 " ]
2021-02-05 17:12:51 +00:00
++ lib . optionals ( stdenv . hostPlatform . system == " x 8 6 _ 6 4 - l i n u x " )
2020-04-24 23:36:52 +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 " ] ;
# fails with "./test_watersheds3d: error while loading shared libraries: libvigraimpex.so.11: cannot open shared object file: No such file or directory"
doCheck = false ;
2021-02-05 17:12:51 +00:00
meta = with lib ; {
2020-04-24 23:36:52 +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 " ;
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 " ;
license = licenses . mit ;
maintainers = [ maintainers . viric ] ;
platforms = platforms . unix ;
} ;
}