move nocheck test to debian/buildtest as it parses DEB_BUILD_OPTIONS already anyway
[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 # defined for most of the code anyway; doing this here helps the PCH
10 OUR_CPPFLAGS := -DQT_NO_DEBUG
11 # avoid stray debugging output
12 OUR_CPPFLAGS += -DNDEBUG
13 # disable phoning home
14 OUR_CPPFLAGS += -DMSCORE_NO_UPDATE_CHECKER
15
16 export DEB_BUILD_MAINT_OPTIONS := hardening=+all
17 export DEB_LDFLAGS_MAINT_APPEND := -Wl,--as-needed
18 export DEB_CPPFLAGS_MAINT_APPEND := ${OUR_CPPFLAGS}
19
20 # better debugging if requested
21 ifneq (,$(findstring optdbg,${DEB_BUILD_OPTIONS}))
22 export DEB_CFLAGS_MAINT_APPEND := -Og
23 export DEB_CXXFLAGS_MAINT_APPEND := -Og
24 endif
25
26 DEB_HOST_ARCH_OS?=$(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
27
28 %:
29         dh $@ --buildsystem=cmake
30
31 CMAKE_DEFS:=    -DCMAKE_SKIP_RPATH=ON
32 CMAKE_DEFS+=    -DDOWNLOAD_SOUNDFONT=OFF
33 CMAKE_DEFS+=    -DUSE_SYSTEM_FREETYPE=ON \
34                 -DFREETYPE_INCLUDE_DIRS=/usr/include/freetype2/
35
36 ifneq (linux,${DEB_HOST_ARCH_OS})
37 CMAKE_DEFS+=    -DBUILD_PORTMIDI=OFF
38 endif
39
40 override_dh_auto_configure:
41         dh_auto_configure -- ${CMAKE_DEFS}
42
43 override_dh_auto_build:
44         env GNUMAKEFLAGS="$$GNUMAKEFLAGS --output-sync" \
45             dh_auto_build -- lrelease all
46
47 override_dh_auto_test:
48         mksh debian/buildtest ${DEB_BUILD_OPTIONS}
49
50 override_dh_install-indep:
51         # move stuff to packages
52         dh_install
53         # make system-wide soundfonts available
54         cd debian/musescore-common/usr/share/mscore-* && \
55             mkdir -p sound && \
56             ln -sf ../../sounds/sf2 ../../sounds/sf3 ../../sounds/sfz sound/