#!/usr/bin/make -f # -*- mode: makefile; coding: utf-8 -*- # Copyright © 2015-2021 IOhannes m zmölnig # Description: Main Debian packaging script for JUCE export DH_VERBOSE = 1 export DEB_BUILD_MAINT_OPTIONS = hardening=+all export DEB_CPPFLAGS_MAINT_APPEND = export DEB_CXXFLAGS_MAINT_APPEND = export DEB_LDFLAGS_MAINT_APPEND = DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/default.mk include /usr/share/dpkg/buildtools.mk include /usr/share/dpkg/architecture.mk DEBIAN_BUILD_ARTIFACTS = debian/artifacts # JUCE uses some c++11 features requiring atomic_store_8 and # atomic_load_8, so we need to link with libatomic on # armel, powerpc, powerpcspe, m68k, mips, mipsel, sh4, ... # see also: # - https://gcc.gnu.org/wiki/Atomic # - https://gcc.gnu.org/wiki/Atomic/GCCMM/LIbrary # - the 'clasp' packaging # link with libatomic on architectures without built-in atomic ifneq ($(strip $(filter $(DEB_HOST_ARCH), armel powerpc powerpcspe m68k mips mipsel sh4 riscv64)),) DEB_CPPFLAGS_MAINT_APPEND += -DDEBIAN_JUCERPROJECT_LIBS='"atomic"' DEB_LDFLAGS_MAINT_APPEND += -latomic endif # PowerPC by default uses a weird ibm128 'long double' ifneq ($(strip $(filter $(DEB_HOST_ARCH), powerpc powerpcspe ppc64 ppc64el)),) DEB_CPPFLAGS_MAINT_APPEND += -mabi=ieeelongdouble endif # we got too many symbols for MIPS, so we need to enablea workaround... ifneq ($(strip $(filter $(DEB_HOST_ARCH), mipsel mips64el)),) DEB_CXXFLAGS_MAINT_APPEND += -mxgot endif # Debian's Projucer is GPL DEB_CPPFLAGS_MAINT_APPEND += -DJUCER_ENABLE_GPL_MODE=1 %: dh $@ $(BUILD_PACKAGES) override_dh_auto_configure: dh_auto_configure -- \ -DJUCE_BUILD_EXTRAS=ON \ -DJUCE_TOOL_INSTALL_DIR=bin \ -DJUCE_MODULE_PATH=share/juce/modules \ $(empty) override_dh_auto_build-arch: dh_auto_build -- Projucer juce_lv2_helper juce_vst3_helper mkdir -p $(DEBIAN_BUILD_ARTIFACTS) cp $(CURDIR)/examples/Assets/juce_icon.png \ $(DEBIAN_BUILD_ARTIFACTS)/juce.png override_dh_auto_build-indep: dh_auto_build -- juce_lv2_helper juce_vst3_helper mkdir -p docs/doxygen/build cp docs/JUCE*.md docs/CMake*.md docs/doxygen/build/ ifeq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS))) make -C docs/doxygen endif execute_after_dh_install-arch: -find $(CURDIR)/debian/juce-modules-source/ \ -type f -name "LV2_HELPER*.cmake" -exec \ sed -e 's|"[^"]*/juce_lv2_helper"|"/usr/lib/@DEB_HOST_MULTIARCH@/juce/juce_lv2_helper"|' -e "s|@DEB_HOST_MULTIARCH@|$(DEB_HOST_MULTIARCH)|" -i {} + -find $(CURDIR)/debian/juce-modules-source/ \ -type f -name "JUCEConfig.cmake" -exec \ sed -e 's|"[^"]*/bin/juceaide"|"/usr/lib/@DEB_HOST_MULTIARCH@/juce/juceaide"|' -e "s|@DEB_HOST_MULTIARCH@|$(DEB_HOST_MULTIARCH)|" -i {} + override_dh_install-indep: dh_install --indep -X.tag -find $(CURDIR)/debian/juce-modules-source-data/usr/share/juce \ -type f -executable \ '(' -name "*.h" -or -name "*.cpp" ')' \ -exec chmod -c 0644 {} + override_dh_installdocs-indep: dh_installdocs -plibjuce-doc --doc-main-package=juce-modules-source dh_installdocs --remaining-packages ifneq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS))) override_dh_doxygen: endif override_dh_installchangelogs: dh_installchangelogs CHANGE_LIST.md #DEB_COPYRIGHT_CHECK_IGNORE_REGEX = \ #^((.*\.jpg)|(.*\.JPG)|(.*\.gif)|(.*\.png)|(.*\.ico)|(.*\.icns)|(gradle-wrapper\.jar)|(.*\.mp3)|(.*\.caf)|(.*\.nib)|examples/InAppPurchase/Signing/InAppPurchase\.keystore|examples/(InAppPurchase/BinaryData/(Robot|Ed|Jules|JB|Fabian|Lukasz)[012]\.ogg|AUv3Synth|PlugInSamples/MultiOutSynth)/Source/BinaryData/singing\.ogg|examples/Demo/Resources/cello\.wav|examples/Demo/Resources/icons\.zip|modules/juce_audio_plugin_client/RTAS/juce_RTAS_WinResources\.rsr|examples/ComponentTutorialExample/Introduction to Components - Part 1\.pdf|debian/(changelog|copyright(|_hints|_newhints)))$ DEB_COPYRIGHT_CHECK_IGNORE_REGEX = \ debian/.*|.*\.gif|.*\.jpg|.*\.JPG|.*\.png|.*\.ico|.*\.icns|.*\.wav|.*\.caf|.*\.ogg|.*\.mp3|.*\.pdf|.*\.keystore|.*\.nib|.*/gradle-wrapper\.jar|.*\.zip # licensecheck v1 .PHONY: licensecheck licensecheck: LANG=C.UTF-8 licensecheck \ -i "^($(DEB_COPYRIGHT_CHECK_IGNORE_REGEX))$$" \ --check '.*' --recursive --deb-machine --lines 0 * \ > debian/copyright_newhints cmp debian/copyright_hints debian/copyright_newhints \ && rm debian/copyright_newhints