pimp d/rules, build with LC_ALL=C, clean doxygen output
[alioth/musescore.git] / debian / rules
1 #!/usr/bin/make -f
2
3 ifeq (,$(findstring terse,${DEB_BUILD_OPTIONS}))
4 export DH_VERBOSE=1
5 export V=1
6 export VERBOSE=1
7 endif
8
9 LC_ALL:=C
10 export LC_ALL
11
12 DEB_HOST_ARCH_OS?=$(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
13
14 OUR_CPPFLAGS:=
15 OUR_CFLAGS:=
16 OUR_CXXFLAGS:=
17 OUR_LDFLAGS:=   -Wl,--as-needed
18
19 # defined for most of the code anyway; doing this here helps the PCH
20 OUR_CPPFLAGS+=  -DQT_NO_DEBUG
21 # avoid stray debugging output
22 OUR_CPPFLAGS+=  -DNDEBUG
23 # disable phoning home
24 OUR_CPPFLAGS+=  -DMSCORE_NO_UPDATE_CHECKER
25
26 # better debugging if requested
27 ifneq (,$(findstring optdbg,${DEB_BUILD_OPTIONS}))
28 OUR_CFLAGS+=    -Og
29 OUR_CXXFLAGS+=  -Og
30 endif
31
32 export DEB_BUILD_MAINT_OPTIONS := hardening=+all
33 export DEB_CPPFLAGS_MAINT_APPEND := ${OUR_CPPFLAGS}
34 export DEB_CFLAGS_MAINT_APPEND := ${OUR_CFLAGS}
35 export DEB_CXXFLAGS_MAINT_APPEND := ${OUR_CXXFLAGS}
36 export DEB_LDFLAGS_MAINT_APPEND := ${OUR_LDFLAGS}
37
38 %:
39         dh $@ --buildsystem=cmake
40
41 CMAKE_DEFS:=    -DCMAKE_SKIP_RPATH=ON
42 CMAKE_DEFS+=    -DDOWNLOAD_SOUNDFONT=OFF
43 CMAKE_DEFS+=    -DUSE_SYSTEM_FREETYPE=ON \
44                 -DFREETYPE_INCLUDE_DIRS=/usr/include/freetype2/
45
46 ifneq (linux,${DEB_HOST_ARCH_OS})
47 CMAKE_DEFS+=    -DBUILD_PORTMIDI=OFF
48 endif
49
50 override_dh_auto_configure:
51         dh_auto_configure -- ${CMAKE_DEFS}
52
53 override_dh_auto_build:
54         env GNUMAKEFLAGS="$$GNUMAKEFLAGS --output-sync" \
55             dh_auto_build -- lrelease all
56
57 override_dh_auto_test:
58         mksh debian/buildtest ${DEB_BUILD_OPTIONS}
59
60 override_dh_install-indep:
61         # move stuff to packages
62         dh_install
63         # make system-wide soundfonts available
64         cd debian/musescore-common/usr/share/mscore-* && \
65             mkdir -p sound && \
66             ln -sf ../../sounds/sf2 ../../sounds/sf3 ../../sounds/sfz sound/
67
68 override_dh_auto_clean:
69         dh_auto_clean
70         # remove possible doxygen remnants
71         rm -rf doc/plugins