1 |
commit: 62a3a815e48df992b237d9b681ceb39f342df63a |
2 |
Author: Joerg Bornkessel <hd_brummy <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu May 26 09:03:55 2016 +0000 |
4 |
Commit: Joerg Bornkessel <hd_brummy <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu May 26 09:05:27 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=62a3a815 |
7 |
|
8 |
vdr-plugin-2.eclass: added EAPI=6 support |
9 |
|
10 |
eclass/vdr-plugin-2.eclass | 86 +++++++++++++++++++++++++--------------------- |
11 |
1 file changed, 47 insertions(+), 39 deletions(-) |
12 |
|
13 |
diff --git a/eclass/vdr-plugin-2.eclass b/eclass/vdr-plugin-2.eclass |
14 |
index ae09a34..d65f624 100644 |
15 |
--- a/eclass/vdr-plugin-2.eclass |
16 |
+++ b/eclass/vdr-plugin-2.eclass |
17 |
@@ -1,4 +1,4 @@ |
18 |
-# Copyright 1999-2015 Gentoo Foundation |
19 |
+# Copyright 1999-2016 Gentoo Foundation |
20 |
# Distributed under the terms of the GNU General Public License v2 |
21 |
# $Id$ |
22 |
|
23 |
@@ -90,7 +90,7 @@ |
24 |
# @CODE |
25 |
|
26 |
# Applying your own local/user patches: |
27 |
-# This is done by using the |
28 |
+# This is done by using the |
29 |
# (EAPI = 4,5) epatch_user() function of the eutils.eclass, |
30 |
# (EAPI = 6) eapply_user function integrated in EAPI = 6. |
31 |
# Simply add your patches into one of these directories: |
32 |
@@ -104,10 +104,7 @@ |
33 |
inherit flag-o-matic toolchain-funcs unpacker |
34 |
|
35 |
case ${EAPI:-0} in |
36 |
- 4|5) |
37 |
- ;; |
38 |
- 6) |
39 |
- ewarn "EAPI 6 support for test purpose only, plz report bugs to vdr@g.o" |
40 |
+ 4|5|6) |
41 |
;; |
42 |
*) die "EAPI ${EAPI} unsupported." |
43 |
;; |
44 |
@@ -145,6 +142,7 @@ fi |
45 |
# Called from src_install |
46 |
# file maintained by normal portage-methods |
47 |
create_plugindb_file() { |
48 |
+ #ToDo: rename this to vdr_... |
49 |
local NEW_VDRPLUGINDB_DIR=/usr/share/vdr/vdrplugin-rebuild/ |
50 |
local DB_FILE="${NEW_VDRPLUGINDB_DIR}/${CATEGORY}-${PF}" |
51 |
insinto "${NEW_VDRPLUGINDB_DIR}" |
52 |
@@ -156,6 +154,7 @@ create_plugindb_file() { |
53 |
# EBUILD=${CATEGORY}/${PN} |
54 |
# EBUILD_V=${PVR} |
55 |
# EOT |
56 |
+# obsolet? fix me later... |
57 |
{ |
58 |
echo "VDRPLUGIN_DB=1" |
59 |
echo "CREATOR=ECLASS" |
60 |
@@ -166,6 +165,7 @@ create_plugindb_file() { |
61 |
} |
62 |
|
63 |
create_header_checksum_file() { |
64 |
+ #ToDo: rename this to vdr_... |
65 |
# Danger: Not using $ROOT here, as compile will also not use it !!! |
66 |
# If vdr in $ROOT and / differ, plugins will not run anyway |
67 |
|
68 |
@@ -232,6 +232,7 @@ vdr_patchmakefile() { |
69 |
#sed -i Makefile \ |
70 |
# -e "s:^DVBDIR.*$:DVBDIR = ${DVB_INCLUDE_DIR}:" \ |
71 |
# -e 's:-I$(DVBDIR)/include:-I$(DVBDIR):' |
72 |
+ # obsolet? fix me later... |
73 |
|
74 |
if ! grep -q APIVERSION Makefile; then |
75 |
ebegin " Converting to APIVERSION" |
76 |
@@ -260,6 +261,7 @@ vdr_patchmakefile() { |
77 |
} |
78 |
|
79 |
dev_check() { |
80 |
+ # ToDo: rename this to vdr_...; IMPORTANT: check availabel plugins, if we use this function in the tree... |
81 |
# A lot useful debug infos |
82 |
# set VDR_MAINTAINER_MODE="1" in make.conf |
83 |
if [[ -n ${VDR_MAINTAINER_MODE} ]]; then |
84 |
@@ -268,6 +270,7 @@ dev_check() { |
85 |
} |
86 |
|
87 |
gettext_missing() { |
88 |
+ #ToDo: rename this to vdr_... |
89 |
# plugins without converting to gettext |
90 |
|
91 |
local GETTEXT_MISSING=$( grep xgettext Makefile ) |
92 |
@@ -277,6 +280,7 @@ gettext_missing() { |
93 |
} |
94 |
|
95 |
detect_po_dir() { |
96 |
+ # ToDo: rename this to vdr_... |
97 |
# helper function |
98 |
|
99 |
[[ -f po ]] && local po_dir="${S}" |
100 |
@@ -287,9 +291,10 @@ detect_po_dir() { |
101 |
} |
102 |
|
103 |
linguas_support() { |
104 |
+ # ToDo: rename this to vdr_... |
105 |
# Patching Makefile for linguas support. |
106 |
# Only locales, enabled through the LINGUAS (make.conf) variable will be |
107 |
-# "compiled" and installed. |
108 |
+# compiled and installed. |
109 |
|
110 |
einfo "Patching for Linguas support" |
111 |
einfo "available Languages for ${P} are:" |
112 |
@@ -311,12 +316,9 @@ linguas_support() { |
113 |
vdr_i18n() { |
114 |
# i18n handling was deprecated since >=media-video/vdr-1.5.9, |
115 |
# finally with >=media-video/vdr-1.7.27 it has been dropped entirely and some |
116 |
-# plugins will fail to "compile" because they're still using the old variant. |
117 |
+# plugins will fail to compile because they're still using the old variant. |
118 |
# Simply remove the i18n.o object from Makefile (OBJECT) and |
119 |
# remove "static const tI18nPhrase*" from i18n.h. |
120 |
-# |
121 |
-# Plugins that are still using the old method will be pmasked until they're |
122 |
-# fixed or in case of maintainer timeout they'll be masked for removal. |
123 |
|
124 |
gettext_missing |
125 |
|
126 |
@@ -348,6 +350,7 @@ vdr_i18n() { |
127 |
} |
128 |
|
129 |
remove_i18n_include() { |
130 |
+ # ToDo: rename this to vdr_...; IMPORTANT!!! We use this in the tree |
131 |
# remove uneeded i18.n includes |
132 |
|
133 |
local f |
134 |
@@ -391,6 +394,7 @@ vdr-plugin-2_pkg_setup() { |
135 |
|
136 |
# Plugins need to be compiled with position independent code, otherwise linking |
137 |
# VDR against it will fail |
138 |
+ # depricated if fi, as we have only >=vdr-2 in the tree, fix me later... |
139 |
if has_version ">=media-video/vdr-1.7.13"; then |
140 |
append-cxxflags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE |
141 |
fi |
142 |
@@ -452,15 +456,15 @@ vdr-plugin-2_src_util() { |
143 |
unpacker_src_unpack |
144 |
;; |
145 |
add_local_patch) |
146 |
- cd "${S}" || die "Could not change to plugin-source-directory!" |
147 |
- if [[ ${EAPI} == 6 ]]; then |
148 |
+ cd "${S}" || die "Could not change to plugin-source-directory (src_util)" |
149 |
+ if [[ ${EAPI} != [45] ]]; then |
150 |
eapply_user |
151 |
else |
152 |
epatch_user |
153 |
fi |
154 |
;; |
155 |
patchmakefile) |
156 |
- cd "${S}" || die "Could not change to plugin-source-directory!" |
157 |
+ cd "${S}" || die "Could not change to plugin-source-directory (src_util)" |
158 |
vdr_patchmakefile |
159 |
;; |
160 |
i18n) |
161 |
@@ -500,7 +504,9 @@ vdr-plugin-2_src_prepare() { |
162 |
die "vdr-plugin-2_src_prepare not called!" |
163 |
fi |
164 |
|
165 |
- [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}" |
166 |
+ [[ ${EAPI} == [45] ]] && [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}" |
167 |
+ [[ ${EAPI} != [45] ]] && [[ ${PATCHES[@]} ]] && eapply "${PATCHES[@]}" |
168 |
+ |
169 |
debug-print "$FUNCNAME: applying user patches" |
170 |
|
171 |
vdr-plugin-2_src_util prepare |
172 |
@@ -520,16 +526,14 @@ vdr-plugin-2_src_compile() { |
173 |
eerror "Please report this at bugs.gentoo.org." |
174 |
die "vdr-plugin-2_src_compile not called!" |
175 |
fi |
176 |
- cd "${S}" |
177 |
- |
178 |
- BUILD_TARGETS=${BUILD_TARGETS:-${VDRPLUGIN_MAKE_TARGET:-all }} |
179 |
- emake ${BUILD_PARAMS} \ |
180 |
- ${BUILD_TARGETS} \ |
181 |
- LOCALEDIR="${TMP_LOCALE_DIR}" \ |
182 |
- LOCDIR="${TMP_LOCALE_DIR}" \ |
183 |
- LIBDIR="${S}" \ |
184 |
- TMPDIR="${T}" \ |
185 |
- || die "emake failed" |
186 |
+ cd "${S}" || die "could not change to plugin source directory (src_compile)" |
187 |
+ |
188 |
+ emake all ${BUILD_PARAMS} \ |
189 |
+ LOCALEDIR="${TMP_LOCALE_DIR}" \ |
190 |
+ LOCDIR="${TMP_LOCALE_DIR}" \ |
191 |
+ LIBDIR="${S}" \ |
192 |
+ TMPDIR="${T}" \ |
193 |
+ || die "emake all failed" |
194 |
;; |
195 |
esac |
196 |
|
197 |
@@ -546,7 +550,7 @@ vdr-plugin-2_src_install() { |
198 |
die "vdr-plugin-2_src_install not called!" |
199 |
fi |
200 |
|
201 |
- cd "${WORKDIR}" |
202 |
+ cd "${WORKDIR}" || die "could not change to plugin workdir directory (src_install)" |
203 |
|
204 |
if [[ -n ${VDR_MAINTAINER_MODE} ]]; then |
205 |
local mname="${P}-Makefile" |
206 |
@@ -566,16 +570,15 @@ vdr-plugin-2_src_install() { |
207 |
|
208 |
fi |
209 |
|
210 |
- cd "${S}" |
211 |
+ cd "${S}" || die "could not change to plugin source directory (src_install)" |
212 |
|
213 |
local SOFILE_STRING=$(grep SOFILE Makefile) |
214 |
if [[ -n ${SOFILE_STRING} ]]; then |
215 |
- BUILD_TARGETS=${BUILD_TARGETS:-${VDRPLUGIN_MAKE_TARGET:-install }} |
216 |
- einstall ${BUILD_PARAMS} \ |
217 |
- ${BUILD_TARGETS} \ |
218 |
- TMPDIR="${T}" \ |
219 |
- DESTDIR="${D}" \ |
220 |
- || die "einstall (makefile target) failed" |
221 |
+ emake install \ |
222 |
+ ${BUILD_PARAMS} \ |
223 |
+ TMPDIR="${T}" \ |
224 |
+ DESTDIR="${D}" \ |
225 |
+ || die "emake install (makefile target) failed" |
226 |
else |
227 |
dev_check "Plugin use still the old Makefile handling" |
228 |
insinto "${VDR_PLUGIN_DIR}" |
229 |
@@ -584,7 +587,7 @@ vdr-plugin-2_src_install() { |
230 |
|
231 |
if [[ -d ${TMP_LOCALE_DIR} ]]; then |
232 |
einfo "Installing locales" |
233 |
- cd "${TMP_LOCALE_DIR}" |
234 |
+ cd "${TMP_LOCALE_DIR}" || die "could not change to TMP_LOCALE_DIR" |
235 |
|
236 |
local linguas |
237 |
for linguas in ${LINGUAS[*]}; do |
238 |
@@ -593,7 +596,7 @@ vdr-plugin-2_src_install() { |
239 |
done |
240 |
fi |
241 |
|
242 |
- cd "${D}/usr/$(get_libdir)/vdr/plugins" |
243 |
+ cd "${D}/usr/$(get_libdir)/vdr/plugins" || die "could not change to D/usr/libdir/vdr/plugins" |
244 |
|
245 |
# create list of all created plugin libs |
246 |
vdr_plugin_list="" |
247 |
@@ -604,14 +607,19 @@ vdr-plugin-2_src_install() { |
248 |
vdr_plugin_list="${vdr_plugin_list} ${p_name}" |
249 |
done |
250 |
|
251 |
- cd "${S}" |
252 |
+ cd "${S}" || die "could not change to plugin source directory (src_install)" |
253 |
|
254 |
create_header_checksum_file ${vdr_plugin_list} |
255 |
create_plugindb_file ${vdr_plugin_list} |
256 |
|
257 |
- local docfile |
258 |
- for docfile in README* HISTORY CHANGELOG; do |
259 |
- [[ -f ${docfile} ]] && dodoc ${docfile} |
260 |
+ local commondoc=( README* HISTORY CHANGELOG ) |
261 |
+ for docfile in "${commondoc[@]}"; do |
262 |
+ if [[ ${EAPI} == "6" ]]; then |
263 |
+ local DOCS="${DOCS} ${docfile}" |
264 |
+ [[ -f ${docfile} ]] && einstalldocs "${DOCS[@]}" |
265 |
+ else |
266 |
+ [[ -f ${docfile} ]] && dodoc ${docfile} |
267 |
+ fi |
268 |
done |
269 |
|
270 |
# if VDR_CONFD_FILE is empty and ${FILESDIR}/confd exists take it |