Gentoo Archives: gentoo-dev

From: Sam James <sam@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH] gstreamer-meson.eclass: New eclass required for gstreamer-1.18.0+
Date: Wed, 17 Mar 2021 01:57:34
Message-Id: 094FA9B1-F288-4287-B9CF-7D47A479F34D@gentoo.org
In Reply to: [gentoo-dev] [PATCH] gstreamer-meson.eclass: New eclass required for gstreamer-1.18.0+ by "Haelwenn (lanodan) Monnier"
1 > On 17 Mar 2021, at 01:49, Haelwenn (lanodan) Monnier <contact@×××××××××.me> wrote:
2 >
3 > Gstreamer switched to meson in 1.16.0 and removed autotools support in 1.18.0,
4 > this eclass is an update of gstreamer.eclass.
5 >
6 > [snip]
7
8 Thanks for working on this!
9
10 > +#
11 > +# GStreamer consuming applications should depend on the specific plugins
12 > +# they need as defined in their source code. Usually you can find that
13 > +# out by grepping the source tree for 'factory_make'. If it uses playbin
14 > +# plugin, consider adding media-plugins/gst-plugins-meta dependency, but
15 > +# also list any packages that provide explicitly requested plugins.
16 > +
17 > +inherit eutils multilib meson multilib-minimal toolchain-funcs versionator xdg-utils
18
19 Do we need eutils here?
20
21 > +
22 > +case "${EAPI:-0}" in
23 > + 5|6)
24 > + ;;
25 > + 0|1|2|3|4)
26 > + die "EAPI=\"${EAPI:-0}\" is not supported anymore"
27 > + ;;
28 > + *)
29 > + die "EAPI=\"${EAPI}\" is not supported yet"
30 > + ;;
31 > +esac
32
33 EAPI 7?
34
35 > [snip]
36
37 > +
38 > +# Even though xz-utils are in @system, they must still be added to DEPEND; see
39 > +# https://archives.gentoo.org/gentoo-dev/msg_a0d4833eb314d1be5d5802a3b710e0a4.xml
40 > +if [[ ${GST_TARBALL_SUFFIX} == "xz" ]]; then
41 > + DEPEND="${DEPEND} app-arch/xz-utils"
42 > +fi
43 > +
44
45 BDEPEND in EAPI 7.
46
47 > [snip]
48
49 > +DEPEND="
50 > + >=sys-apps/sed-4
51 > + >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
52 > +"
53 > +
54
55 BDEPEND in EAPI 7.
56
57 > [snip]
58 > +else
59 > + IUSE="nls"
60 > + DEPEND="${DEPEND} nls? ( >=sys-devel/gettext-0.17 )"
61
62 BDEPEND in EAPI 7 unless we’re really building against gettext.
63 >
64 > +
65 > +read -d '' __MESON_EXTRACT_TARGET_FILENAME <<"EOF"
66 > +import json
67 > +import sys
68 > +
69 > +with open("meson-info/intro-targets.json", "r") as targets_file:
70 > + data = json.load(targets_file)
71 > +
72 > +for i in range(len(data)):
73 > + target = data[i]
74 > + if target['installed']:
75 > + if sys.argv[1] in target['filename'][0]:
76 > + print(target['filename'][0] + ':' + target['install_filename'][0])
77 > +EOF
78 > +
79
80 It seems kind of odd to me to do this in global scope.
81
82 > +# @FUNCTION: _gstreamer_get_target_filename
83 > +# @INTERNAL
84 > +# @DESCRIPTION:
85 > +# Extracts build and target filenames from meson-data for given submatch
86 > +_gstreamer_get_target_filename() {
87 > + python -c "${__MESON_EXTRACT_TARGET_FILENAME}" "$@"
88 > +}
89
90 || die on external commands. We probably want ${EPYTHON} and to use
91 a Python eclass here.
92
93 > +
94 > +# @FUNCTION: gstreamer_multilib_src_compile
95 > +# @DESCRIPTION:
96 > +# Compiles requested gstreamer plugin.
97 > +gstreamer_multilib_src_compile() {
98 > + local plugin_dir plugin
99 > +
100 > + for plugin_dir in ${GST_PLUGINS_BUILD_DIR} ; do
101
102 “${GST_PLUGINS_BUILD_DIR}"
103
104 > + plugin=$(_gstreamer_get_target_filename $(gstreamer_get_plugin_dir ${plugin_dir}))
105 > + plugin_path="${plugin%%:*}"
106 > + eninja "${plugin_path/"${BUILD_DIR}/"}"
107
108 No need for double quoting?
109
110 > +# @FUNCTION: gstreamer_multilib_src_install_all
111 > +# @DESCRIPTION:
112 > +# Installs documentation for requested gstreamer plugin, and removes .la
113 > +# files.
114 > +gstreamer_multilib_src_install_all() {
115 > + local plugin_dir
116 > +
117 > + for plugin_dir in ${GST_PLUGINS_BUILD_DIR} ; do
118 > + local dir=$(gstreamer_get_plugin_dir ${plugin_dir})
119 > + [[ -e ${dir}/README ]] && dodoc "${dir}"/README
120 > + done
121 > +
122 > + prune_libtool_files --modules
123
124 Deprecated in newer EAPIs, let’s do it manually.
125
126 > +}
127 > --
128 > 2.26.2
129 >
130 >

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies