File: rules

package info (click to toggle)
csound 1%3A6.18.1%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 63,220 kB
  • sloc: ansic: 192,643; cpp: 14,149; javascript: 9,654; objc: 9,181; python: 3,376; java: 3,337; sh: 1,840; yacc: 1,255; xml: 985; perl: 635; lisp: 411; tcl: 341; lex: 217; makefile: 128
file content (186 lines) | stat: -rwxr-xr-x 5,481 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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2007-2009 Felipe Sateler <fsateler@gmail.com>
# Copyright © 2008-2010 Jonas Smedegaard <dr@jones.dk>
# Copyright © 2021 IOhannes m zmölnig <umlaeute@debian.org>
# Description: Main Debian packaging script for CSound
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# Csound has many format errors, so disable that. Fix pending upstream
# https://github.com/csound/csound/pull/880
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk

DEB_CMAKE_EXTRA_FLAGS =

# Core options of csound
DEB_CMAKE_EXTRA_FLAGS += \
	-DBUILD_RELEASE=ON \
	-DFAIL_MISSING=ON \
	-DUSE_DOUBLE=ON \
	-DUSE_GETTEXT=ON \
	-DUSE_GIT_COMMIT=OFF \
	-DBUILD_STATIC_LIBRARY=ON \
	-DUSE_LRINT=ON \
	-DBUILD_UTILITIES=ON \
	-DNEW_PARSER_DEBUG=OFF \
	-DREQUIRE_PTHREADS=ON \
	-DBUILD_MULTI_CORE=ON \
	-DBUILD_TESTS=ON \
	-DUSE_COMPILER_OPTIMIZATIONS=OFF \
	-DLIBRARY_INSTALL_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) \
	-DPYTHON3_MODULE_INSTALL_DIR=/usr/lib/python3/dist-packages \
	-DJAVA_MODULE_INSTALL_DIR=/usr/lib \
	-DLUA_MODULE_INSTALL_DIR=/usr/lib/$(DEB_HOST_MULTIARCH)/lua/5.1/ \
	-DUSE_ATOMIC_BUILTIN=ON \
	$(empty)

# I/O plugins
DEB_CMAKE_EXTRA_FLAGS += \
	-DUSE_AUDIOUNIT=OFF \
	-DUSE_COREMIDI=OFF \
	-DUSE_PORTAUDIO=ON \
	-DUSE_PORTMIDI=ON \
	-DUSE_PULSEAUDIO=ON \
	-DUSE_JACK=ON \
	$(empty)

ifeq "$(DEB_HOST_ARCH_OS)" "linux"
	DEB_CMAKE_EXTRA_FLAGS += -DUSE_ALSA=ON
else
	DEB_CMAKE_EXTRA_FLAGS += -DUSE_ALSA=OFF
endif

# Optional opcodes
DEB_CMAKE_EXTRA_FLAGS += \
	-DBUILD_DSSI_OPCODES=ON \
	-DBUILD_DSSI_OPCODES=ON \
	-DBUILD_OSC_OPCODES=ON \
	-DUSE_CURL=OFF \
	-DBUILD_PADSYNTH_OPCODES=ON \
	-DBUILD_SCANSYN_OPCODES=OFF \
	$(empty)

# Language Wrappers
# TODO: build for all Python versions (not only current default one)
# Force build of only the default one
DEB_CMAKE_EXTRA_FLAGS += \
	-DBUILD_CXX_INTERFACE=ON \
	-DBUILD_LUA_INTERFACE=ON \
	$(empty)

# Frontends
DEB_CMAKE_EXTRA_FLAGS += \
	-DBUILD_CSBEATS=ON \
	-DBUILD_BELA=OFF \
	$(empty)

DEB_CMAKE_EXTRA_FLAGS += \
	-DCMAKE_BUILD_RPATH_USE_ORIGIN=ON \
	$(empty)

# This is a huge optimization boost
ifneq "$(filter amd64 i386, $(DEB_HOST_ARCH_CPU))" ""
	MTUNE = ON
endif
ifneq "$(filter amd64, $(DEB_HOST_ARCH_CPU))" ""
	ENABLE_SIMD = 1
else
	ENABLE_SIMD = 0
endif

# no java packages an hppa & hurd
ifeq (,$(filter $(DEB_HOST_ARCH),hppa hurd-i386))
DEB_CMAKE_EXTRA_FLAGS += \
	-DBUILD_JAVA_INTERFACE=ON \
	$(empty)
else
export DH_OPTIONS += -Nlibcsnd6-java
endif


BUILDDIR=obj-$(DEB_HOST_MULTIARCH)

%:
	dh $@ --buildsystem=cmake+ninja --builddirectory=$(BUILDDIR)

PACKAGE_DATE = $(shell env --ignore-environment TZ=UTC LANG=C date -d@$(SOURCE_DATE_EPOCH) +%F)

override_dh_auto_configure:
	sed -e 's,@MTUNE@,$(MTUNE),' \
		-e 's,@ENABLE_SIMD@,$(ENABLE_SIMD),' \
		-e 's,@DATE@,$(PACKAGE_DATE),' \
		debian/Custom.cmake > \
		Custom.cmake
	dh_auto_configure -- $(DEB_CMAKE_EXTRA_FLAGS)

execute_before_dh_auto_build:
	@echo "blhc: ignore-line-regexp: ^C\+\+ analysis\.\.\.$$"

execute_after_dh_auto_build-indep:
	mkdir -p doc/doxygen
	cd doc && doxygen

override_dh_auto_test:
	OPCODE6DIR64=$(BUILDDIR) dh_auto_test

execute_after_dh_auto_clean:
	rm -f Custom.cmake
	rm -rf doc/doxygen
	rm -f tests/c/debug.orc tests/c/debug.sco
	rm -f tests/c/*.wav
	rm -f Android/CsoundAndroid/jni/version.h

execute_after_dh_auto_install-arch:
	# don't install the static library
	rm $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libcsound64.a
	# fix overly generic name
	mv $(CURDIR)/debian/tmp/usr/bin/extract \
		$(CURDIR)/debian/tmp/usr/bin/csound_extract
	# JAVA
	mkdir -p $(CURDIR)/debian/tmp/usr/share/java
	mv $(CURDIR)/debian/tmp/usr/lib/csnd6.jar \
		$(CURDIR)/debian/tmp/usr/share/java/csnd6-$(DEB_VERSION_UPSTREAM).jar
	ln -s csnd6-$(DEB_VERSION_UPSTREAM).jar $(CURDIR)/debian/tmp/usr/share/java/csnd6.jar
	mkdir -p $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/jni
	mv $(CURDIR)/debian/tmp/usr/lib/lib_jcsound6.so \
		$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/jni
	# create some manpages
	debian/csound2man
	debian/csoundutils2man

libcsound64-installdocs:
	dh_installdocs -plibcsound64-doc --doc-main-package=libcsound64-dev
override_dh_installdocs-indep: libcsound64-installdocs
override_dh_installdocs-indep override_dh_installdocs-arch:
	dh_installdocs --remaining-packages -A README.md AUTHORS


execute_after_dh_installdocs-indep:
	dh_doxygen

DEB_COPYRIGHT_CHECK_IGNORE_REGEX = \
	debian/.*|.*\.wav|.*\.aiff?|.*\.mp3|.*\.lpc|.*\.pvx|.*\.png|.*\.tiff|.*\.sf2|.*\.dat|tests/soak/HRTFcompact|.*\.jar|.*\.jar
# licensecheck v1
.PHONY: licensecheck
licensecheck:
	LANG=C.UTF-8 licensecheck \
		-i "^($(DEB_COPYRIGHT_CHECK_IGNORE_REGEX))$$" \
		--check '.*' --recursive --deb-machine --lines 0 * \
		> debian/copyright_newhints
	cmp debian/copyright_hints debian/copyright_newhints \
		&& rm debian/copyright_newhints