Сравнение vdr-2.2.0-r7 с tremc-0.9.3_p20230506

/usr/portage/net-p2p/tremc/tremc-0.9.3_p20230506.ebuild 2024-12-25 14:59:52.667270180 +0300
1
# Copyright 2022-2024 Gentoo Authors
1
# Copyright 1999-2024 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
6
COMMIT=d8deaa5ac25bb45a2ca3a930309d6ecc74836a54
7
PYTHON_COMPAT=( python3_{10..13} )
8
PYTHON_REQ_USE="ncurses"
7 9

  
8
# Switches supported by extensions-patch
9
EXT_PATCH_FLAGS="alternatechannel graphtft naludump permashift pinplugin
10
				mainmenuhooks menuorg menuselection resumereset ttxtsubs"
10
inherit bash-completion-r1 optfeature python-single-r1
11 11

  
12
# names of the use-flags
13
EXT_PATCH_FLAGS_RENAMED=""
12
DESCRIPTION="Ncurses interface for the Transmission BitTorrent client"
13
HOMEPAGE="https://github.com/tremc/tremc"
14
SRC_URI="https://github.com/tremc/${PN}/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
15
S="${WORKDIR}/${PN}-${COMMIT}"
14 16

  
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

  
21
EXT_P="extpng-${P}-gentoo-edition-v1"
22

  
23
DESCRIPTION="Video Disk Recorder - turns a pc into a powerful set top box for DVB"
24
HOMEPAGE="http://www.tvdr.de/"
25
SRC_URI="ftp://ftp.tvdr.de/vdr/${MY_P}.tar.bz2
26
	mirror://gentoo/${EXT_P}.patch.bz2"
27
S="${WORKDIR}/${MY_P}"
28

  
29
LICENSE="GPL-2+"
17
LICENSE="GPL-3"
30 18
SLOT="0"
31
KEYWORDS="amd64 ~arm ~arm64 ~ppc x86"
32
IUSE="bidi debug keyboard html systemd vanilla ${EXT_PATCH_FLAGS} ${EXT_PATCH_FLAGS_RENAMED}"
33

  
34
COMMON_DEPEND="
35
	media-libs/libjpeg-turbo
36
	sys-libs/libcap
37
	>=media-libs/fontconfig-2.4.2
38
	>=media-libs/freetype-2"
39
DEPEND="${COMMON_DEPEND}
40
	sys-kernel/linux-headers"
41
RDEPEND="${COMMON_DEPEND}
42
	dev-lang/perl
43
	>=media-tv/gentoo-vdr-scripts-2.7
44
	media-fonts/corefonts
45
	bidi? ( dev-libs/fribidi )
46
	systemd? ( sys-apps/systemd )"
47
BDEPEND="sys-devel/gettext
48
	virtual/pkgconfig"
49

  
50
CONF_DIR="/etc/vdr"
51
CAP_FILE="${S}/capabilities.sh"
52
CAPS="# Capabilities of the vdr-executable for use by startscript etc."
53

  
54
pkg_setup() {
55
	use debug && append-flags -g
56

  
57
	PLUGIN_LIBDIR="/usr/$(get_libdir)/vdr/plugins"
58

  
59
	tc-export CC CXX AR
60
}
61

  
62
add_cap() {
63
	local arg
64
	for arg; do
65
		CAPS="${CAPS}\n${arg}=1"
66
	done
67
}
68

  
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
lang_po() {
98
	LING_PO=$( ls "${S}"/po | sed -e "s:.po::g" | cut -d_ -f1 | tr \\\012 ' ' )
99
}
100

  
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
src_prepare() {
111
	# apply maintenance-patches
112
	ebegin "Changing paths for gentoo"
113

  
114
	local DVBDIR="/usr/include"
115
	local i
116
	for i in ${DVB_HEADER_PATH} /usr/include/v4l-dvb-hg /usr/include; do
117
		[[ -d ${i} ]] || continue
118
		if [[ -f ${i}/linux/dvb/dmx.h ]]; then
119
			einfo "Found DVB header files in ${i}"
120
			DVBDIR="${i}"
121
			break
122
		fi
123
	done
124

  
125
	# checking for s2api headers
126
	local api_version
127
	api_version=$(awk -F' ' '/define DVB_API_VERSION / {print $3}' "${DVBDIR}"/linux/dvb/version.h)
128
	api_version=${api_version}*$(awk -F' ' '/define DVB_API_VERSION_MINOR / {print $3}' "${DVBDIR}"/linux/dvb/version.h)
129

  
130
	if [[ ${api_version:-0} -lt 5*3 ]]; then
131
		eerror "DVB header files do not contain s2api support or too old for ${P}"
132
		eerror "You cannot compile VDR against old dvb-header"
133
		die "DVB headers too old"
134
	fi
135

  
136
	cat > Make.config <<-EOT || die "cannot write to Make.config"
137
		#
138
		# Generated by ebuild ${PF}
139
		#
140
		PREFIX			= /usr
141
		DVBDIR			= ${DVBDIR}
142
		PLUGINLIBDIR	= ${PLUGIN_LIBDIR}
143
		CONFDIR			= ${CONF_DIR}
144
		VIDEODIR		= /var/vdr/video
145
		LOCDIR			= \$(PREFIX)/share/locale
146
		INCDIR			= \$(PREFIX)/include
147

  
148
		DEFINES			+= -DCONFDIR=\"\$(CONFDIR)\"
149
		INCLUDES		+= -I\$(DVBDIR)
150

  
151
		# >=vdr-1.7.36-r1; parameter only used for compiletime on vdr
152
		# PLUGINLIBDIR (plugin Makefile old) = LIBDIR (plugin Makefile new)
153
		LIBDIR			= ${PLUGIN_LIBDIR}
154
		PCDIR			= /usr/$(get_libdir)/pkgconfig
155

  
156
	EOT
157
	eend 0
158

  
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
19
KEYWORDS="~amd64 ~x86"
20
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
163 21

  
164
	if ! use vanilla; then
22
RDEPEND="${PYTHON_DEPS}"
165 23

  
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}"
241

  
242
	# LINGUAS support
243
	einfo "\n \t VDR supports the LINGUAS values"
244

  
245
	lang_po
246

  
247
	einfo "\t Please set one of this values in your sytem make.conf"
248
	einfo "\t LINGUAS=\"${LING_PO}\"\n"
249

  
250
	if [[ -z ${LINGUAS} ]]; then
251
		einfo "\n \t No values in LINGUAS="
252
		einfo "\t You will get only english text on OSD \n"
253
	fi
254

  
255
	strip-linguas ${LING_PO} en
24
# Github tag tarballs include the repo with commit in the dir's name
25
# Specify a no-op src_compile so upstream's broken Makefile doesn't get used
26
src_compile() {
27
	:
256 28
}
257 29

  
258 30
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
264

  
265
	keepdir "${PLUGIN_LIBDIR}"
266

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

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

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

  
276
	einstalldocs
277

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

  
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"
31
	python_doscript tremc
32
	newbashcomp completion/bash/tremc.sh tremc
33
	insinto /usr/share/zsh/site-functions
34
	doins completion/zsh/_tremc
35
	doman tremc.1
36
	dodoc NEWS README.md
287 37
}
288 38

  
289 39
pkg_postinst() {
290

  
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."
296

  
297
	elog "To get nice symbols in OSD we recommend to install"
298
	elog "\t1. emerge media-fonts/vdrsymbols-ttf"
299
	elog "\t2. select font VDRSymbolsSans in Setup"
300
	elog ""
301
	elog "To get an idea how to proceed now, have a look at our vdr-guide:"
302
	elog "\thttps://wiki.gentoo.org/wiki/VDR"
40
	optfeature "Extract ipv4 from ipv6 addresses" dev-python/ipy
41
	optfeature "Clipboard support" dev-python/pyperclip
303 42
}
Спасибо!