Diff vdr-2.2.0-r7 with a vdr-2.6.3

/usr/portage/media-video/vdr/vdr-2.6.3.ebuild 2023-10-09 14:52:31.836368409 +0300
1
# Copyright 2022 Gentoo Authors
1
# Copyright 2021-2023 Gentoo Authors
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4
EAPI=7
4
EAPI=8
5 5

  
6
inherit flag-o-matic strip-linguas toolchain-funcs
7

  
8
# Switches supported by extensions-patch
9
EXT_PATCH_FLAGS="alternatechannel graphtft naludump permashift pinplugin
10
				mainmenuhooks menuorg menuselection resumereset ttxtsubs"
11

  
12
# names of the use-flags
13
EXT_PATCH_FLAGS_RENAMED=""
14

  
15
# names ext-patch uses internally, here only used for maintainer checks
16
EXT_PATCH_FLAGS_RENAMED_EXT_NAME="bidi no_kbd sdnotify"
17

  
18
MY_PV="${PV%_p*}"
19
MY_P="${PN}-${MY_PV}"
20
S="${WORKDIR}/${MY_P}"
21

  
22
EXT_P="extpng-${P}-gentoo-edition-v1"
6
inherit flag-o-matic strip-linguas toolchain-funcs user-info
23 7

  
24 8
DESCRIPTION="Video Disk Recorder - turns a pc into a powerful set top box for DVB"
25 9
HOMEPAGE="http://www.tvdr.de/"
26
SRC_URI="ftp://ftp.tvdr.de/vdr/${MY_P}.tar.bz2
27
	mirror://gentoo/${EXT_P}.patch.bz2"
10
SRC_URI="http://git.tvdr.de/?p=vdr.git;a=snapshot;h=refs/tags/${PV};sf=tbz2 -> ${P}.tbz2
11
	menuorg? ( https://github.com/vdr-projects/vdr-plugin-menuorg/raw/master/vdr-patch/vdr-menuorg-2.3.x.diff )
12
	ttxtsubs? ( https://md11.it.cx/download/${PN}/${PN}-2.6.1_ttxtsubs_v2.patch )"
28 13

  
29 14
LICENSE="GPL-2+"
30 15
SLOT="0"
31 16
KEYWORDS="amd64 ~arm ~arm64 ~ppc x86"
32
IUSE="bidi debug keyboard html systemd vanilla ${EXT_PATCH_FLAGS} ${EXT_PATCH_FLAGS_RENAMED}"
17
IUSE="bidi debug demoplugins html keyboard mainmenuhooks menuorg naludump permashift pinplugin systemd ttxtsubs verbose"
33 18

  
34 19
COMMON_DEPEND="
35
	media-libs/libjpeg-turbo
36
	sys-libs/libcap
37
	>=media-libs/fontconfig-2.4.2
38
	>=media-libs/freetype-2"
20
	acct-group/vdr
21
	acct-user/vdr
22
	media-libs/fontconfig
23
	media-libs/freetype
24
	media-libs/libjpeg-turbo:=
25
	sys-libs/libcap"
39 26
DEPEND="${COMMON_DEPEND}
40 27
	>=virtual/linuxtv-dvb-headers-5.3"
41 28
RDEPEND="${COMMON_DEPEND}
42 29
	dev-lang/perl
43
	>=media-tv/gentoo-vdr-scripts-2.7
30
	media-tv/gentoo-vdr-scripts
44 31
	media-fonts/corefonts
45 32
	bidi? ( dev-libs/fribidi )
46 33
	systemd? ( sys-apps/systemd )"
47
BDEPEND="sys-devel/gettext
34
BDEPEND="
35
	sys-devel/gettext
48 36
	virtual/pkgconfig"
49 37

  
38
REQUIRED_USE="permashift? ( !naludump !pinplugin )"
39

  
50 40
CONF_DIR="/etc/vdr"
51 41
CAP_FILE="${S}/capabilities.sh"
52 42
CAPS="# Capabilities of the vdr-executable for use by startscript etc."
......
55 45
	use debug && append-flags -g
56 46

  
57 47
	PLUGIN_LIBDIR="/usr/$(get_libdir)/vdr/plugins"
48
	VIDEO_DIR="$(egethome vdr)/video"
58 49

  
59 50
	tc-export CC CXX AR
60 51
}
......
66 57
	done
67 58
}
68 59

  
69
enable_patch() {
70
	local arg ARG_UPPER
71
	for arg; do
72
		ARG_UPPER=$(echo $arg | tr '[:lower:]' '[:upper:]')
73
		echo "${ARG_UPPER} = 1" >> Make.config || die "cannot write to Make.config"
74

  
75
		# codesnippet to bring the extpng defines into the vdr.pc CXXFLAGS CFLAGS
76
		echo "-DUSE_${ARG_UPPER}" >> "${T}"/defines.tmp || die "cannot write to defines.tmp"
77
		cat "${T}"/defines.tmp | tr \\\012 ' '  > "${T}"/defines.IUSE || die "cannot write to defines.tmp"
78
		export DEFINES_IUSE=$( cat "${T}"/defines.IUSE )
79
	done
80
}
81

  
82
extensions_add_make_conf() {
83
	# copy all ifdef for extensions-patch to Make.config
84
	sed -e '1,/need to touch the following:/d' \
85
		-e '/need to touch the following/,/^$/d' \
86
		Make.config.template >> Make.config || die "cannot write to Make.config"
87
}
88

  
89
extensions_all_defines() {
90
	# extract all possible settings for extensions-patch
91
	sed -e '/^#\?[A-Z].*= 1/!d' -e 's/^#\?//' -e 's/ .*//' \
92
		Make.config.template \
93
		| sort \
94
		| tr '[:upper:]' '[:lower:]' || die "error in function extensions_all_defines"
95
}
96

  
97 60
lang_po() {
98 61
	LING_PO=$( ls "${S}"/po | sed -e "s:.po::g" | cut -d_ -f1 | tr \\\012 ' ' )
99 62
}
100 63

  
101
src_configure() {
102
	# support languages, written from right to left
103
	export "BIDI=$(usex bidi 1 0)"
104
	# systemd notification support
105
	export "SDNOTIFY=$(usex systemd 1 0)"
106
	# with/without keyboard
107
	export "USE_KBD=$(usex keyboard 1 0)"
108
}
109

  
110 64
src_prepare() {
111 65
	# apply maintenance-patches
112 66
	ebegin "Changing paths for gentoo"
113 67

  
114
	local DVBDIR="/usr/include"
68
	local DVBDIR=/usr/include
115 69
	local i
116 70
	for i in ${DVB_HEADER_PATH} /usr/include/v4l-dvb-hg /usr/include; do
117 71
		[[ -d ${i} ]] || continue
118 72
		if [[ -f ${i}/linux/dvb/dmx.h ]]; then
119 73
			einfo "Found DVB header files in ${i}"
120
			DVBDIR="${i}"
74
			DVBDIR=${i}
121 75
			break
122 76
		fi
123 77
	done
......
141 95
		DVBDIR			= ${DVBDIR}
142 96
		PLUGINLIBDIR	= ${PLUGIN_LIBDIR}
143 97
		CONFDIR			= ${CONF_DIR}
144
		VIDEODIR		= /var/vdr/video
98
		ARGSDIR			= \$(CONFDIR)/conf.d
99
		VIDEODIR		= ${VIDEO_DIR}
145 100
		LOCDIR			= \$(PREFIX)/share/locale
146 101
		INCDIR			= \$(PREFIX)/include
147 102

  
......
156 111
	EOT
157 112
	eend 0
158 113

  
159
	# wrt bug 586070
160
	if has_version ">=sys-apps/systemd-230"; then
161
		sed -e "s:libsystemd-daemon:libsystemd:g" -i Makefile || die "sed libsystemd failed"
162
	fi
163

  
164
	if ! use vanilla; then
114
	eapply "${FILESDIR}/${PN}-2.4.6_gentoo.patch"
115
	use demoplugins || eapply "${FILESDIR}/vdr-2.4_remove_plugins.patch"
116
	eapply "${FILESDIR}/${PN}-2.4.6_makefile-variables.patch"
117

  
118
	# fix clang/LLVM compile
119
	eapply "${FILESDIR}/${PN}-2.4.6_clang.patch"
120

  
121
	use naludump && eapply "${FILESDIR}/${PN}-2.6.1_naludump.patch"
122
	use permashift && eapply "${FILESDIR}/${PN}-2.6.1-patch-for-permashift.patch"
123
	use pinplugin && eapply "${FILESDIR}/${PN}-2.6.1_pinplugin.patch"
124
	use ttxtsubs && eapply "${DISTDIR}/vdr-2.6.1_ttxtsubs_v2.patch"
125
	use menuorg && eapply "${DISTDIR}/vdr-menuorg-2.3.x.diff"
126
	use mainmenuhooks && eapply "${FILESDIR}/${PN}-2.4.1_mainmenuhook-1.0.1.patch"
127

  
128
	add_cap CAP_UTF8 \
129
		CAP_IRCTRL_RUNTIME_PARAM \
130
		CAP_VFAT_RUNTIME_PARAM \
131
		CAP_CHUID \
132
		CAP_SHUTDOWN_AUTO_RETRY
165 133

  
166
		# Now apply extensions patch
167
		eapply "${WORKDIR}/${EXT_P}.patch"
168
		sed -e 's/PERMASHIFT_V1/PERMASHIFT/g' -i "${S}"/*.[ch] "${S}"/Make.config* || die "sed failed"
169

  
170
		# This allows us to start even if some plugin does not exist
171
		# or is not loadable.
172
		enable_patch PLUGINMISSING
173

  
174
		if [[ -n ${VDR_MAINTAINER_MODE} ]]; then
175
			einfo "Doing maintainer checks:"
176

  
177
			# we do not support these patches
178
			# (or have them already hard enabled)
179
			local IGNORE_PATCHES="pluginmissing"
180

  
181
			extensions_all_defines > "${T}"/new.IUSE || die "cannot write to new.IUSE"
182
			echo $EXT_PATCH_FLAGS $EXT_PATCH_FLAGS_RENAMED_EXT_NAME \
183
					$IGNORE_PATCHES | \
184
				tr ' ' '\n' |sort > "${T}"/old.IUSE || die "cannot write to old.IUSE"
185
			local DIFFS=$(diff -u "${T}"/old.IUSE "${T}"/new.IUSE|grep '^[+-][^+-]')
186
			if [[ -z ${DIFFS} ]]; then
187
				einfo "EXT_PATCH_FLAGS are up to date."
188
			else
189
				ewarn "IUSE differences!"
190
				local diff
191
				for diff in $DIFFS; do
192
					ewarn "$diff"
193
				done
194
			fi
195
		fi
196

  
197
		ebegin "Enabling selected patches"
198
		local flag
199
		for flag in $EXT_PATCH_FLAGS; do
200
			use $flag && enable_patch ${flag}
201
		done
202

  
203
		eend 0
204

  
205
		extensions_add_make_conf
206

  
207
		# add defined use-flags compile options to vdr.pc
208
		sed -e "s:\$(CDEFINES) \$(CINCLUDES) \$(HDRDIR):\$(CDEFINES) \$(CINCLUDES) \$(HDRDIR) \$(DEFINES_IUSE):" \
209
			-i Makefile || die "sed fails on Makefile"
210

  
211
		ebegin "Make depend"
212
		emake .dependencies >/dev/null
213
		eend $? "make depend failed"
214

  
215
		eapply "${FILESDIR}/${P}_gcc7extpng.patch"
216
	fi
217

  
218
	eapply "${FILESDIR}/${P}_gcc11.patch"
219
	eapply "${FILESDIR}/${P}_gentoo.patch"
220
	eapply "${FILESDIR}/${P}_unsignedtosigned.patch"
221
	eapply "${FILESDIR}/${P}_glibc-2.24.patch"
222
	eapply "${FILESDIR}/${P}-jpeg-9c.patch"
223
	eapply "${FILESDIR}/${P}_glibc-2.31.patch"
224

  
225
	# fix some makefile issues
226
	sed -e "s:ifndef NO_KBD:ifeq (\$(USE_KBD),1):" \
227
		-e "s:ifdef BIDI:ifeq (\$(BIDI),1):" \
228
		-e "s:ifdef SDNOTIFY:ifeq (\$(SDNOTIFY),1):" \
229
		-i "${S}"/Makefile || die "sed fails on Makefile"
230

  
231
	eapply_user
232

  
233
	add_cap CAP_UTF8
234

  
235
	add_cap CAP_IRCTRL_RUNTIME_PARAM \
236
			CAP_VFAT_RUNTIME_PARAM \
237
			CAP_CHUID \
238
			CAP_SHUTDOWN_AUTO_RETRY
239

  
240
	echo -e ${CAPS} > "${CAP_FILE}"
134
	echo -e ${CAPS} > "${CAP_FILE}" || die "cannot write to CAP_FILE"
241 135

  
242 136
	# LINGUAS support
243 137
	einfo "\n \t VDR supports the LINGUAS values"
......
253 147
	fi
254 148

  
255 149
	strip-linguas ${LING_PO} en
150

  
151
	default
152
}
153

  
154
src_configure() {
155
	# support languages, written from right to left
156
	export "BIDI=$(usex bidi 1 0)"
157
	# systemd notification support
158
	export "SDNOTIFY=$(usex systemd 1 0)"
159
	# with/without keyboard
160
	export "USE_KBD=$(usex keyboard 1 0)"
161
	# detailed compile output for debug
162
	export "VERBOSE=$(usex verbose 1 0)"
256 163
}
257 164

  
258 165
src_install() {
259
	# trick makefile not to create a videodir by supplying it with an existing
260
	# directory
261
	emake install \
262
	VIDEODIR="/" \
263
	DESTDIR="${ED}" install
166
	# trick the makefile to not create a VIDEODIR by supplying it with an
167
	# existing directory
168
	emake VIDEODIR="/" DESTDIR="${ED}" install
264 169

  
265 170
	keepdir "${PLUGIN_LIBDIR}"
266 171

  
267 172
	# backup for plugins they don't be able to create this dir
268
	keepdir "${CONF_DIR}"/plugins
173
	keepdir "${CONF_DIR}/plugins"
269 174

  
270 175
	if use html; then
271 176
		local HTML_DOCS=( *.html )
272 177
	fi
273

  
274
	local DOCS=( MANUAL INSTALL README* HISTORY CONTRIBUTORS )
275

  
178
	local DOCS=( MANUAL INSTALL README* HISTORY CONTRIBUTORS UPDATE-2* )
276 179
	einstalldocs
277 180

  
278 181
	insinto /usr/share/vdr
279 182
	doins "${CAP_FILE}"
280 183

  
281
	if use alternatechannel; then
282
		insinto /etc/vdr
283
		doins "${FILESDIR}"/channel_alternative.conf
284
	fi
285

  
286
	chown -R vdr:vdr "${ED}/${CONF_DIR}" || die "chown failed"
184
	fowners vdr:vdr "${CONF_DIR}" -R
287 185
}
288 186

  
289 187
pkg_postinst() {
188
	elog "Please read the /usr/share/doc/${PF}/UPDATE-2.4"
189
	elog "for major changes in this version\n"
290 190

  
291
	elog "\n\t---- 15 YEARS ANNIVERSARY EDITON ----\n"
292
	elog "\tA lot of thanks to Klaus Schmidinger"
293
	elog "\tfor this nice piece of Software...\n"
294

  
295
	elog "It is a good idea to run vdrplugin-rebuild now."
191
	elog "It is a good idea to run vdrplugin-rebuild now.\n"
296 192

  
297 193
	elog "To get nice symbols in OSD we recommend to install"
298 194
	elog "\t1. emerge media-fonts/vdrsymbols-ttf"
299
	elog "\t2. select font VDRSymbolsSans in Setup"
300
	elog ""
195
	elog "\t2. select font VDRSymbolsSans in Setup\n"
196

  
301 197
	elog "To get an idea how to proceed now, have a look at our vdr-guide:"
302 198
	elog "\thttps://wiki.gentoo.org/wiki/VDR"
303 199
}
Thank you!