diff --git a/pkgs/development/libraries/gdcm/add-missing-losslylosslessarray-in-TestTransferSyntax.patch b/pkgs/development/libraries/gdcm/add-missing-losslylosslessarray-in-TestTransferSyntax.patch new file mode 100644 index 0000000000000..a3701135c5101 --- /dev/null +++ b/pkgs/development/libraries/gdcm/add-missing-losslylosslessarray-in-TestTransferSyntax.patch @@ -0,0 +1,14 @@ +diff --git a/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestTransferSyntax.cxx b/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestTransferSyntax.cxx +index 7ad350d..6f962ce 100644 +--- a/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestTransferSyntax.cxx ++++ b/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestTransferSyntax.cxx +@@ -43,6 +43,9 @@ static const int losslylosslessarray[][3] = { + { 1, 0, 1 }, // MPEG2MainProfileHighLevel + { 1, 0, 1 }, // MPEG4AVCH264HighProfileLevel4_1 + { 1, 0, 1 }, // MPEG4AVCH264BDcompatibleHighProfileLevel4_1 ++ { 0, 1, 1 }, // HTJ2KLossless ++ { 0, 1, 1 }, // HTJ2KRPCLLossless ++ { 1, 0, 1 }, // HTJ2K + }; + + static int TestTransferSyntaxAll() diff --git a/pkgs/development/libraries/gdcm/default.nix b/pkgs/development/libraries/gdcm/default.nix index 765e88adbfef2..e034c3a52c2d0 100644 --- a/pkgs/development/libraries/gdcm/default.nix +++ b/pkgs/development/libraries/gdcm/default.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitHub, + fetchpatch2, cmake, enableVTK ? true, vtk, @@ -14,19 +15,32 @@ openjpeg, zlib, pkg-config, + ctestCheckHook, }: stdenv.mkDerivation rec { pname = if enablePython then "python-gdcm" else "gdcm"; - version = "3.0.24"; + version = "3.0.25"; src = fetchFromGitHub { owner = "malaterre"; repo = "GDCM"; tag = "v${version}"; - hash = "sha256-Zlb6UCP4aFZOJJNhFQBBrwzst+f37gs1zaCBMTOUgZE="; + hash = "sha256-PYVVlSqeAZCWvnWPqqWGQIWatMfPYqnrXc7cqi8UseU="; }; + patches = + [ + ./add-missing-losslylosslessarray-in-TestTransferSyntax.patch + ] + ++ lib.optionals (lib.versionOlder vtk.version "9.3") [ + (fetchpatch2 { + url = "https://github.com/malaterre/GDCM/commit/3be6c2fa0945c91889bcf06e8c20e88f69692dd5.patch?full_index=1"; + hash = "sha256-Yt5f4mxhP5n+L0A/CRq3CxKCqUT7LZ8uKdbCf9P71Zc="; + revert = true; + }) + ]; + cmakeFlags = [ "-DGDCM_BUILD_APPLICATIONS=ON" @@ -95,11 +109,10 @@ stdenv.mkDerivation rec { "TestRescaler2" ]; - checkPhase = '' - runHook preCheck - ctest --exclude-regex '^(${lib.concatStringsSep "|" disabledTests})$' - runHook postCheck - ''; + nativeCheckInputs = [ + ctestCheckHook + ]; + doCheck = true; # note that when the test data is available to the build via `fetchSubmodules = true`, # a number of additional but much slower tests are enabled