From 039cb74bbbd0455adba372f7d20eda238000a4e9 Mon Sep 17 00:00:00 2001 From: Kevin Leonardic Date: Tue, 23 Jan 2024 20:55:04 +0100 Subject: [PATCH] [dcmtk] Enable toggling external dictionary as a feature (#36136) --- ports/dcmtk/dictionary_paths.patch | 26 ++++++++++++++++++++++++++ ports/dcmtk/portfile.cmake | 8 ++++++++ ports/dcmtk/vcpkg.json | 4 ++++ versions/baseline.json | 2 +- versions/d-/dcmtk.json | 5 +++++ 5 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 ports/dcmtk/dictionary_paths.patch diff --git a/ports/dcmtk/dictionary_paths.patch b/ports/dcmtk/dictionary_paths.patch new file mode 100644 index 0000000000..9e38f2a176 --- /dev/null +++ b/ports/dcmtk/dictionary_paths.patch @@ -0,0 +1,26 @@ +diff --git a/CMake/GenerateDCMTKConfigure.cmake b/CMake/GenerateDCMTKConfigure.cmake +index 8a59d44fa..8d3b4fc60 100644 +--- a/CMake/GenerateDCMTKConfigure.cmake ++++ b/CMake/GenerateDCMTKConfigure.cmake +@@ -173,19 +173,11 @@ if(WIN32 AND NOT CYGWIN) + + # Set dictionary path to the data dir inside install main dir (prefix) + if(DCMTK_DEFAULT_DICT STREQUAL "external") +- if(DCMTK_USE_WIN32_PROGRAMDATA) +- set(DCM_DICT_DEFAULT_PATH "${CMAKE_INSTALL_FULL_DATADIR}\\\\dicom.dic") +- else() +- set(DCM_DICT_DEFAULT_PATH "${DCMTK_PREFIX}\\\\${CMAKE_INSTALL_DATADIR}\\\\dcmtk\\\\dicom.dic") +- endif() ++ set(DCM_DICT_DEFAULT_PATH "${CMAKE_INSTALL_FULL_DATADIR}\\\\dicom.dic") + + # If private dictionary should be utilized, add it to default dictionary path. + if(ENABLE_PRIVATE_TAGS) +- if(DCMTK_USE_WIN32_PROGRAMDATA) +- set(DCM_DICT_DEFAULT_PATH "${DCM_DICT_DEFAULT_PATH};${CMAKE_INSTALL_FULL_DATADIR}\\\\private.dic") +- else() +- set(DCM_DICT_DEFAULT_PATH "${DCM_DICT_DEFAULT_PATH};${DCMTK_PREFIX}\\\\${CMAKE_INSTALL_DATADIR}\\\\dcmtk\\\\private.dic") +- endif() ++ set(DCM_DICT_DEFAULT_PATH "${DCM_DICT_DEFAULT_PATH};${CMAKE_INSTALL_FULL_DATADIR}\\\\private.dic") + endif() + + # Again, for Windows strip all / from path and replace it with \\. diff --git a/ports/dcmtk/portfile.cmake b/ports/dcmtk/portfile.cmake index b46cea1954..e6fcd4e7ce 100644 --- a/ports/dcmtk/portfile.cmake +++ b/ports/dcmtk/portfile.cmake @@ -7,6 +7,7 @@ vcpkg_from_github( PATCHES dcmtk.patch fix_link_xml2.patch + dictionary_paths.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS @@ -21,10 +22,17 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS "tools" BUILD_APPS ) +if("external-dict" IN_LIST FEATURES) + set(DCMTK_DEFAULT_DICT "external") +else() + set(DCMTK_DEFAULT_DICT "builtin") +endif() + vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS ${FEATURE_OPTIONS} + "-DDCMTK_DEFAULT_DICT=${DCMTK_DEFAULT_DICT}" -DDCMTK_WITH_DOXYGEN=OFF -DDCMTK_FORCE_FPIC_ON_UNIX=ON -DDCMTK_OVERWRITE_WIN32_COMPILER_FLAGS=OFF diff --git a/ports/dcmtk/vcpkg.json b/ports/dcmtk/vcpkg.json index 19656f5224..42ec0d7737 100644 --- a/ports/dcmtk/vcpkg.json +++ b/ports/dcmtk/vcpkg.json @@ -1,6 +1,7 @@ { "name": "dcmtk", "version": "3.6.8", + "port-version": 1, "description": "This DICOM ToolKit (DCMTK) package consists of source code, documentation and installation instructions for a set of software libraries and applications implementing part of the DICOM/MEDICOM Standard.", "homepage": "https://github.com/DCMTK/dcmtk", "license": "BSD-3-Clause OR BSD-2-Clause OR libtiff OR MIT OR Zlib OR Libpng", @@ -16,6 +17,9 @@ } ], "features": { + "external-dict": { + "description": "Enable external dictionary" + }, "iconv": { "description": "Enable Iconv support", "dependencies": [ diff --git a/versions/baseline.json b/versions/baseline.json index 0fb591a738..7d05041f03 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2162,7 +2162,7 @@ }, "dcmtk": { "baseline": "3.6.8", - "port-version": 0 + "port-version": 1 }, "debug-assert": { "baseline": "1.3.3", diff --git a/versions/d-/dcmtk.json b/versions/d-/dcmtk.json index a2c08d51df..58305ea8de 100644 --- a/versions/d-/dcmtk.json +++ b/versions/d-/dcmtk.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "bec215b4880ee37ff46a69fdbc6bd3888901c52a", + "version": "3.6.8", + "port-version": 1 + }, { "git-tree": "04c152f7113c88dcfb84b3f4963cadd60c254a74", "version": "3.6.8",