Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vtk: add vtk-dicom module #317335

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions pkgs/development/libraries/vtk/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
libXt,
libpng,
libtiff,
gdcm,
fetchpatch,
fetchFromGitHub,
enableQt ? false,
qtx11extras,
qttools,
Expand All @@ -25,6 +27,7 @@
enablePython ? false,
python ? throw "vtk: Python support requested, but no python interpreter was given.",
enableEgl ? false,
enableVtkDicom ? true,
}:

let
Expand All @@ -43,6 +46,20 @@ stdenv.mkDerivation {
sha256 = sourceSha256;
};

preConfigure =
let
vtk-dicom = fetchFromGitHub {
owner = "dgobbi";
repo = "vtk-dicom";
rev = "v0.8.17";
sha256 = "sha256-1lI2qsV4gymWqjeouEHZ5FRlmlh9vimH7J5rzA+eOds=";
};
in
''
cp -r ${vtk-dicom} ./Remote/vtkDICOM
chmod -R +w ./Remote/vtkDICOM
'';

nativeBuildInputs = [ cmake ];

buildInputs =
Expand All @@ -64,6 +81,9 @@ stdenv.mkDerivation {
]
++ optionals enablePython [
python
]
++ optionals enableVtkDicom [
(gdcm.override { enableVTK = false; })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should consider lifting this to e.g. all-packages.nix say by defining vtkWithGdcm or similar, but I think it's fine?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's vice versa, gdcmWithGtk. I have no preference, so can move it.

];
propagatedBuildInputs = optionals stdenv.hostPlatform.isLinux [
libX11
Expand Down Expand Up @@ -117,6 +137,11 @@ stdenv.mkDerivation {
++ optionals enablePython [
"-DVTK_WRAP_PYTHON:BOOL=ON"
"-DVTK_PYTHON_VERSION:STRING=${pythonMajor}"
]
++ optionals enableVtkDicom [
# Allows to read compressed dicom files:
# https://dgobbi.github.io/vtk-dicom/doc/api/installation.html
"-DUSE_GDCM=ON"
];

env = lib.optionalAttrs stdenv.cc.isClang {
Expand Down
Loading