File: rules

package info (click to toggle)
giada 0.16.2.2%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,080 kB
  • sloc: cpp: 35,706; sh: 1,056; makefile: 453; ansic: 1
file content (62 lines) | stat: -rwxr-xr-x 1,954 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
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

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)

CPPFLAGS+=-DBUILD_DATE='"$(BUILD_DATE)"'
CXXFLAGS+=-std=c++14 -Wno-error
LIBS=$(shell pkg-config --libs libjpeg libpng libcurl)

# 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)
	LIBS += -latomic
endif

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- \
		--enable-vst \
		--enable-system-catch \
		--target=linux \
		LIBS="$(LIBS)"

override_dh_auto_build:
	cp -rav /usr/share/juce src/deps/
	dh_auto_build
override_dh_auto_test:
	@echo home: $(HOME)
	HOME=/tmp xvfb-run -a dh_auto_test -a || (grep . test-suite.log giada_test.log; false)

override_dh_auto_clean:
	dh_auto_clean
	test -e src/deps/rtaudio-mode/Makefile && make -C src/deps/rtaudio-mod/ distclean || true

override_dh_installchangelogs:
	dh_installchangelogs ChangeLog

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

## all the file-exclusion magic is handled by debian/copyright
get-orig-source:
	uscan  --download