10 , enablePython ? false
20 stdenv.mkDerivation rec {
24 src = fetchFromGitHub {
27 rev = "refs/tags/v${version}";
28 hash = "sha256-geWNGbBJGKPs5hNO42vtVOj0rOWyM6zmcocvRhWW4s0=";
32 "-DGDCM_BUILD_APPLICATIONS=ON"
33 "-DGDCM_BUILD_SHARED_LIBS=ON"
34 "-DGDCM_BUILD_TESTING=ON"
35 "-DGDCM_USE_SYSTEM_EXPAT=ON"
36 "-DGDCM_USE_SYSTEM_ZLIB=ON"
37 "-DGDCM_USE_SYSTEM_UUID=ON"
38 "-DGDCM_USE_SYSTEM_OPENJPEG=ON"
39 # hack around usual "`RUNTIME_DESTINATION` must not be an absolute path" issue:
40 "-DCMAKE_INSTALL_LIBDIR=lib"
41 "-DCMAKE_INSTALL_BINDIR=bin"
42 "-DCMAKE_INSTALL_INCLUDEDIR=include"
43 ] ++ lib.optionals enableVTK [
45 ] ++ lib.optionals enablePython [
46 "-DGDCM_WRAP_PYTHON:BOOL=ON"
47 "-DGDCM_INSTALL_PYTHONMODULE_DIR=${placeholder "out"}/${python.sitePackages}"
60 ] ++ lib.optionals enableVTK [
62 ] ++ lib.optionals stdenv.isDarwin [
66 ] ++ lib.optionals enablePython [ swig4 python ];
72 "gdcmscu-echo-dicomserver"
73 "gdcmscu-find-dicomserver"
74 # seemingly ought to be be disabled when the test data submodule is not present:
75 "TestvtkGDCMImageReader2_3"
77 # errors because 3 classes not wrapped:
83 ctest --exclude-regex '^(${lib.concatStringsSep "|" disabledTests})$'
87 # note that when the test data is available to the build via `fetchSubmodules = true`,
88 # a number of additional but much slower tests are enabled
91 description = "The grassroots cross-platform DICOM implementation";
93 Grassroots DICOM (GDCM) is an implementation of the DICOM standard designed to be open source so that researchers may access clinical data directly.
94 GDCM includes a file format definition and a network communications protocol, both of which should be extended to provide a full set of tools for a researcher or small medical imaging vendor to interface with an existing medical database.
96 homepage = "https://gdcm.sourceforge.net/";
97 license = with licenses; [ bsd3 asl20 ];
98 maintainers = with maintainers; [ tfmoraes ];
99 platforms = platforms.all;