| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
VER_MAJOR = 5 |
| 4 |
VER_MINOR = 4 |
| 5 |
VER_REVISION = 6 |
| 6 |
VERSION = $(VER_MAJOR).$(VER_MINOR).$(VER_REVISION) |
| 7 |
SOVERSION = $(VER_MAJOR).$(VER_MINOR) |
| 8 |
|
| 9 |
#ITK is not properly using system provided headers |
| 10 |
export DEB_CPPFLAGS_MAINT_APPEND = -I/usr/include/nifti -g1 |
| 11 |
|
| 12 |
ENABLE_FFTW=ON |
| 13 |
ENABLE_UNSIGNED_LONG_LONG=ON |
| 14 |
|
| 15 |
ifeq ($(DEB_HOST_ARCH),i386) |
| 16 |
ENABLE_FFTW=OFF |
| 17 |
#(unsigned long) == (unsigned int) on 32 bit, since itk 4.10 or g++-5.4 |
| 18 |
ENABLE_UNSIGNED_LONG_LONG=OFF |
| 19 |
DEB_CMAKEFLAGS_MAINT_APPEND = -DITK_COMPUTER_MEMORY_SIZE=2 |
| 20 |
# Tests are permanently failing, try force rounding to normal double |
| 21 |
# accuracy |
| 22 |
export DEB_CXXFLAGS_MAINT_APPEND=-ffloat-store |
| 23 |
endif |
| 24 |
|
| 25 |
CMAKE_FLAGS = \ |
| 26 |
-DBUILD_EXAMPLES:BOOL=ON \ |
| 27 |
-DBUILD_SHARED_LIBS:BOOL=ON \ |
| 28 |
-DBUILD_TESTING:BOOL=ON \ |
| 29 |
-DExternalData_OBJECT_STORES:PATH=$(CURDIR)/data/.ExternalData/ \ |
| 30 |
-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON \ |
| 31 |
-DCMAKE_SKIP_INSTALL_RPATH:BOOL=ON \ |
| 32 |
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ |
| 33 |
-DUSE_FFTWF=$(ENABLE_FFTW) \ |
| 34 |
-DITK_FORBID_DOWNLOADS:BOOL=ON \ |
| 35 |
-DITK_USE_FFTWD:BOOL=$(ENABLE_FFTW) \ |
| 36 |
-DITK_USE_FFTWF:BOOL=$(ENABLE_FFTW) \ |
| 37 |
-DITK_USE_SYSTEM_DCMTK:BOOL=ON \ |
| 38 |
-DITK_USE_SYSTEM_DOUBLECONVERSION:BOOL=OFF \ |
| 39 |
-DITK_USE_SYSTEM_EXPAT:BOOL=ON \ |
| 40 |
-DITK_USE_SYSTEM_FFTW:BOOL=$(ENABLE_FFTW) \ |
| 41 |
-DITK_USE_SYSTEM_GDCM:BOOL=ON \ |
| 42 |
-DITK_USE_SYSTEM_GOOGLETEST:BOOL=ON \ |
| 43 |
-DGTEST_SRC=/usr/src/googletest/googletest \ |
| 44 |
-DITK_USE_SYSTEM_MINC:BOOL=ON \ |
| 45 |
-DITK_USE_SYSTEM_HDF5:BOOL=ON \ |
| 46 |
-DITK_USE_SYSTEM_JPEG:BOOL=ON \ |
| 47 |
-DITK_USE_SYSTEM_PNG:BOOL=ON \ |
| 48 |
-DITK_USE_SYSTEM_TIFF:BOOL=OFF \ |
| 49 |
-DITK_USE_SYSTEM_VXL:BOOL=OFF \ |
| 50 |
-DITK_USE_SYSTEM_ZLIB:BOOL=ON \ |
| 51 |
-DITK_USE_KWSTYLE:BOOL=OFF \ |
| 52 |
-DModule_ITKDCMTK:BOOL=ON \ |
| 53 |
-DModule_ITKIOPhilipsREC:BOOL=OFF \ |
| 54 |
-DModule_ITKLevelSetsv4Visualization:BOOL=OFF \ |
| 55 |
-DModule_BridgeNumPy:BOOL=OFF \ |
| 56 |
-DModule_ITKVideoBridgeOpenCV:BOOL=OFF \ |
| 57 |
-DModule_ITKVideoBridgeVXL:BOOL=OFF \ |
| 58 |
-DModule_ITKVtkGlue:BOOL=ON \ |
| 59 |
-DModule_ITKReview:BOOL=ON \ |
| 60 |
-DVCL_INCLUDE_CXX_0X:BOOL=ON \ |
| 61 |
-DITK_USE_SYSTEM_SWIG:BOOL=ON \ |
| 62 |
-DITK_USE_SYSTEM_CASTXML:BOOL=ON \ |
| 63 |
-DITK_WRAP_IMAGE_DIMS="2;3" \ |
| 64 |
-DITK_WRAP_unsigned_long_long:BOOL=$(ENABLE_UNSIGNED_LONG_LONG) \ |
| 65 |
-DITK_WRAP_double:BOOL=ON \ |
| 66 |
-DITK_WRAP_vector_double:BOOL=ON \ |
| 67 |
-DITK_WRAP_covariant_vector_double:BOOL=ON \ |
| 68 |
-DITK_WRAP_complex_double:BOOL=ON \ |
| 69 |
-DITK_COMPUTER_MEMORY_SIZE:STRING="2" \ |
| 70 |
$(DEB_CMAKEFLAGS_MAINT_APPEND) |
| 71 |
|
| 72 |
pkg_lib = libinsighttoolkit$(SOVERSION) |
| 73 |
pkg_dev = libinsighttoolkit$(VER_MAJOR)-dev |
| 74 |
pkg_examples = insighttoolkit$(VER_MAJOR)-examples |
| 75 |
|
| 76 |
|
| 77 |
%: |
| 78 |
dh $@ --builddir=BUILD |
| 79 |
|
| 80 |
override_dh_auto_configure-indep: |
| 81 |
|
| 82 |
override_dh_auto_configure-arch: pre-build |
| 83 |
dh_auto_configure -- $(CMAKE_FLAGS) |
| 84 |
|
| 85 |
override_dh_auto_build-indep: |
| 86 |
|
| 87 |
pre-build: |
| 88 |
echo "Available disk space (~50GB of space is needed for the build):" |
| 89 |
df -h . |
| 90 |
|
| 91 |
override_dh_auto_test-indep: |
| 92 |
|
| 93 |
override_dh_auto_test: |
| 94 |
LD_LIBRARY_PATH=`pwd`/BUILD/lib:`pwd`/BUILD/Testing/Temporary ARGS="--label-exclude REQUIRES_DISPLAY" dh_auto_test || \ |
| 95 |
( echo "Test log begin =========:" \ |
| 96 |
&& cat `pwd`/BUILD/Testing/Temporary/LastTest.log \ |
| 97 |
&& echo "Test log end =========:" \ |
| 98 |
&& exit 1 ) |
| 99 |
|
| 100 |
override_dh_lintian: |
| 101 |
echo "#ITK embeds various patched libraries" > debian/$(pkg_lib).lintian-overrides |
| 102 |
echo "$(pkg_lib): embedded-library" > debian/$(pkg_lib).lintian-overrides |
| 103 |
echo "$(pkg_lib): package-name-doesnt-match-sonames" >> debian/$(pkg_lib).lintian-overrides |
| 104 |
echo "$(pkg_lib): shared-library-lacks-prerequisites" >> debian/$(pkg_lib).lintian-overrides |
| 105 |
echo "${pkg_dev}: no-manual-page [usr/bin/itkTestDriver]" > debian/$(pkg_dev).lintian-overrides |
| 106 |
dh_lintian |
| 107 |
|
| 108 |
override_dh_install-indep: |
| 109 |
|
| 110 |
override_dh_install-arch: |
| 111 |
# pkg_lib |
| 112 |
dh_install -p$(pkg_lib) --autodest -XJava -XPython -XTcl debian/tmp/usr/lib/*/lib*.so.* |
| 113 |
cp CMake/InsightValgrind.supp Insight$(SOVERSION)Valgrind.supp |
| 114 |
# cp Modules/ThirdParty/VNL/src/vxl/config/valgrind.supp Insight$(SOVERSION)VxlValgrind.supp |
| 115 |
dh_install -p$(pkg_lib) Insight$(SOVERSION)*.supp usr/lib/valgrind |
| 116 |
# |
| 117 |
# pkg_dev |
| 118 |
dh_installman -p$(pkg_dev) debian/insighttoolkit.3 |
| 119 |
dh_install -p$(pkg_dev) --autodest -XJava -XPython -XTcl debian/tmp/usr/lib/*/lib*.so |
| 120 |
dh_install -p$(pkg_dev) --autodest debian/tmp/usr/include/ITK-$(SOVERSION)/* |
| 121 |
# The itkTestDriver seems to be required due to references in /usr/lib/cmake files; c.f. Bug #700723 |
| 122 |
dh_install -p$(pkg_dev) --autodest debian/tmp/usr/bin/itkTestDriver |
| 123 |
|
| 124 |
dh_install -p$(pkg_dev) --autodest debian/tmp/usr/lib/*/cmake |
| 125 |
# remove build directory to save space |
| 126 |
rm -rf BUILD debian/tmp |
| 127 |
|
| 128 |
override_dh_installexamples: |
| 129 |
# pkg_examples |
| 130 |
dh_installexamples -p$(pkg_examples) Examples/* |
| 131 |
ifneq (,$(filter $(pkg_examples), $(shell dh_listpackages))) |
| 132 |
find debian/$(pkg_examples)/usr/share/doc/$(pkg_examples)/examples \ |
| 133 |
-type f -print0 | xargs -0 chmod 644 |
| 134 |
endif |
| 135 |
|
| 136 |
override_dh_clean: |
| 137 |
# Modules/ThirdParty/pygccxml/src/pygccxml leaves build artifacts around |
| 138 |
find Modules/ThirdParty/pygccxml/src -name __pycache__ -execdir rm -r '{}' + |
| 139 |
dh_clean |
| 140 |
|
| 141 |
|
| 142 |
# The Debian source tarball is created by combining the upstream source and data tarballs |
| 143 |
# This was done manually: |
| 144 |
# |
| 145 |
# 1. Download manually: |
| 146 |
# a. wget https://github.com/InsightSoftwareConsortium/ITK/releases/download/v5.4.6/InsightToolkit-5.4.6.tar.gz |
| 147 |
# b. wget https://github.com/InsightSoftwareConsortium/ITK/releases/download/v5.4.6/InsightData-5.4.6.tar.gz |
| 148 |
# |
| 149 |
# 2. Extract & create new merged source tarball (in tarballs): |
| 150 |
# tar xzf InsightToolkit-5.4.6.tar.gz |
| 151 |
# tar xzf InsightData-5.4.6.tar.gz |
| 152 |
# tar --xz -cf insighttoolkit5_5.4.6.orig.tar.xz InsightToolkit-5.4.6 |
| 153 |
# |
| 154 |
# 3. Import into GIT |
| 155 |
# gbp import-orig --pristine-tar ../tarballs/insighttoolkit5_5.4.6.orig.tar.xz |