From eba51f5fdb4e5150c478367de66ed685ea01079b Mon Sep 17 00:00:00 2001 From: Mario Ceresa Date: Tue, 16 Jul 2013 09:34:16 +0200 Subject: [PATCH] Added support for VTK6.0 --- gdcm-0005-support-vtk6.patch | 13 ++++ gdcm-2.0.16-fix_dso_link.patch | 26 -------- ...-2.0.16-remove_versioned_install_dir.patch | 11 ---- gdcm-2.0.18-charls.patch | 62 ------------------- gdcm.spec | 8 ++- 5 files changed, 20 insertions(+), 100 deletions(-) create mode 100644 gdcm-0005-support-vtk6.patch delete mode 100644 gdcm-2.0.16-fix_dso_link.patch delete mode 100644 gdcm-2.0.16-remove_versioned_install_dir.patch delete mode 100644 gdcm-2.0.18-charls.patch diff --git a/gdcm-0005-support-vtk6.patch b/gdcm-0005-support-vtk6.patch new file mode 100644 index 0000000..933395c --- /dev/null +++ b/gdcm-0005-support-vtk6.patch @@ -0,0 +1,13 @@ +--- BUILD/gdcm-2.2.4/Utilities/VTK/CMakeLists.txt 2013-07-08 19:20:27.000000000 +0200 ++++ BUILD/gdcm-2.2.4.new/Utilities/VTK/CMakeLists.txt 2013-07-16 09:28:59.317107484 +0200 +@@ -2,6 +2,10 @@ + # We need VTK + # Technically we require VTK 5.0 and above + ++# To support VTK 6.0 ++include(${VTK_CMAKE_DIR}/vtkMakeInstantiator.cmake) ++ ++ + # Define the src for the vtk-gdcm bridge + SET(vtkgdcm_SRCS + vtkGDCMTesting.cxx diff --git a/gdcm-2.0.16-fix_dso_link.patch b/gdcm-2.0.16-fix_dso_link.patch deleted file mode 100644 index 737d2c1..0000000 --- a/gdcm-2.0.16-fix_dso_link.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff -ru gdcm-2.0.16_orig/Utilities/VTK/Applications/CMakeLists.txt gdcm-2.0.16/Utilities/VTK/Applications/CMakeLists.txt ---- gdcm-2.0.16_orig/Utilities/VTK/Applications/CMakeLists.txt 2010-08-18 12:25:43.000000000 +0200 -+++ gdcm-2.0.16/Utilities/VTK/Applications/CMakeLists.txt 2010-11-19 20:30:06.447787551 +0100 -@@ -29,7 +29,7 @@ - IF(GDCM_EXECUTABLE_PROPERTIES) - SET_TARGET_PROPERTIES(${app} PROPERTIES ${GDCM_EXECUTABLE_PROPERTIES}) - ENDIF(GDCM_EXECUTABLE_PROPERTIES) -- TARGET_LINK_LIBRARIES(${app} ${VTKGDCM_NAME}) -+ TARGET_LINK_LIBRARIES(${app} ${VTKGDCM_NAME} gdcmMSFF) - IF(VTK_USE_RENDERING) - TARGET_LINK_LIBRARIES(${app} vtkRendering) - -Only in gdcm-2.0.16/Utilities/VTK/Applications: CMakeLists.txt~ -diff -ru gdcm-2.0.16_orig/Utilities/VTK/Examples/Cxx/CMakeLists.txt gdcm-2.0.16/Utilities/VTK/Examples/Cxx/CMakeLists.txt ---- gdcm-2.0.16_orig/Utilities/VTK/Examples/Cxx/CMakeLists.txt 2010-08-18 12:25:43.000000000 +0200 -+++ gdcm-2.0.16/Utilities/VTK/Examples/Cxx/CMakeLists.txt 2010-11-19 20:30:09.457709578 +0100 -@@ -40,7 +40,7 @@ - FOREACH(app ${GDCM_VTK_APPS}) - ADD_EXECUTABLE(${app} ${app}.cxx) - #SET_TARGET_PROPERTIES(${app} PROPERTIES ${GDCM_EXECUTABLE_PROPERTIES}) -- TARGET_LINK_LIBRARIES(${app} ${VTKGDCM_NAME} ${vtkgdcm_LIBS}) -+ TARGET_LINK_LIBRARIES(${app} ${VTKGDCM_NAME} ${vtkgdcm_LIBS} gdcmMSFF) - IF( "${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}" GREATER 5.0 ) - IF(VTK_USE_RENDERING) - TARGET_LINK_LIBRARIES(${app} vtkWidgets vtkVolumeRendering) -Only in gdcm-2.0.16/Utilities/VTK/Examples/Cxx: CMakeLists.txt~ diff --git a/gdcm-2.0.16-remove_versioned_install_dir.patch b/gdcm-2.0.16-remove_versioned_install_dir.patch deleted file mode 100644 index e6d8908..0000000 --- a/gdcm-2.0.16-remove_versioned_install_dir.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- CMakeLists.txt.orig2 2010-11-22 11:43:24.258330997 +0100 -+++ CMakeLists.txt 2010-11-22 11:43:54.402331000 +0100 -@@ -191,7 +191,7 @@ - # Install directories - - STRING(TOLOWER ${PROJECT_NAME} projectname) --SET(subdir "${projectname}-${GDCM_MAJOR_VERSION}.${GDCM_MINOR_VERSION}") -+SET(subdir "${projectname}") - - IF(NOT GDCM_INSTALL_BIN_DIR) - SET(GDCM_INSTALL_BIN_DIR "bin") diff --git a/gdcm-2.0.18-charls.patch b/gdcm-2.0.18-charls.patch deleted file mode 100644 index f7d6f51..0000000 --- a/gdcm-2.0.18-charls.patch +++ /dev/null @@ -1,62 +0,0 @@ -diff -up gdcm-2.0.18/Examples/Cxx/CMakeLists.txt.charls gdcm-2.0.18/Examples/Cxx/CMakeLists.txt ---- gdcm-2.0.18/Examples/Cxx/CMakeLists.txt.charls 2011-06-29 01:08:45.000000000 -0600 -+++ gdcm-2.0.18/Examples/Cxx/CMakeLists.txt 2011-11-02 09:33:12.023845136 -0600 -@@ -107,7 +107,7 @@ ENDIF(GDCM_BUILD_TESTING) - FOREACH(example ${EXAMPLES_SRCS}) - ADD_EXECUTABLE(${example} ${example}.cxx) - IF(${example} STREQUAL "FixJAIBugJPEGLS") -- TARGET_LINK_LIBRARIES(${example} gdcmMSFF gdcmcharls) -+ TARGET_LINK_LIBRARIES(${example} gdcmMSFF ${GDCM_CHARLS_LIBRARIES}) - ELSE() - TARGET_LINK_LIBRARIES(${example} gdcmMSFF) - ENDIF() -diff -up gdcm-2.0.18/Examples/Cxx/FixJAIBugJPEGLS.cxx.charls gdcm-2.0.18/Examples/Cxx/FixJAIBugJPEGLS.cxx ---- gdcm-2.0.18/Examples/Cxx/FixJAIBugJPEGLS.cxx.charls 2011-06-29 01:08:45.000000000 -0600 -+++ gdcm-2.0.18/Examples/Cxx/FixJAIBugJPEGLS.cxx 2011-11-02 09:15:59.630494712 -0600 -@@ -17,8 +17,7 @@ - - #include - --#include "gdcmcharls/stdafx.h" --#include "gdcmcharls/interface.h" -+#include "gdcm_charls.h" - - /* - * This small example should show how one can handle the famous JAI-JPEGLS bug -@@ -67,7 +66,11 @@ int main(int argc, char *argv[]) - char *buffer = &vbuffer[0]; - sf->GetBuffer(buffer, totalLen); - -+#ifdef GDCM_USE_SYSTEM_CHARLS -+ JlsParameters metadata; -+#else - JlsParamaters metadata; -+#endif - if (JpegLsReadHeader(buffer, totalLen, &metadata) != OK) - { - std::cerr << "Cant parse jpegls" << std::endl; -@@ -156,15 +159,24 @@ int main(int argc, char *argv[]) - const char *pbyteCompressed = &vbuffer[0]; - unsigned int cbyteCompressed = vbuffer.size(); // updated legnth - -+#ifdef GDCM_USE_SYSTEM_CHARLS -+ JlsParameters params = {0}; -+#else - JlsParamaters params = {0}; -+#endif - JpegLsReadHeader(pbyteCompressed, cbyteCompressed, ¶ms); - - std::vector rgbyteOut; - //rgbyteOut.resize( image.GetBufferLength() ); - rgbyteOut.resize(params.height *params.width * ((params.bitspersample + 7) / 8) * params.components); - -+#ifdef GDCM_USE_SYSTEM_CHARLS -+ JLS_ERROR result = -+ JpegLsDecode(&rgbyteOut[0], rgbyteOut.size(), pbyteCompressed, cbyteCompressed, ¶ms ); -+#else - JLS_ERROR result = - JpegLsDecode(&rgbyteOut[0], rgbyteOut.size(), pbyteCompressed, cbyteCompressed ); -+#endif - if (result != OK) - { - std::cerr << "Could not patch JAI-JPEGLS" << std::endl; diff --git a/gdcm.spec b/gdcm.spec index f351771..3c0f875 100644 --- a/gdcm.spec +++ b/gdcm.spec @@ -6,7 +6,7 @@ Name: gdcm Version: 2.2.4 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Grassroots DiCoM is a C++ library to parse DICOM medical files Group: Development/Libraries License: BSD @@ -20,6 +20,8 @@ Patch1: gdcm-2.0.14-inplacebuild.patch Patch2: gdcm-2.0.14-usecopyright.patch Patch3: gdcm-2.0.17-install2libarch.patch Patch4: gdcm-2.0.17-no_versioned_dir.patch +# From http://public.kitware.com/pipermail/vtkusers/2013-February/127377.html +Patch5: gdcm-0005-support-vtk6.patch BuildRequires: CharLS-devel >= 1.0 BuildRequires: cmake @@ -91,6 +93,7 @@ used this library with python %patch2 %patch3 -p 1 %patch4 -p 1 +%patch5 -p 2 # Remove bundled utilities (we use Fedora's ones) @@ -193,6 +196,9 @@ ctest . %{python_sitelib}/* %changelog +* Wed Jul 16 2013 Mario Ceresa - 2.2.4-2 +- Add support for vtk 6.0.0 + * Fri Jul 12 2013 Orion Poplawski - 2.2.4-1 - Update to 2.2.4 - Rebuild for vtk 6.0.0