File: rules

package info (click to toggle)
musescore3 3.2.3%2Bdfsg2-11
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 210,672 kB
  • sloc: cpp: 291,093; xml: 200,238; sh: 3,779; ansic: 1,447; python: 393; makefile: 240; perl: 82; pascal: 79
file content (128 lines) | stat: -rwxr-xr-x 3,848 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
#!/usr/bin/make -f

CWD:=$(abspath .)

ifeq (,$(filter terse,${DEB_BUILD_OPTIONS}))
export DH_VERBOSE=1
export V=1
export VERBOSE=1
endif

LC_ALL:=C.UTF-8
export LC_ALL
TZ:=UTC
export TZ

shellescape='$(subst ','\'',$(1))'
shellexport=$(1)=$(call shellescape,${$(1)})

MSPPKG=musescore3
MSCPKG=${MSPPKG}-common
MSPDIR=debian/${MSPPKG}
MSCDIR=debian/${MSCPKG}
MSHARE=usr/share/mscore3-*

DEB_HOST_ARCH?=$(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_ARCH_OS?=$(shell dpkg-architecture -qDEB_HOST_ARCH_OS)

OUR_CPPFLAGS:=
OUR_CFLAGS:=
OUR_CXXFLAGS:=
OUR_LDFLAGS:=

# unclutter build log; these are upstream’s to fix
OUR_CFLAGS+=	-Wno-deprecated-declarations
OUR_CXXFLAGS+=	-Wno-deprecated-declarations
OUR_CXXFLAGS+=	-Wno-deprecated-copy

# only needed when backporting to buster and older
#OUR_LDFLAGS+=	-Wl,--as-needed

# defined for most of the code anyway; doing this here helps the PCH
OUR_CPPFLAGS+=	-DQT_NO_DEBUG
# avoid stray debugging output
OUR_CPPFLAGS+=	-DNDEBUG
# disable phoning home
OUR_CPPFLAGS+=	-DMSCORE_NO_UPDATE_CHECKER

# better debugging if requested
ifneq (,$(findstring optdbg,${DEB_BUILD_OPTIONS}))
OUR_CFLAGS+=	-Og -g3
OUR_CXXFLAGS+=	-Og -g3
endif

# things that cannot be passed via CPPFLAGS
OUR_CPPFLAGS+=	-I${CWD}/debian/q-include

dpkgbuildflagsmkescape=$(subst \,\\\,$(1))
export DEB_BUILD_MAINT_OPTIONS:=hardening=+all
export DEB_CPPFLAGS_MAINT_APPEND:=$(call dpkgbuildflagsmkescape,${OUR_CPPFLAGS})
export DEB_CFLAGS_MAINT_APPEND:=$(call dpkgbuildflagsmkescape,${OUR_CFLAGS})
export DEB_CXXFLAGS_MAINT_APPEND:=$(call dpkgbuildflagsmkescape,${OUR_CXXFLAGS})
export DEB_LDFLAGS_MAINT_APPEND:=$(call dpkgbuildflagsmkescape,${OUR_LDFLAGS})
include /usr/share/dpkg/buildflags.mk
ifneq (,$(wildcard /usr/share/dpkg/buildtools.mk))
include /usr/share/dpkg/buildtools.mk
endif
include /usr/share/dpkg/pkg-info.mk

%:
	dh $@ --buildsystem=cmake

CMAKE_DEFS:=	-DCMAKE_SKIP_RPATH=ON
CMAKE_DEFS+=	-DDOWNLOAD_SOUNDFONT=OFF
CMAKE_DEFS+=	-DUSE_SYSTEM_FREETYPE=ON \
		-DFREETYPE_INCLUDE_DIRS=/usr/include/freetype2/
CMAKE_DEFS+=	-DBUILD_WEBENGINE=OFF
CMAKE_DEFS+=	-DOMR=ON
CMAKE_DEFS+=	-DUSE_SYSTEM_POPPLER=ON
CMAKE_DEFS+=	-DBUILD_CRASH_REPORTER=OFF

ifneq (linux,${DEB_HOST_ARCH_OS})
CMAKE_DEFS+=	-DBUILD_PORTMIDI=OFF
endif

CMAKE_DEFS+=	-DMSCORE_INSTALL_SUFFIX="3"

override_dh_auto_configure:
	test -s fonts/mscore/mscore.old || \
	    mv fonts/mscore/mscore.ttf fonts/mscore/mscore.old
	cp -f debian/upstream/mscore.ttf fonts/mscore/mscore.ttf
	rm -rf debian/q-include
	mkdir debian/q-include
	printf '#define DEB_PKG_VERSION "%s (%s %s/%s)"\n' \
	    $(call shellescape,${DEB_VERSION}) \
	    "$$(lsb_release -si)" \
	    "$$(lsb_release -sc)" \
	    $(call shellescape,${DEB_HOST_ARCH}) \
	    >debian/q-include/DEB_PKG_VERSION.h
	exec dh_auto_configure -- ${CMAKE_DEFS}

override_dh_auto_build:
	env GNUMAKEFLAGS="$$GNUMAKEFLAGS --output-sync" \
	    dh_auto_build -- lrelease all
	doxygen Doxyfile.plugins

override_dh_auto_test:
	exec mksh debian/buildtest ${DEB_BUILD_OPTIONS}

execute_after_dh_install-indep:
	# add doxygen-generated files
	cd doc && exec cp -r plugins ../${MSCDIR}/${MSHARE}/manual/
	dh_doxygen -p${MSCPKG} $$(cd ${MSCDIR} && \
	    echo ${MSHARE}/manual/plugins/html)
	# doc-base insists on /usr/share/doc/ prefix
	mkdir -p ${MSCDIR}/usr/share/doc/${MSCPKG}
	ln -sfTr ${MSCDIR}/${MSHARE}/manual/plugins \
	    ${MSCDIR}/usr/share/doc/${MSCPKG}/plugin-doxy
	# make system-wide soundfonts available
	cd ${MSCDIR}/${MSHARE} && mkdir -p sound && \
	    ln -sf ../../sounds/sf2 ../../sounds/sf3 ../../sounds/sfz sound/

execute_after_dh_auto_clean:
	test '!' -s fonts/mscore/mscore.old || \
	    mv -f fonts/mscore/mscore.old fonts/mscore/mscore.ttf
	rm -rf debian/q-include
	# remove possible doxygen remnants
	rm -rf doc/plugins
	-chmod -R g-w . # work around #796257 for Debian reproducible-builds