2024-08-21 22:22:13 +08:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
boost,
|
|
|
|
cmake,
|
|
|
|
fftw,
|
|
|
|
fftwSinglePrec,
|
|
|
|
hdf5,
|
|
|
|
libjpeg,
|
|
|
|
libpng,
|
|
|
|
libtiff,
|
|
|
|
openexr,
|
|
|
|
python3,
|
2021-11-01 15:58:00 +01:00
|
|
|
}:
|
2015-06-25 22:56:09 +02:00
|
|
|
|
2016-10-18 17:07:46 +02:00
|
|
|
let
|
2022-01-12 04:40:07 +01:00
|
|
|
python = python3.withPackages (py: with py; [ numpy ]);
|
2021-11-01 15:58:00 +01:00
|
|
|
in
|
2025-01-23 20:08:53 +08:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "vigra";
|
2025-01-21 23:54:15 +01:00
|
|
|
version = "1.12.1";
|
2010-07-29 14:38:39 +00:00
|
|
|
|
2021-11-01 15:58:00 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ukoethe";
|
|
|
|
repo = "vigra";
|
2025-01-23 20:08:53 +08:00
|
|
|
tag = "Version-${lib.replaceStrings [ "." ] [ "-" ] finalAttrs.version}";
|
2025-01-21 23:54:15 +01:00
|
|
|
hash = "sha256-ZmHj1BSyoMBCuxI5hrRiBEb5pDUsGzis+T5FSX27UN8=";
|
2010-07-29 14:38:39 +00:00
|
|
|
};
|
|
|
|
|
2025-02-21 20:25:50 -05:00
|
|
|
patches = [
|
2025-06-02 15:54:57 +02:00
|
|
|
# Patches to fix compiling on LLVM 19 from https://github.com/ukoethe/vigra/pull/592
|
2025-02-21 20:25:50 -05:00
|
|
|
./fix-llvm-19-1.patch
|
|
|
|
./fix-llvm-19-2.patch
|
|
|
|
];
|
|
|
|
|
2020-12-31 14:48:55 +07:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2021-11-01 15:58:00 +01:00
|
|
|
buildInputs = [
|
|
|
|
boost
|
|
|
|
fftw
|
|
|
|
fftwSinglePrec
|
|
|
|
hdf5
|
|
|
|
libjpeg
|
|
|
|
libpng
|
|
|
|
libtiff
|
|
|
|
openexr
|
|
|
|
python
|
|
|
|
];
|
2010-07-29 14:38:39 +00:00
|
|
|
|
2025-01-22 22:10:16 +08:00
|
|
|
postPatch = ''
|
|
|
|
chmod +x config/run_test.sh.in
|
|
|
|
patchShebangs --build config/run_test.sh.in
|
|
|
|
'';
|
|
|
|
|
2024-08-21 22:22:13 +08:00
|
|
|
cmakeFlags =
|
2024-08-21 22:22:58 +08:00
|
|
|
[
|
|
|
|
"-DWITH_OPENEXR=1"
|
|
|
|
"-DVIGRANUMPY_INSTALL_DIR=${placeholder "out"}/${python.sitePackages}"
|
|
|
|
]
|
2024-08-21 22:22:13 +08:00
|
|
|
++ lib.optionals (stdenv.hostPlatform.system == "x86_64-linux") [
|
|
|
|
"-DCMAKE_CXX_FLAGS=-fPIC"
|
|
|
|
"-DCMAKE_C_FLAGS=-fPIC"
|
|
|
|
];
|
2015-06-25 22:56:09 +02:00
|
|
|
|
2025-01-23 02:34:13 +08:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2025-01-22 22:10:16 +08:00
|
|
|
passthru = {
|
|
|
|
tests = {
|
|
|
|
check = finalAttrs.finalPackage.overrideAttrs (previousAttrs: {
|
|
|
|
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-01-22 00:00:13 +07:00
|
|
|
meta = with lib; {
|
2010-07-29 14:38:39 +00:00
|
|
|
description = "Novel computer vision C++ library with customizable algorithms and data structures";
|
2024-03-19 03:14:51 +01:00
|
|
|
mainProgram = "vigra-config";
|
2020-03-31 21:11:51 -04:00
|
|
|
homepage = "https://hci.iwr.uni-heidelberg.de/vigra";
|
2015-06-25 22:56:09 +02:00
|
|
|
license = licenses.mit;
|
2025-01-23 20:17:52 +08:00
|
|
|
maintainers = with maintainers; [ ShamrockLee ];
|
2018-04-17 20:39:10 +01:00
|
|
|
platforms = platforms.unix;
|
2010-07-29 14:38:39 +00:00
|
|
|
};
|
2025-01-23 20:08:53 +08:00
|
|
|
})
|