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
|
#!/usr/bin/make -f
# export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
UPSTREAMVERS = $(shell dpkg-parsechangelog | sed -n 's/^Version: \([^+~]*\).*$$/\1/p')
export QT_SELECT = qt5
%:
dh $@
override_dh_auto_configure:
dh_auto_configure -- VERSION=$(UPSTREAMVERS) CONFIG-=debug CONFIG+=qopenglwidget
override_dh_auto_build:
dh_auto_build
# not run in dh_auto_configure stage, as it requires the openscad binary to be already built
dh_auto_configure -Dtests
# is cgalcachetest only required in out-of-tree builds?
dh_auto_build -Dtests -Scmake -- csgtexttest cgalcachetest
# fix absolute paths in ctest scripts (relative paths will work during
# the build time tests, and are catered for by the openscad-testrun
# script).
#
# note that often, a `../openscad` reference remains. this is left in
# place, as not all tools involved honor $PATH (eg. because they do an
# explicit `os.path.exists` on their openscad binary).
cd obj-* && perl -i.bak -npe 'use Cwd; my $$here = getcwd(); s/\Q$$here\E/./g' *.cmake
perl -i.bak -npe 'use Cwd; my $$here = getcwd(); s/\Q$$here\/tests\E/./g' obj-*/*.cmake
override_dh_auto_test:
# workaround to have the test suite usable out-of-tree. FIXME introduce
# a fix for upstream that makes ctest also work with out-of-tree
# building.
cd obj-* && ln -s ../tests/* -t. || echo "Some files are expected to already be present."
# OPENSCADPATH has to be set because the default library dir is
# determined based on the openscad binary's path (will be ok after
# installation).
#
# clearing DISPLAY is not strictly necessary here as this is already
# done by the build environment (at least by gbp buildpackage), but it
# makes it clear that the intent is to always render the build-time
# tests in software.
#
# as for the tests excluded with --exclude-regex, see README.testsuite.
DISPLAY= OPENSCADPATH=/usr/share/openscad/libraries dh_auto_test -Dtests -Scmake -- ARGS+="--exclude-regex issue1165\\|issue1215\\|throwntogethertest_issue1089\\|openscad-cameyeortho_camera-tests\\|openscad-cameyeortho-viewall_camera-tests" || ( echo '---- content of ' obj-*/Testing/Temporary/*_report.html ' ----'; cat obj-*/Testing/Temporary/*_report.html; echo; echo '---- end content ----'; exit 0)
override_dh_auto_install:
# fix absolute paths in generated scad files. this step logically
# belongs to the similar lines in the dh_auto_build override, but can
# first be done here becaus for the build time tests, the original
# paths are still required.
find testdata -name \*.scad -exec perl -i.bak -npe 'use Cwd; my $$here = getcwd(); s[\Q$$here\E/tests/../testdata][/usr/share/openscad/testdata]g' {} +
dh_auto_install --destdir=debian/openscad
# don't ship mcad, neither the empty directory (when this is built from
# a normal git source checkout) nor the full library (when this is
# built from a git checkout with submodules or from a tarball). mcad
# gets its own package.
rm -rf debian/openscad/usr/share/openscad/libraries
# remove fonts
rm -rf debian/openscad/usr/share/openscad/fonts
override_dh_install:
dh_install -Xtestdata/ttf/liberation-2.00.1/LICENSE
override_dh_strip:
dh_strip --dbg-package openscad-dbg
override_dh_auto_clean:
dh_auto_clean
dh_auto_clean -Dtests -Scmake
|