File: rules

package info (click to toggle)
kodi 2:17.6+dfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 87,148 kB
  • sloc: cpp: 588,459; xml: 58,591; ansic: 42,735; sh: 12,932; makefile: 4,785; python: 2,803; objc: 1,075; perl: 1,041; cs: 624; java: 500; asm: 294; sed: 16
file content (210 lines) | stat: -rwxr-xr-x 7,422 bytes parent folder | download | duplicates (2)
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
#!/usr/bin/make -f

# This has to be exported to make some magic below work.
export DH_OPTIONS

# Avoid custom build rule silencing
export V=1

# bindnow breaks wrappers used in with libdvdread
export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-bindnow

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

# Use package's version in Kodi
VERSION := $(shell dpkg-parsechangelog -S Version)
UPSTREAM_VERSION := $(shell dpkg-parsechangelog -S Version| sed 's/[0-9]*://;s/-[^-]*$$//')

DVDNAV_COMPONENT = libdvdnav-5-0-3
DVDREAD_COMPONENT = libdvdread-5-0-3

GL_CONFIG_OPTIONS = --enable-gl --disable-gles --enable-vdpau
ARCH_SPECIFIC_LIB_RECOMMENDS_ADD = -lvdpau

# Disable debugging by default
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
DEBUG_CONFIG_OPTIONS += --enable-debug
else
DEBUG_CONFIG_OPTIONS += --disable-debug
endif

# Enable gles for armel, armhf and arm64
# Also disable VDPAU and VAAPI there since they break the build with gles
ifneq (,$(filter armel armhf arm64,$(DEB_HOST_ARCH)))
GL_CONFIG_OPTIONS = --disable-gl --enable-gles --disable-vdpau --disable-vaapi
ARCH_SPECIFIC_LIB_RECOMMENDS_ADD =
else
# Enable OpenGL but no VDPAU or VAAPI for MIPS
ifneq (,$(filter mips mipsel,$(DEB_HOST_ARCH)))
GL_CONFIG_OPTIONS = --enable-gl --disable-gles --disable-vdpau --disable-vaapi
ARCH_SPECIFIC_LIB_RECOMMENDS_ADD =
endif
endif

ARCH_SPECIFIC_LIB_RECOMMENDS += $(ARCH_SPECIFIC_LIB_RECOMMENDS_ADD)

# Various environment variables to set
export DEB_LDFLAGS_MAINT_APPEND = -latomic
# for embedded libdvd*:
export DEB_CPPFLAGS_MAINT_APPEND = -D_XBMC

# List of options to pass to _any_ configure.
CORE_CONFIG_OPTIONS ?= --host=$(DEB_HOST_GNU_TYPE) \
  --disable-maintainer-mode \
  --disable-dependency-tracking \
  --disable-silent-rules \

# List of options to pass to configure of Kodi. Can be overridden.
# Extra options can simply be passed using KODI_CONFIG_EXTRA_OPTIONS env
# variable.
KODI_CONFIG_OPTIONS ?= $(CORE_CONFIG_OPTIONS) \
  $(GL_CONFIG_OPTIONS) \
  --disable-openmax \
  --disable-tegra \
  $(DEBUG_CONFIG_OPTIONS) \
  --disable-profiling \
  --enable-pulse \
  --disable-mid \
  --enable-avahi \
  --enable-webserver \
  --enable-optical-drive \
  --enable-texturepacker \
  --enable-nfs \
  --enable-libcec \
  --disable-airtunes \
  --with-ffmpeg=shared \
  --disable-non-free \
  --enable-gtest \
  --with-lirc-device=/var/run/lirc/lircd \
  $(ARCH_SPECIFIC_OPTIONS) \
  $(KODI_CONFIG_EXTRA_OPTIONS)

# Used to show what config options are enabled
show-kodi-config-options:
	$(info $(KODI_CONFIG_OPTIONS))

%:
	dh $@ --with python2

override_dh_clean:
	dh_clean libtool xbmc/config.h xbmc/stamp-h1
	find . -name config.status -o -name config.cache -o -name config.log \
		-exec rm -f "{}" \;
	rm -rf tools/depends/target; \
	rm -rf $(CURDIR)/addons/webinterface.default
	rm -f debian/dh-addon/*.1

override_dh_auto_clean:
	dh_auto_clean
	make -C $(DVDNAV_COMPONENT) clean || true
	make -C $(DVDREAD_COMPONENT) clean || true

# fall back to old location of DejaVuSans.ttf if needed
ifneq ("$(wildcard /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf)","")
DEJAVUSANS=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
else
DEJAVUSANS=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf
endif

override_dh_auto_configure: configure
	cp -r $(CURDIR)/webinterface-default $(CURDIR)/addons/webinterface.default
	sed -i 's/DEB_VERSION/"'$(VERSION)'"/' xbmc/Application.cpp xbmc/utils/SystemInfo.cpp
	fontforge -script $(CURDIR)/debian/mergefonts.ff \
		/usr/share/fonts/truetype/droid/DroidSansFallbackFull.ttf \
		$(DEJAVUSANS) \
		$(CURDIR)/media/Fonts/arial.ttf
	cp -r /usr/src/gtest/ $(CURDIR)/lib/
	mkdir -p $(CURDIR)/lib/gtest/lib/.libs
	ln -s ../../libgtest.a $(CURDIR)/lib/gtest/lib/.libs/
	./bootstrap
	dh_auto_configure -- $(KODI_CONFIG_OPTIONS)
	# Add "from Debian" next to Kodi's original logo
	rsvg-convert -w 250 -h 82 -o addons/skin.estuary/media/from-debian-logo.png debian/from-debian-logo.svg
	(cd $(DVDREAD_COMPONENT) && autoreconf -vif && \
		$(shell dpkg-buildflags --export=configure) ./configure $(CORE_CONFIG_OPTIONS) \
		--prefix=$(CURDIR)/tools/depends/target/libdvdread/dvdread-install --disable-shared --enable-static --with-pic && \
		$(MAKE) install) && \
	(cd $(DVDNAV_COMPONENT) && autoreconf -vif && \
		$(shell dpkg-buildflags --export=configure) PKG_CONFIG_PATH="$(CURDIR)/tools/depends/target/libdvdread/dvdread-install/lib/pkgconfig" ./configure $(CORE_CONFIG_OPTIONS) \
		--prefix=$(CURDIR)/tools/depends/target/libdvdnav/dvdnav-install --disable-shared --enable-static --with-pic && \
		$(MAKE) install)

override_dh_auto_build:
	dh_auto_build
	for file in $$(ls debian/dh-addon/dh_*); do \
		pod2man --section=1 --utf8 $$file $$file.1; \
	done

override_dh_auto_test-arch:
	dh_auto_test -a

# No tests for indep build.
override_dh_auto_test-indep:

override_dh_auto_install:
	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
	install -m 755 $(CURDIR)/tools/depends/native/TexturePacker/bin/TexturePacker \
		$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/kodi/
	$(MAKE) eventclients DESTDIR=$(CURDIR)/debian/tmp \
		WII_EXTRA_OPTS=-DCWIID_OLD

override_dh_install-indep:
	dh_install -i -XLICENCE -XLICENSE \
		-XLicence.txt -XLicense.txt -XLICENSE.txt \
		-XNOTICE.txt \
		-Xjquery-1.8.2.min.js -Xiscroll-min.js
	rm -rf debian/kodi-data/usr/share/kodi/addons/repository.xbmc.org
	dh_install -pkodi-repository-kodi \
		addons/repository.xbmc.org/* usr/share/kodi/addons/repository.xbmc.org

override_dh_install-arch:
	dh_install -a -XLICENCE -XLICENSE -XLicence.txt -XLicense.txt \
		-XLICENSE.txt -XNOTICE.txt
	# check if all needed headers are included
	$(CXX) -c debian/headers-check.c -DBUILD_KODI_ADDON \
	$(shell dpkg-buildflags --get CPPFLAGS) \
	$(shell dpkg-buildflags --get CXXFLAGS) \
	-Idebian/kodi-addons-dev/usr/include \
	-Idebian/kodi-addons-dev/usr/include/kodi \
	-o /dev/null

override_dh_shlibdeps: debian/tmp/kodi-bin-depends-dummy.so debian/tmp/kodi-bin-recommends-dummy.so
	dh_shlibdeps -a -O--parallel \
		-l$(CURDIR)/debian/kodi-bin/usr/lib/*/kodi/system/players/dvdplayer
	# Need to manually add dependencies for dlopened libs.
	dpkg-shlibdeps -pdlopenlibs -edebian/tmp/kodi-bin-depends-dummy.so -xlibc6 -O >>debian/kodi-bin.substvars
	dpkg-shlibdeps -dRecommends -edebian/tmp/kodi-bin-recommends-dummy.so -xlibc6 -O >>debian/kodi-bin.substvars

debian/tmp/kodi-bin-depends-dummy.so:
	mkdir -p debian/tmp
	cc -xc -shared -Wl,--no-as-needed -o $@ /dev/null \
		-lcurl-gnutls

debian/tmp/kodi-bin-recommends-dummy.so:
	mkdir -p debian/tmp
	cc -xc -shared -Wl,--no-as-needed -o $@ /dev/null \
		-lass \
		-lbluray \
		-lcec \
		-lmodplug \
		-lnfs \
		-lplist \
		$(ARCH_SPECIFIC_LIB_RECOMMENDS)

override_dh_strip:
	dh_strip --ddeb-migration="kodi-dbg (<< 15.1+dfsg1-4~)" || dh_strip

override_dh_gencontrol-arch:
	debian/dh-addon/dh_kodiaddon_depends
	dh_gencontrol -a

override_dh_gencontrol-indep:
	dh_gencontrol -i

# extract customized additional tarballs
extract-components:
	tar -xf $(CURDIR)/../kodi_"$(UPSTREAM_VERSION)".orig-$(DVDNAV_COMPONENT).tar.bz2 && \
		test -d $(CURDIR)/$(DVDNAV_COMPONENT) || mv libdvdnav-* $(CURDIR)/$(DVDNAV_COMPONENT)
	tar -xf $(CURDIR)/../kodi_"$(UPSTREAM_VERSION)".orig-$(DVDREAD_COMPONENT).tar.bz2 && \
		test -d $(CURDIR)/$(DVDREAD_COMPONENT) || mv libdvdread-* $(CURDIR)/$(DVDREAD_COMPONENT)
	tar -xf $(CURDIR)/../kodi_"$(UPSTREAM_VERSION)".orig-webinterface-default.tar.xz