2018-07-21 01:44:44 +01:00
{ stdenv , fetchurl , boost , cmake , fftw , fftwSinglePrec , hdf5 , ilmbase
2016-10-18 16:07:46 +01:00
, libjpeg , libpng , libtiff , openexr , python2Packages } :
2015-06-25 21:56:09 +01:00
2016-10-18 16:07:46 +01:00
let
inherit ( python2Packages ) python numpy ;
# Might want to use `python2.withPackages(ps: [ps.numpy]);` here...
in stdenv . mkDerivation rec {
2019-08-15 13:41:18 +01:00
pname = " v i g r a " ;
2017-08-04 23:09:05 +01:00
version = " 1 . 1 1 . 1 " ;
2010-07-29 15:38:39 +01:00
src = fetchurl {
2015-06-25 21:56:09 +01: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 23:09:05 +01: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 15:38:39 +01:00
} ;
2016-09-01 17:11:21 +01:00
NIX_CFLAGS_COMPILE = " - I ${ ilmbase . dev } / i n c l u d e / O p e n E X R " ;
2015-06-25 21:56:09 +01:00
2018-04-17 20:39:10 +01: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 ] ;
2020-12-31 07:48:55 +00:00
nativeBuildInputs = [ cmake ] ;
buildInputs = [ boost fftw fftwSinglePrec hdf5 ilmbase libjpeg libpng
2015-06-25 21:56:09 +01:00
libtiff numpy openexr python ] ;
2010-07-29 15:38:39 +01: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 15:38:39 +01:00
2015-06-25 21:56:09 +01:00
cmakeFlags = [ " - D W I T H _ O P E N E X R = 1 " ]
2018-08-20 20:11:29 +01:00
++ stdenv . lib . optionals ( stdenv . hostPlatform . system == " x 8 6 _ 6 4 - l i n u x " )
2015-06-25 21:56:09 +01: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 " ] ;
2018-08-08 20:04:28 +01: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 21:56:09 +01:00
meta = with stdenv . lib ; {
2010-07-29 15:38:39 +01: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 02:11:51 +01: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 21:56:09 +01:00
license = licenses . mit ;
maintainers = [ maintainers . viric ] ;
2018-04-17 20:39:10 +01:00
platforms = platforms . unix ;
2010-07-29 15:38:39 +01:00
} ;
}