1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
#!/usr/bin/make -f
include /usr/share/dpkg/pkg-info.mk # To access the "DEB_VERSION" variable
export JAVASCRIPT_LIBS := Build/javascript-libs
export UPSTREAM_VERSION := $(shell echo "$(DEB_VERSION)" | cut -d '+' -f 1)
export TARGET := libOrthancWebViewer.so
export DEB_BUILD_MAINT_OPTIONS := hardening=+all
# Disable assert() checking from upstream project, for best performance
# https://lists.debian.org/debian-med/2018/04/msg00132.html
export DEB_CFLAGS_MAINT_APPEND=-DNDEBUG
export DEB_CXXFLAGS_MAINT_APPEND=-DNDEBUG
%:
dh $@ --builddirectory=Build
CMAKE_EXTRA_FLAGS += \
-DCMAKE_SKIP_RPATH:BOOL=ON \
-DSTATIC_BUILD:BOOL=OFF \
-DSTANDALONE_BUILD:BOOL=ON \
-DORTHANC_FRAMEWORK_SOURCE:STRING=system \
-DUSE_GOOGLE_TEST_DEBIAN_PACKAGE:BOOL=ON \
-DORTHANC_FRAMEWORK_USE_SHARED:BOOL=OFF \
"-DORTHANC_FRAMEWORK_ADDITIONAL_LIBRARIES=boost_filesystem boost_iostreams boost_locale boost_regex boost_thread jsoncpp pugixml uuid sqlite3 dcmdata ofstd dcmjpeg dcmjpls dcmimage" \
-DCMAKE_BUILD_TYPE=None # The build type must be set to None, see #711515
# Automated generation of the "Built-Using" attribute in "d/control"
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=989127
# Adapted from:
# https://wiki.debian.org/SIMDEverywhere#Approach (Point 6)
override_dh_gencontrol:
dh_gencontrol -- -Vorthancframework:Built-Using="$(shell dpkg-query -f '$${source:Package} (= $${source:Version}), ' -W liborthancframework-dev)"
override_dh_auto_configure:
# Place the third-party JavaScript libraries at the location
# expected by CMake
mkdir -p ${JAVASCRIPT_LIBS}/fonts
mkdir -p ${JAVASCRIPT_LIBS}/images
# Use the jquery library from Debian
cp /usr/share/javascript/jquery/jquery.min.js ${JAVASCRIPT_LIBS}/jquery.js
# The jsPanel-2.3.3 toolbox used in the Orthanc Web viewer is
# not compatible with the version of the "jquery-ui" package
# shipped with Debian. We need to force the version of jquery-ui.
yui-compressor debian/JS/jquery-ui-1.11.3/jquery-ui.js > \
${JAVASCRIPT_LIBS}/jquery-ui.min.js
yui-compressor debian/JS/jquery-ui-1.11.3/jquery-ui.css > \
${JAVASCRIPT_LIBS}/jquery-ui.min.css
yui-compressor debian/JS/jquery-ui-1.11.3/jquery-ui.theme.css > \
${JAVASCRIPT_LIBS}/jquery-ui.theme.min.css
cp debian/JS/jquery-ui-1.11.3/images/* ${JAVASCRIPT_LIBS}/images
# Note: We don't minify the Cornerstone library, as the
# version of yui-compressor shipped by Debian Sid crashes on it
cp debian/JS/cornerstone-0.11.0/cornerstone.js \
${JAVASCRIPT_LIBS}/cornerstone.min.js
cp debian/JS/cornerstone-0.11.0/cornerstone.css \
${JAVASCRIPT_LIBS}/cornerstone.css
yui-compressor debian/JS/jsPanel-2.3.3/jquery.jspanel.js > \
${JAVASCRIPT_LIBS}/jquery.jspanel.min.js
yui-compressor debian/JS/jsPanel-2.3.3/jquery.jspanel.css > \
${JAVASCRIPT_LIBS}/jquery.jspanel.min.css
yui-compressor debian/JS/jsPanel-2.3.3/jquery.ui.touch-punch.js > \
${JAVASCRIPT_LIBS}/jquery.ui.touch-punch.min.js
yui-compressor debian/JS/jsPanel-2.3.3/mobile-detect.js > \
${JAVASCRIPT_LIBS}/mobile-detect.min.js
cp debian/JS/jsPanel-2.3.3/images/* ${JAVASCRIPT_LIBS}/images/
cp debian/JS/jsPanel-2.3.3/fonts/* ${JAVASCRIPT_LIBS}/fonts/
yui-compressor debian/JS/js-url-1.8.6/url.js > \
${JAVASCRIPT_LIBS}/url.min.js
yui-compressor debian/JS/pako-0.2.5/pako_inflate.js > \
${JAVASCRIPT_LIBS}/pako_inflate.min.js
# Launch the original CMake script
dh_auto_configure -- $(CMAKE_EXTRA_FLAGS)
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
( cd Build; ./UnitTests )
endif
override_dh_auto_install:
dh_install Build/${TARGET}.${UPSTREAM_VERSION} usr/lib/orthanc
override_dh_link:
dh_link usr/lib/orthanc/${TARGET}.${UPSTREAM_VERSION} usr/share/orthanc/plugins/${TARGET}
override_dh_installchangelogs:
dh_installchangelogs -k NEWS
|