File: rules

package info (click to toggle)
giada 0.22.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,068 kB
  • sloc: cpp: 27,752; sh: 101; xml: 57; makefile: 55; ansic: 12
file content (82 lines) | stat: -rwxr-xr-x 3,208 bytes parent folder | download
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
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# see ENVIRONMENT in dpkg-buildflags(1)
export DEB_CPPFLAGS_MAINT_APPEND =
export DEB_CXXFLAGS_MAINT_APPEND =
export DEB_LDFLAGS_MAINT_APPEND =

# workaround for an FST bug
DEB_CPPFLAGS_MAINT_APPEND += -D_fstEffect=AEffect

DATE_FMT = %Y-%m-%d
ifdef SOURCE_DATE_EPOCH
    BUILD_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)"  2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)" 2>/dev/null || date -u "+$(DATE_FMT)")
else
    BUILD_DATE ?= $(shell date "+$(DATE_FMT)")
endif

JUCE_VERSION := $(shell dpkg-query --show --showformat='$${source:Version}' juce-modules-source)
pkglibs = libjpeg libpng libcurl rtaudio

DEB_CPPFLAGS_MAINT_APPEND += -DBUILD_DATE='"$(BUILD_DATE)"' -DTEST_RESOURCES_DIR='"tests/resources/"'
DEB_CXXFLAGS_MAINT_APPEND += -std=c++17 -Wno-error -Wno-error=format-security
DEB_CXXFLAGS_MAINT_APPEND += $(shell pkg-config --cflags $(pkglibs))
DEB_LDFLAGS_MAINT_APPEND  += $(shell pkg-config --libs $(pkglibs))

# JUCE (used by giada) 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
noatomicarch = $(shell dpkg-architecture -qDEB_HOST_ARCH | egrep -x "(armel|powerpc|powerpcspe|m68k|mips|mipsel|sh4|riscv64)")
# link with libatomic on architectures without built-in atomic
ifeq ($(if $(noatomicarch),atomic), atomic)
	DEB_LDFLAGS_MAINT_APPEND += -latomic
endif

%:
	dh $@

execute_before_dh_auto_configure:
	for d in $(notdir $(patsubst %/,%,$(wildcard debian/missing-sources/mcl-*/))); do \
		mkdir -p src/deps/$$d/src/; \
		cp debian/missing-sources/$$d/* src/deps/$$d/src/; \
	done
	cp -ra /usr/share/juce src/deps/
	# patch around some bugs in FST
	sed -e 's|\(.*t_fstTimeInfo.smpteFrameRate.*\)|};\ntypedef enum {\1|' -e 's|\(.*SmpteFilm35mm.*\)|\1 } VstSmpteFrameRate;\nenum {dummy_enum|' /usr/include/pluginterfaces/fst/fst.h > src/deps/juce/modules/juce_audio_processors/format_types/fst.h
	sed -e 's|<pluginterfaces/fst/fst.h>|"fst.h"|' -i src/deps/juce/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp
override_dh_auto_configure:
	dh_auto_configure -- \
		-DWITH_VST2=ON \
		$(empty)

override_dh_auto_test:
	HOME=/tmp xvfb-run -a dh_auto_test -a || (grep . test-suite.log giada_test.log; false)

execute_after_dh_clean:
	test -e src/deps/rtaudio-mode/Makefile && make -C src/deps/rtaudio-mod/ distclean || true
	for d in $(notdir $(patsubst %/,%,$(wildcard debian/missing-sources/mcl-*/))); do \
		rm -rf src/deps/$$d; \
	done
	rm -rf src/deps/juce/

override_dh_installchangelogs:
	dh_installchangelogs ChangeLog

override_dh_gencontrol:
	dh_gencontrol -- \
                -Vjuce:BuiltUsing="juce ( = $(JUCE_VERSION) )"


DEB_COPYRIGHT_CHECK_IGNORE_REGEX = \
	\.pc/.*|\.git/.*|debian/.*|.*\.png

licensecheck:
	licensecheck -i "^\./($(DEB_COPYRIGHT_CHECK_IGNORE_REGEX))$$" --deb-machine -r . \
		> debian/copyright_newhints
	cmp debian/copyright_hints debian/copyright_newhints \
		&& rm debian/copyright_newhints