#!/usr/bin/make -f # -*- makefile -*- # Documentation: https://www.debian.org/doc/debian-policy/ch-source.html#main-building-script-debian-rules # Build flags are passed in from the SConscript. The following line is replaced # via exact-string matching so do not change it! MIXXX_SCONS_FLAGS = "" # If ARCH is set to a different architecture when running pbuilder, pbuilder # will be set to create an environment to build packages for the architecture # specified in ARCH. ifneq (,$(findstring i386,$(ARCH))) MIXXX_SCONS_FLAGS += machine=x86 endif ifneq (,$(findstring amd64,$(ARCH))) MIXXX_SCONS_FLAGS += machine=x86_64 endif # parallel builds for scons ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) MIXXX_SCONS_FLAGS += -j$(NUMJOBS) endif ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) MIXXX_SCONS_FLAGS += test=1 endif MIXXX_SCONS_FLAGS += prefix=/usr MIXXX_SCONS_FLAGS += install_root=$(CURDIR)/debian/tmp/usr %: dh $@ --parallel # dh_auto_configure will attempt to run cmake instead of scons # nothing needs to be done for the configure step; scons is run in the build step below override_dh_auto_configure: : override_dh_auto_build: scons $(MIXXX_SCONS_FLAGS) docbook-to-man debian/mixxx.sgml > mixxx.1 override_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) xvfb-run -- ./mixxx-test --gtest_output=xml:test_results.xml endif override_dh_auto_clean: scons $(MIXXX_SCONS_FLAGS) -c || true rm -rf .sconf_temp/ cache/ lin*_build/ dh_clean .sconsign.dblite cachecustom.py \ config.log src/build.h build/*.pyc mixxx.1 lib/*/lib/*.a dh_auto_clean override_dh_auto_install: scons $(MIXXX_SCONS_FLAGS) install mkdir $(CURDIR)/debian/tmp/usr/share/mixxx-test cp test_results.xml $(CURDIR)/debian/tmp/usr/share/mixxx-test/ cp mixxx-test $(CURDIR)/debian/tmp/usr/bin find $(CURDIR)/debian/tmp \( -name COPYING -o -name Thumbs.db \ -o -name shifter.sh -o -name '*.xsl' -o -name '*.php' \) \ -exec rm -f {} \; find $(CURDIR)/debian/tmp -name '*.js' -exec chmod -x {} \; find $(CURDIR)/debian/tmp/usr/share/mixxx/ -type f -exec chmod -x {} \; override_dh_gencontrol: dh_gencontrol -- $(SUBSTVARS)