Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/udev/
Date: Sun, 30 Apr 2017 17:23:17
Message-Id: 1493572989.e53ac2698567f4699f24f27630592fcfb0938015.floppym@gentoo
1 commit: e53ac2698567f4699f24f27630592fcfb0938015
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Sun Apr 30 17:22:57 2017 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Sun Apr 30 17:23:09 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e53ac269
7
8 sys-fs/udev: convert to meson
9
10 Package-Manager: Portage-2.3.5_p31, Repoman-2.3.2_p61
11
12 sys-fs/udev/udev-9999.ebuild | 229 +++++++++++++++++++------------------------
13 1 file changed, 99 insertions(+), 130 deletions(-)
14
15 diff --git a/sys-fs/udev/udev-9999.ebuild b/sys-fs/udev/udev-9999.ebuild
16 index ef90718a236..43e3e7cc2cc 100644
17 --- a/sys-fs/udev/udev-9999.ebuild
18 +++ b/sys-fs/udev/udev-9999.ebuild
19 @@ -3,7 +3,7 @@
20
21 EAPI=6
22
23 -inherit autotools bash-completion-r1 linux-info multilib-minimal toolchain-funcs udev user versionator
24 +inherit bash-completion-r1 linux-info multilib-minimal multiprocessing toolchain-funcs udev user versionator
25
26 if [[ ${PV} = 9999* ]]; then
27 EGIT_REPO_URI="https://github.com/systemd/systemd.git"
28 @@ -44,6 +44,9 @@ COMMON_DEPEND=">=sys-apps/util-linux-2.27.1[${MULTILIB_USEDEP}]
29 DEPEND="${COMMON_DEPEND}
30 dev-util/gperf
31 >=dev-util/intltool-0.50
32 + >=dev-util/meson-0.40.0
33 + dev-util/ninja
34 + dev-util/patchelf
35 >=sys-apps/coreutils-8.16
36 virtual/os-headers
37 virtual/pkgconfig
38 @@ -119,14 +122,9 @@ src_prepare() {
39 # change rules back to group uucp instead of dialout for now wrt #454556
40 sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die
41
42 - # stub out the am_path_libcrypt function
43 - echo 'AC_DEFUN([AM_PATH_LIBGCRYPT],[:])' > m4/gcrypt.m4
44 -
45 # apply user patches
46 eapply_user
47
48 - eautoreconf
49 -
50 if ! [[ ${PV} = 9999* ]]; then
51 check_default_rules
52 fi
53 @@ -137,167 +135,138 @@ src_prepare() {
54 fi
55 }
56
57 +meson_multilib_native_use() {
58 + if multilib_is_native_abi && use "$1"; then
59 + echo true
60 + else
61 + echo false
62 + fi
63 +}
64 +
65 +multilib_src_configure() {
66 + local myconf=(
67 + --buildtype=plain
68 + --libdir="$(get_libdir)"
69 + --localstatedir="${EPREFIX}/var"
70 + --prefix="${EPREFIX}/usr"
71 + --sysconfdir="${EPREFIX}/etc"
72 + -Dacl=$(meson_multilib_native_use acl)
73 + -Defi=false
74 + -Dkmod=$(meson_multilib_native_use kmod)
75 + -Dselinux=$(meson_multilib_native_use selinux)
76 + -Dsplit-usr=true
77 + )
78 + set -- meson "${myconf[@]}" "${S}"
79 + echo "$@"
80 + "$@" || die
81 +}
82 +
83 src_configure() {
84 # Prevent conflicts with i686 cross toolchain, bug 559726
85 tc-export AR CC NM OBJCOPY RANLIB
86 multilib-minimal_src_configure
87 }
88
89 -multilib_src_configure() {
90 - tc-export CC #463846
91 - export cc_cv_CFLAGS__flto=no #502950
92 - export cc_cv_CFLAGS__Werror_shadow=no #554454
93 - export cc_cv_LDFLAGS__Wl__fuse_ld_gold=no #573874
94 -
95 - # Keep sorted by ./configure --help and only pass --disable flags
96 - # when *required* to avoid external deps or unnecessary compile
97 - local econf_args
98 - econf_args=(
99 - --libdir=/usr/$(get_libdir)
100 - --docdir=/usr/share/doc/${PF}
101 - --disable-nls
102 - --disable-dbus
103 - $(multilib_native_use_enable kmod)
104 - --disable-xkbcommon
105 - --disable-seccomp
106 - $(multilib_native_use_enable selinux)
107 - --disable-xz
108 - --disable-lz4
109 - --disable-pam
110 - $(multilib_native_use_enable acl)
111 - --disable-gcrypt
112 - --disable-audit
113 - --disable-libcryptsetup
114 - --disable-qrencode
115 - --disable-microhttpd
116 - --disable-gnuefi
117 - --disable-gnutls
118 - --disable-libcurl
119 - --disable-libidn
120 - --disable-quotacheck
121 - --disable-logind
122 - --disable-polkit
123 - --disable-myhostname
124 - $(multilib_is_native_abi || echo "--disable-manpages")
125 - --enable-split-usr
126 - --without-python
127 - --with-bashcompletiondir="$(get_bashcompdir)"
128 - --with-rootprefix=
129 - $(multilib_is_native_abi && echo "--with-rootlibdir=/$(get_libdir)")
130 - --disable-elfutils
131 - )
132 -
133 - if ! multilib_is_native_abi; then
134 - econf_args+=(
135 - MOUNT_{CFLAGS,LIBS}=' '
136 - )
137 +eninja() {
138 + if [[ -z ${NINJAOPTS+set} ]]; then
139 + NINJAOPTS="-j$(makeopts_jobs) -l$(makeopts_loadavg "${MAKEOPTS}" 0)"
140 fi
141 -
142 - ECONF_SOURCE=${S} econf "${econf_args[@]}"
143 + set -- ninja -v ${NINJAOPTS} "$@"
144 + echo "$@"
145 + "$@" || die
146 }
147
148 multilib_src_compile() {
149 - echo 'BUILT_SOURCES: $(BUILT_SOURCES)' > "${T}"/Makefile.extra
150 - emake -f Makefile -f "${T}"/Makefile.extra BUILT_SOURCES
151 + # meson creates this link
152 + local libudev=$(readlink src/libudev/libudev.so.1)
153
154 - # Most of the parallel build problems were solved by >=sys-devel/make-3.82-r4,
155 - # but not everything -- separate building of the binaries as a workaround,
156 - # which will force internal libraries required for the helpers to be built
157 - # early enough, like eg. libsystemd-shared.la
158 + local targets=(
159 + src/libudev/${libudev}
160 + )
161 if multilib_is_native_abi; then
162 - local lib_targets=( libudev.la )
163 - emake "${lib_targets[@]}"
164 -
165 - local exec_targets=(
166 + targets+=(
167 systemd-udevd
168 udevadm
169 - )
170 - emake "${exec_targets[@]}"
171 -
172 - local helper_targets=(
173 - ata_id
174 - cdrom_id
175 - collect
176 - scsi_id
177 - v4l_id
178 - mtd_probe
179 - )
180 - emake "${helper_targets[@]}"
181 -
182 - local man_targets=(
183 + src/udev/ata_id
184 + src/udev/cdrom_id
185 + src/udev/collect
186 + src/udev/mtd_probe
187 + src/udev/scsi_id
188 + src/udev/v4l_id
189 man/udev.conf.5
190 man/systemd.link.5
191 + man/hwdb.7
192 man/udev.7
193 man/systemd-udevd.service.8
194 man/udevadm.8
195 )
196 - emake "${man_targets[@]}"
197 - else
198 - local lib_targets=( libudev.la )
199 - emake "${lib_targets[@]}"
200 fi
201 + ninja -v "${targets[@]}" || die
202 +}
203 +
204 +# meson uses an private python script for this
205 +strip_rpath() {
206 + local x
207 + for x; do
208 + patchelf --remove-rpath "${x}" || die
209 + done
210 }
211
212 multilib_src_install() {
213 + local libudev=$(readlink src/libudev/libudev.so.1)
214 +
215 + into /
216 + strip_rpath src/libudev/${libudev}
217 + dolib.so src/libudev/{${libudev},libudev.so.1,libudev.so}
218 +
219 + insinto "/usr/$(get_libdir)/pkgconfig"
220 + doins src/libudev/libudev.pc
221 +
222 if multilib_is_native_abi; then
223 - local targets=(
224 - install-includeHEADERS
225 - install-rootbinPROGRAMS
226 - install-rootlibLTLIBRARIES
227 - install-rootlibexecPROGRAMS
228 - install-udevlibexecPROGRAMS
229 - install-dist_udevconfDATA
230 - install-dist_udevrulesDATA
231 - install-pkgconfiglibDATA
232 - install-pkgconfigdataDATA
233 - install-dist_docDATA
234 - install-directories-hook
235 - install-dist_bashcompletionDATA
236 - install-dist_networkDATA
237 - rootlibexec_PROGRAMS=systemd-udevd
238 - rootbin_PROGRAMS=udevadm
239 - rootlib_LTLIBRARIES="libudev.la"
240 - pkgconfiglib_DATA="src/libudev/libudev.pc"
241 - pkgconfigdata_DATA="src/udev/udev.pc"
242 - INSTALL_DIRS='$(sysconfdir)/udev/rules.d $(sysconfdir)/udev/hwdb.d $(sysconfdir)/systemd/network'
243 - dist_bashcompletion_DATA="shell-completion/bash/udevadm"
244 - dist_network_DATA="network/99-default.link"
245 - )
246 - emake -j1 DESTDIR="${D}" "${targets[@]}"
247 - doman man/{udev.conf.5,systemd.link.5,udev.7,systemd-udevd.service.8,udevadm.8}
248 + into /
249 + strip_rpath udevadm
250 + dobin udevadm
251
252 - # Compatibility symlink for software that looks for libudev.so
253 - # without using pkg-config
254 - dosym ../../$(get_libdir)/libudev.so.1 \
255 - /usr/$(get_libdir)/libudev.so
256 - else
257 - local targets=(
258 - install-libLTLIBRARIES
259 - install-includeHEADERS
260 - install-pkgconfiglibDATA
261 - lib_LTLIBRARIES="libudev.la"
262 - pkgconfiglib_DATA="src/libudev/libudev.pc"
263 - include_HEADERS="src/libudev/libudev.h"
264 - )
265 + exeinto /lib/systemd
266 + strip_rpath systemd-udevd
267 + doexe systemd-udevd
268 +
269 + exeinto /lib/udev
270 + strip_rpath src/udev/{ata_id,cdrom_id,collect,mtd_probe,scsi_id,v4l_id}
271 + doexe src/udev/{ata_id,cdrom_id,collect,mtd_probe,scsi_id,v4l_id}
272 +
273 + rm rules/99-systemd.rules || die
274 + insinto /lib/udev/rules.d
275 + doins rules/*.rules
276
277 - emake -j1 DESTDIR="${D}" "${targets[@]}"
278 + insinto /usr/share/pkgconfig
279 + doins src/udev/udev.pc
280 +
281 + mv man/systemd-udevd.service.8 man/systemd-udevd.8 || die
282 + rm man/systemd-udevd-{control,kernel}.socket.8 || die
283 + doman man/*.[0-9]
284 fi
285 }
286
287 multilib_src_install_all() {
288 - dodoc TODO
289 + doheader src/libudev/libudev.h
290 +
291 + insinto /etc/udev
292 + doins src/udev/udev.conf
293
294 - prune_libtool_files --all
295 - rm -f "${D}"/lib/udev/rules.d/99-systemd.rules
296 - rm -f "${D}"/usr/share/doc/${PF}/{LICENSE.*,GVARIANT-SERIALIZATION,DIFFERENCES,PORTING-DBUS1,sd-shutdown.h}
297 + insinto /lib/systemd/network
298 + doins network/99-default.link
299
300 # see src_prepare() for content of 40-gentoo.rules
301 insinto /lib/udev/rules.d
302 doins "${T}"/40-gentoo.rules
303
304 - # maintainer note: by not letting the upstream build-sys create the .so
305 - # link, you also avoid a parallel make problem
306 - mv "${D}"/usr/share/man/man8/systemd-udevd{.service,}.8
307 + dobashcomp shell-completion/bash/udevadm
308 +
309 + insinto /usr/share/zsh/site-functions
310 + doins shell-completion/zsh/_udevadm
311 +
312 + einstalldocs
313 }
314
315 pkg_postinst() {