From 8e734dbea3044d6512bfbab146c2fac51c97f75afb1540b2e723a74c3830d9ab Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Fri, 29 May 2020 06:34:10 +0000 Subject: [PATCH] Accepting request 810056 from home:badshah400:branches:science * Update to version 5.0.1 * Drop add_gcc9_support.patch: no longer required with upstream support for up to GCC 10 baked in. * Pass options to %cmake to set proper install paths when installing; prevents the need to manually move installed libs around. Drop sed BuildRequires that is no longer required as a consequence. * Enable python3 wrapping (needed for tomviz, for instance); split out separate python3-itk package. Introduces BuildRequires: python3-devel. * Add BuildRequires: memory-constraints and use %limit_build to require at least 2 GiB memory per thread; OOM failures otherwise. * Update _constraints file: at least 24 GB (!!!) disk space and 2 GB memory now required. * Use ninja for build (BuildRequires: ninja); compile using %cmake_build instead of make directly. * Additional system library dependencies: CastXML-devel, gtest, double-conversion, and gdcm-devel. * Convert BuildRequires to pkgconfig() or cmake() based ones wherever possible. * Update URL and Source URL in keeping with upstream's move to github. * Drop conditionals for old openSUSE versions. OBS-URL: https://build.opensuse.org/request/show/810056 OBS-URL: https://build.opensuse.org/package/show/Application:Geo/insighttoolkit?expand=0&rev=21 --- InsightToolkit-4.13.2.tar.xz | 3 - InsightToolkit-5.0.1.tar.gz | 3 + _constraints | 5 +- add_gcc9_support.patch | 21 ------ dcmtk-cmake.patch | 25 ++++--- insighttoolkit.changes | 31 ++++++++ insighttoolkit.spec | 138 ++++++++++++++++------------------- 7 files changed, 115 insertions(+), 111 deletions(-) delete mode 100644 InsightToolkit-4.13.2.tar.xz create mode 100644 InsightToolkit-5.0.1.tar.gz delete mode 100644 add_gcc9_support.patch diff --git a/InsightToolkit-4.13.2.tar.xz b/InsightToolkit-4.13.2.tar.xz deleted file mode 100644 index 0726f8e..0000000 --- a/InsightToolkit-4.13.2.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dabe05234d24635c96fd9b1a5f5e3afc34e11f49a31e5107db19bf61da758fa5 -size 12424136 diff --git a/InsightToolkit-5.0.1.tar.gz b/InsightToolkit-5.0.1.tar.gz new file mode 100644 index 0000000..e6604a1 --- /dev/null +++ b/InsightToolkit-5.0.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:613b125cbf58481e8d1e36bdeacf7e21aba4b129b4e524b112f70c4d4e6d15a6 +size 20627889 diff --git a/_constraints b/_constraints index 1fa0e7f..94259c3 100644 --- a/_constraints +++ b/_constraints @@ -1,7 +1,10 @@ - 6 + 24 + + 2 + diff --git a/add_gcc9_support.patch b/add_gcc9_support.patch deleted file mode 100644 index 48864ee..0000000 --- a/add_gcc9_support.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -ur InsightToolkit-4.13.2/Modules/ThirdParty/VNL/src/vxl/vcl/vcl_compiler.h InsightToolkit-4.13.2_fix/Modules/ThirdParty/VNL/src/vxl/vcl/vcl_compiler.h ---- InsightToolkit-4.13.2/Modules/ThirdParty/VNL/src/vxl/vcl/vcl_compiler.h 2019-07-02 15:24:20.401356209 +0200 -+++ InsightToolkit-4.13.2_fix/Modules/ThirdParty/VNL/src/vxl/vcl/vcl_compiler.h 2019-07-02 15:25:33.639041143 +0200 -@@ -97,6 +97,17 @@ - # else - # define VCL_GCC_80 - # endif -+# elif (__GNUC__==9) -+# define VCL_GCC_9 -+# if (__GNUC_MINOR__ > 2 ) -+# define VCL_GCC_93 -+# elif (__GNUC_MINOR__ > 1 ) -+# define VCL_GCC_92 -+# elif (__GNUC_MINOR__ > 0 ) -+# define VCL_GCC_91 -+# else -+# define VCL_GCC_90 -+# endif - # else - # error "Dunno about this gcc" - # endif diff --git a/dcmtk-cmake.patch b/dcmtk-cmake.patch index 4f17cfc..66ef53e 100644 --- a/dcmtk-cmake.patch +++ b/dcmtk-cmake.patch @@ -1,6 +1,7 @@ -diff -ruN InsightToolkit-4.13.2.orig/Modules/ThirdParty/DCMTK/CMake/FindDCMTK.cmake InsightToolkit-4.13.2/Modules/ThirdParty/DCMTK/CMake/FindDCMTK.cmake ---- InsightToolkit-4.13.2.orig/Modules/ThirdParty/DCMTK/CMake/FindDCMTK.cmake 1970-01-01 02:00:00.000000000 +0200 -+++ InsightToolkit-4.13.2/Modules/ThirdParty/DCMTK/CMake/FindDCMTK.cmake 2015-11-12 18:21:07.000000000 +0200 +Index: InsightToolkit-5.0.1/Modules/ThirdParty/DCMTK/CMake/FindDCMTK.cmake +=================================================================== +--- /dev/null ++++ InsightToolkit-5.0.1/Modules/ThirdParty/DCMTK/CMake/FindDCMTK.cmake @@ -0,0 +1,350 @@ +# - find DCMTK libraries and applications +# The module defines the following variables: @@ -352,10 +353,11 @@ diff -ruN InsightToolkit-4.13.2.orig/Modules/ThirdParty/DCMTK/CMake/FindDCMTK.cm +endif() + +message(STATUS "Trying to find DCMTK relying on FindDCMTK.cmake - ok") -diff -ruN InsightToolkit-4.13.2.orig/Modules/ThirdParty/DCMTK/CMakeLists.txt InsightToolkit-4.13.2/Modules/ThirdParty/DCMTK/CMakeLists.txt ---- InsightToolkit-4.13.2.orig/Modules/ThirdParty/DCMTK/CMakeLists.txt 2016-05-26 18:32:22.000000000 +0300 -+++ InsightToolkit-4.13.2/Modules/ThirdParty/DCMTK/CMakeLists.txt 2016-10-02 12:37:14.117972925 +0300 -@@ -154,14 +154,14 @@ +Index: InsightToolkit-5.0.1/Modules/ThirdParty/DCMTK/CMakeLists.txt +=================================================================== +--- InsightToolkit-5.0.1.orig/Modules/ThirdParty/DCMTK/CMakeLists.txt ++++ InsightToolkit-5.0.1/Modules/ThirdParty/DCMTK/CMakeLists.txt +@@ -102,14 +102,14 @@ if(ITK_USE_SYSTEM_DCMTK) # When this module is loaded by an app, load DCMTK too. set(ITKDCMTK_EXPORT_CODE_INSTALL " set(DCMTK_DIR \"${DCMTK_DIR}\") @@ -372,10 +374,11 @@ diff -ruN InsightToolkit-4.13.2.orig/Modules/ThirdParty/DCMTK/CMakeLists.txt Ins endif() ") -diff -ruN InsightToolkit-4.13.2.orig/Modules/ThirdParty/DCMTK/itk-module-init.cmake InsightToolkit-4.13.2/Modules/ThirdParty/DCMTK/itk-module-init.cmake ---- InsightToolkit-4.13.2.orig/Modules/ThirdParty/DCMTK/itk-module-init.cmake 2016-05-26 18:32:22.000000000 +0300 -+++ InsightToolkit-4.13.2/Modules/ThirdParty/DCMTK/itk-module-init.cmake 2016-10-02 12:37:41.557974143 +0300 -@@ -12,7 +12,7 @@ +Index: InsightToolkit-5.0.1/Modules/ThirdParty/DCMTK/itk-module-init.cmake +=================================================================== +--- InsightToolkit-5.0.1.orig/Modules/ThirdParty/DCMTK/itk-module-init.cmake ++++ InsightToolkit-5.0.1/Modules/ThirdParty/DCMTK/itk-module-init.cmake +@@ -24,7 +24,7 @@ endif() if(ITK_USE_SYSTEM_DCMTK) # Use local FindDCMTK.cmake. list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_LIST_DIR}/CMake") diff --git a/insighttoolkit.changes b/insighttoolkit.changes index 9b59aef..9a0024e 100644 --- a/insighttoolkit.changes +++ b/insighttoolkit.changes @@ -1,3 +1,34 @@ +------------------------------------------------------------------- +Mon May 18 01:15:30 UTC 2020 - Atri Bhattacharya + +- Update to version 5.0.1: See + https://discourse.itk.org/t/itk-5-0-1-has-been-released/2094. +- Changes from version 5.0.0: See + https://discourse.itk.org/t/itk-5-0-0-has-been-released/1931. +- Drop add_gcc9_support.patch: no longer required with upstream + support for up to GCC 10 baked in. +- Pass options to %cmake to set proper install paths when + installing; prevents the need to manually move installed libs + around. Drop sed BuildRequires that is no longer required as a + consequence. +- Enable python3 wrapping (needed for tomviz, for instance); split + out separate python3-itk package. Introduces BuildRequires: + python3-devel. +- Add BuildRequires: memory-constraints and use %limit_build + to require at least 2 GiB memory per thread; OOM failures + otherwise. +- Update _constraints file: at least 24 GB (!!!) disk space and 2 + GB memory now required. +- Use ninja for build (BuildRequires: ninja); compile using + %cmake_build instead of make directly. +- Additional system library dependencies: CastXML-devel, gtest, + double-conversion, and gdcm-devel. +- Convert BuildRequires to pkgconfig() or cmake() based ones + wherever possible. +- Update URL and Source URL in keeping with upstream's move to + github. +- Drop conditionals for old openSUSE versions. + ------------------------------------------------------------------- Sat Jul 6 18:06:51 UTC 2019 - Jan Engelhardt diff --git a/insighttoolkit.spec b/insighttoolkit.spec index b4911ac..53f132c 100644 --- a/insighttoolkit.spec +++ b/insighttoolkit.spec @@ -1,7 +1,7 @@ # # spec file for package insighttoolkit # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # Copyright (c) 2016 Angelos Tzotsos . # # All modifications and additions to the file contributed by third parties @@ -13,56 +13,60 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # +%global __builder ninja + %define tarname InsightToolkit -%define baseversion 4.13 +%define baseversion 5.0 +%define libname lib%{name}5 + Name: insighttoolkit -Version: %{baseversion}.2 +Version: 5.0.1 Release: 0 Summary: Insight Segmentation and Registration Toolkit License: Apache-2.0 Group: Development/Libraries/C and C++ -Url: http://www.itk.org -#Source0: http://sourceforge.net/projects/itk/files/itk/%{baseversion}/%{tarname}-%{version}.tar.xz -Source: https://netix.dl.sourceforge.net/project/itk/itk/%{baseversion}/%{tarname}-%{version}.tar.xz +URL: https://www.itk.org +Source: https://github.com/InsightSoftwareConsortium/ITK/releases/download/v%{version}/%{tarname}-%{version}.tar.gz Patch0: dcmtk-cmake.patch # PATCH-FIX-UPSTREAM proper linking against math library Patch1: nrrdio-linking.patch -# PATCH-FIX-UPSTREAM add support for GCC 9 -Patch2: add_gcc9_support.patch # PATCH-FIX-UPSTREAM proper linking against math library Patch3: itklbfgs-linking.patch -BuildRequires: cmake >= 2.8.0 +BuildRequires: CastXML-devel +BuildRequires: cmake BuildRequires: dcmtk BuildRequires: dcmtk-devel BuildRequires: fdupes -BuildRequires: fftw3-devel BuildRequires: fftw3-threads-devel -BuildRequires: gcc BuildRequires: gcc-c++ -# BuildRequires: gdcm-devel +BuildRequires: gdcm-devel +BuildRequires: gtest BuildRequires: hdf5-devel -BuildRequires: libexpat-devel -BuildRequires: libjpeg-devel -BuildRequires: libpng-devel -BuildRequires: libtiff-devel -BuildRequires: libxml2-devel -BuildRequires: python-devel -BuildRequires: sed +BuildRequires: libnsl-devel +BuildRequires: memory-constraints +BuildRequires: ninja +BuildRequires: pkgconfig +BuildRequires: python3-devel BuildRequires: swig -%if 0%{suse_version} > 1320 # Indirect DCMTK dep. Should DCMTK be fixed? # tcpd-devel is needed for libwrap.so on Tumbleweed (> Leap 42.3) BuildRequires: tcpd-devel -BuildRequires: libnsl-devel -%endif BuildRequires: vtk-devel +BuildRequires: vtk-qt BuildRequires: xz -BuildRequires: zlib-devel -BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRequires: cmake(double-conversion) +BuildRequires: pkgconfig(eigen3) +BuildRequires: pkgconfig(expat) +BuildRequires: pkgconfig(fftw3) +BuildRequires: pkgconfig(libjpeg) +BuildRequires: pkgconfig(libpng) +BuildRequires: pkgconfig(libtiff-4) +BuildRequires: pkgconfig(libxml-2.0) +BuildRequires: pkgconfig(zlib) %description ITK is a suite of software tools for image analysis. @@ -70,11 +74,11 @@ ITK is a suite of software tools for image analysis. %package devel Summary: Development files for ITK Group: Development/Libraries/C and C++ +Requires: %{libname} = %{version} Requires: dcmtk-devel Requires: fftw3-devel Requires: fftw3-threads-devel Requires: hdf5-devel -Requires: lib%{name}4 = %{version} Requires: libexpat-devel Requires: libjpeg-devel Requires: libpng-devel @@ -87,93 +91,77 @@ Provides: lib%{name}-devel Development files for the ITK library. ITK is a suite of software tools for image analysis. -%package -n lib%{name}4 +%package -n %{libname} Summary: Insight Segmentation and Registration Toolkit Group: System/Libraries -%description -n lib%{name}4 +%description -n %{libname} Shared ITK library. ITK is a suite of software tools for image analysis. +%package -n python3-itk +Summary: Python bindings for itk +Group: Development/Libraries/C and C++ + +%description -n python3-itk +ITK is a suite of software tools for image analysis. This package provides the python3 bindings for ITK. + %prep %setup -q -n %{tarname}-%{version} %patch0 -p1 %patch1 -p1 -%patch2 -p1 %patch3 -p1 %build +%limit_build -m 2000 +# HAS TROUBLE LOCATING gdcm INCLUDEDIRS, ADD IT TO CXXFLAGS +export CXXFLAGS+=" -I%{_includedir}/gdcm/" + %cmake \ + -DITK_INSTALL_LIBRARY_DIR:PATH=%{_lib}/ \ + -DITK_INSTALL_INCLUDE_DIR:PATH=include/%{name}/ \ + -DITK_INSTALL_PACKAGE_DIR:PATH=%{_lib}/cmake/%{name}/ \ + -DITK_INSTALL_RUNTIME_DIR:PATH=%{_bindir} \ + -DITK_INSTALL_DOC_DIR=share/doc/packages/%{name}/ \ -DBUILD_EXAMPLES:BOOL=ON \ -DBUILD_SHARED_LIBS:BOOL=ON \ -DBUILD_TESTING:BOOL=OFF \ -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON \ - -DUSE_FFTWF=ON \ -DITK_USE_FFTWD:BOOL=ON \ -DITK_USE_FFTWF:BOOL=ON \ - -DITK_USE_SYSTEM_FFTW:BOOL=ON \ + -DITK_USE_SYSTEM_LIBRARIES:BOOL=ON \ + -DITK_USE_SYSTEM_GDCM:BOOL=ON \ + -DITK_USE_SYSTEM_CASTXML:BOOL=ON \ -DITK_USE_STRICT_CONCEPT_CHECKING:BOOL=ON \ - -DITK_USE_SYSTEM_DOUBLECONVERSION:BOOL=OFF \ - -DITK_USE_SYSTEM_DCMTK:BOOL=ON \ - -DITK_USE_SYSTEM_GDCM:BOOL=OFF \ - -DITK_USE_SYSTEM_HDF5:BOOL=ON \ - -DITK_USE_SYSTEM_JPEG:BOOL=ON \ - -DITK_USE_SYSTEM_PNG:BOOL=ON \ - -DITK_USE_SYSTEM_TIFF:BOOL=ON \ -DITK_USE_SYSTEM_VXL:BOOL=OFF \ - -DITK_USE_SYSTEM_ZLIB:BOOL=ON \ - -DITK_USE_SYSTEM_EXPAT:BOOL=ON \ - -DModule_ITKDCMTK:BOOL=ON \ - -DModule_ITKIOPhilipsREC:BOOL=OFF \ - -DModule_ITKLevelSetsv4Visualization:BOOL=OFF \ - -DModule_ITKReview:BOOL=OFF \ - -DModule_ITKVideoBridgeOpenCV:BOOL=OFF \ - -DModule_ITKVideoBridgeVXL:BOOL=OFF \ - -DModule_ITKVtkGlue:BOOL=OFF \ - -DModule_ITKDeprecated:BOOL=OFF \ - -DITKV3_COMPATIBILITY:BOOL=ON \ -DVCL_INCLUDE_CXX_0X:BOOL=ON \ -DITK_WRAPPING:BOOL=OFF \ - -DITK_WRAP_PYTHON:BOOL=OFF \ - -DCMAKE_BUILD_TYPE:STRING="Release" - -make VERBOSE=1 %{?_smp_mflags} + -DITK_FORBID_DOWNLOADS=ON \ + -DITK_WRAP_PYTHON:BOOL=ON +%cmake_build %install %cmake_install -%if "%{_lib}" == "lib64" -mkdir -p %{buildroot}%{_libdir} -mv %{buildroot}%{_libexecdir}/* %{buildroot}%{_libdir}/ -sed -i 's|/lib/|/lib64/|g' %{buildroot}%{_libdir}/cmake/ITK-%{baseversion}/ITKConfig.cmake -sed -i 's|/lib/|/lib64/|g' %{buildroot}%{_libdir}/cmake/ITK-%{baseversion}/ITKTargets.cmake -sed -i 's|/lib/|/lib64/|g' %{buildroot}%{_libdir}/cmake/ITK-%{baseversion}/ITKTargets-release.cmake -%endif -rm -rf %{buildroot}%{_libexecdir}/debug -# move files to a proper place -mv %{buildroot}%{_libdir}/*itk*.cmake %{buildroot}%{_libdir}/cmake/ -# remove openjp2 file installation -rm -rf %{buildroot}/%{_includedir}/gdcmopenjpeg %{buildroot}%{_libdir}/gdcmopenjpeg-* %{buildroot}%{_libdir}/pkgconfig/libopenjp2.pc -rmdir %{buildroot}%{_libdir}/pkgconfig - %fdupes %{buildroot}/%{_prefix} -%post -n lib%{name}4 -p /sbin/ldconfig +%post -n %{libname} -p /sbin/ldconfig +%postun -n %{libname} -p /sbin/ldconfig -%postun -n lib%{name}4 -p /sbin/ldconfig - -%files -n lib%{name}4 -%defattr(644,root,root,755) +%files -n %{libname} %license LICENSE %{_libdir}/*.so.1 %files devel -%defattr(-,root,root,-) -%{_includedir}/* +%{_includedir}/%{name}/ %{_libdir}/lib*.so %{_libdir}/cmake/ %{_bindir}/itkTestDriver -%{_datadir}/* +%doc %{_docdir}/%{name}/ + +%files -n python3-itk +%{python3_sitearch}/*.py +%{python3_sitearch}/itk/ %changelog