Skip to content

Commit

Permalink
{itk_5_2, python312Packages.itk}: unbreak by disabling RTK cmake modu…
Browse files Browse the repository at this point in the history
…le (NixOS#366994)
  • Loading branch information
misuzu authored Jan 2, 2025
2 parents d169a1e + 42df0b4 commit 1a46589
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
34 changes: 20 additions & 14 deletions pkgs/development/libraries/itk/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
zlib,
Cocoa,
enablePython ? false,
enableRtk ? true,
}:

let
Expand Down Expand Up @@ -116,6 +117,8 @@ stdenv.mkDerivation {
"-DModule_MGHIO=ON"
"-DModule_AdaptiveDenoising=ON"
"-DModule_GenericLabelInterpolator=ON"
]
++ lib.optionals enableRtk [
"-DModule_RTK=ON"
]
++ lib.optionals enablePython [
Expand Down Expand Up @@ -153,20 +156,23 @@ stdenv.mkDerivation {
# These deps were propagated from VTK 9 in https://github.com/NixOS/nixpkgs/pull/206935,
# so we simply propagate them again from ITK.
# This admittedly is a hack and seems like an issue with VTK 9's CMake configuration.
propagatedBuildInputs = [
# The dependencies we've un-vendored from ITK, such as GDCM, must be propagated,
# otherwise other software built against ITK fails to configure since ITK headers
# refer to these previously vendored libraries:
expat
fftw
gdcm
hdf5-cpp
libjpeg
libminc
libpng
libtiff
zlib
] ++ lib.optionals withVtk vtk.propagatedBuildInputs ++ lib.optionals enablePython [ numpy ];
propagatedBuildInputs =
[
# The dependencies we've un-vendored from ITK, such as GDCM, must be propagated,
# otherwise other software built against ITK fails to configure since ITK headers
# refer to these previously vendored libraries:
expat
fftw
gdcm
hdf5-cpp
libjpeg
libminc
libpng
libtiff
zlib
]
++ lib.optionals withVtk vtk.propagatedBuildInputs
++ lib.optionals enablePython [ numpy ];

postInstall = lib.optionalString enablePython ''
substitute \
Expand Down
1 change: 1 addition & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9493,6 +9493,7 @@ with pkgs;

itk_5_2 = callPackage ../development/libraries/itk/5.2.x.nix {
inherit (darwin.apple_sdk.frameworks) Cocoa;
enableRtk = false;
};

itk_5 = callPackage ../development/libraries/itk/5.x.nix {
Expand Down
1 change: 1 addition & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6491,6 +6491,7 @@ self: super: with self; {
itk = toPythonModule (pkgs.itk.override {
inherit python numpy;
enablePython = true;
enableRtk = false;
});


Expand Down

0 comments on commit 1a46589

Please sign in to comment.