File: rules

package info (click to toggle)
ardour 1%3A6.5.0%2Bds0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 102,700 kB
  • sloc: cpp: 569,181; xml: 123,660; ansic: 81,199; python: 34,176; javascript: 15,330; sh: 4,679; asm: 1,347; perl: 889; php: 772; makefile: 253; objc: 28
file content (147 lines) | stat: -rwxr-xr-x 4,227 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#!/usr/bin/make -f
#
# Robert Jordens <jordens@debian.org>
# © 2019, IOhannes m zmölnig <umlaeute@debian.org>
# © 2020, Olivier Humbert <trebmuh@tuxfamily.org>
#
# This software may be used and distributed according to the terms
# of the GNU General Public License, incorporated herein by reference.

export DH_VERBOSE = 1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

include /usr/share/dpkg/pkg-info.mk
include /usr/share/dpkg/buildflags.mk
BUILD_DATE:=$(shell date -u -d "@$(SOURCE_DATE_EPOCH)" +"%F")

########### WAF options ############
waf-light = python3 $(CURDIR)/debian/waf/waf-light
waf-configure-options = \
	--lxvst \
	--freedesktop \
	--configdir=/etc/ \
	--noconfirm \
	--prefix=/usr/ \
	--no-phone-home \
	--use-external-libs \
	--optimize \
	--cxx11 \
	--ptformat \
	--lv2dir=/usr/lib/lv2 \
	$(empty)


DIST_TARGET = none
ifneq (,$(findstring i386,$(DEB_BUILD_ARCH)))
	DIST_TARGET = i686
endif
ifneq (,$(findstring amd64,$(DEB_BUILD_ARCH)))
	DIST_TARGET = x86_64
endif

BACKENDS = jack,dummy
ifneq (,$(findstring linux,$(DEB_HOST_ARCH_OS)))
# ALSA Backend is only available on Linux
	BACKENDS = jack,alsa,dummy,pulseaudio
else
	waf-configure-options += \
		--no-fpu-optimization \
		$(empty)
endif

ARDOUR_LIBRARY_PATH := /usr/lib/ardour6/

waf-configure-options += \
	--with-backends=$(BACKENDS) \
	--dist-target=$(DIST_TARGET) \
	$(empty)

DEB_WAF_INVOKE = \
	CPPFLAGS="$(CPPFLAGS)" \
	CFLAGS="$(CFLAGS)" \
	CXXFLAGS="$(CXXFLAGS)" \
	LDFLAGS="$(LDFLAGS) -Wl,--as-needed" \
	$(waf-light) -v --destdir=$(CURDIR)/debian/tmp

deb_revision := libs/ardour/revision.cc
waf_extras := debian/waf/waflib/extras/autowaf.py debian/waf/waflib/extras/misc.py

########### build overrides options ############
%:
	dh $@

override_dh_auto_build: genfiles
	$(DEB_WAF_INVOKE) configure $(waf-configure-options)
	$(DEB_WAF_INVOKE) build i18n_mo

override_dh_auto_install: override_dh_auto_build manpages genfiles
	$(DEB_WAF_INVOKE) install
	for res in 16 22 32 48; do \
		mkdir -p $(CURDIR)/debian/ardour/usr/share/icons/hicolor/$${res}x$${res}/mimetypes; \
		cp $(CURDIR)/gtk2_ardour/icons/application-x-ardour_$${res}px.png \
			$(CURDIR)/debian/ardour/usr/share/icons/hicolor/$${res}x$${res}/mimetypes/application-x-ardour.png ; \
	done

## ardour includes a couple of private lib*.so files, which make
## dh_makeshlibs emit a useless call to `ldconfig` in the postinst script.
## since we don't have any public libraries, we just suppress that call.
override_dh_makeshlibs:
	dh_makeshlibs --no-scripts
override_dh_shlibdeps:
	dh_shlibdeps -- -l$(CURDIR)/debian/ardour/$(ARDOUR_LIBRARY_PATH)

override_dh_clean: manpageclean
	rm -f .lock-wscript .lock-waf_linux2_build
	find . -name "*.pyc" -delete || true
	find . -name "*.mo" -delete || true
	rm -rf build
	rm -f \
		gtk2_ardour/version.cc\
		gtk2_ardour/version.h\
		gtk2_ardour/ardour.appdata.xml.in\
		libs/ardour/ardour/version.h\
		libs/ardour/config_text.cc\
		libs/ardour/svn_revision.cc\
		libs/ardour/version.cc\
		$(deb_revision)\
		libs/gtkmm2ext/gtkmm2ext/version.h\
		libs/gtkmm2ext/version.cc\
		libs/midi++2/midi++/version.h\
		libs/midi++2/version.cc\
		libs/pbd/pbd/version.h\
		libs/pbd/version.cc\
		$(empty)
	dh_clean

########### build intermediates ############
.PHONY: genfiles
genfiles: $(deb_revision) $(waf_extras)

$(deb_revision):
	echo '#include "ardour/revision.h"' > $@
	echo "namespace ARDOUR { const char* revision = \"$(subst +,~,$(DEB_VERSION_UPSTREAM_REVISION))\"; const char* date = \"$(BUILD_DATE)\"; }" >> $@

debian/waf/waflib/extras/%: tools/%
	cp $< $@

MANPAGES = ardour6-copy-mixer.1 ardour6-export.1 ardour6-fix_bbtppq.1 \
	ardour6-new_empty_session.1 ardour6-new_session.1
.PHONY: manpages manpageclean
$(MANPAGES): debian/ardour6-utils.1
	cp $^ $@
manpages: $(MANPAGES)
manpageclean:
	rm -f $(MANPAGES)

################ d/copyright helper ##############
DEB_COPYRIGHT_CHECK_IGNORE_REGEX = \
        \.git/.*|debian/.*|.*\.ico|.*\.icns|.*\.wav|.*\.flac|.*\.ogg|.*\.touchosc

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