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-apps/systemd/
Date: Thu, 27 Apr 2017 03:16:32
Message-Id: 1493262984.aca83fb5f0521880ac0970ccda90a83e74351ac1.floppym@gentoo
1 commit: aca83fb5f0521880ac0970ccda90a83e74351ac1
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Thu Apr 27 02:58:44 2017 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Thu Apr 27 03:16:24 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aca83fb5
7
8 sys-apps/systemd: initial meson conversion
9
10 sys-apps/systemd/systemd-9999.ebuild | 215 ++++++++++++++---------------------
11 1 file changed, 85 insertions(+), 130 deletions(-)
12
13 diff --git a/sys-apps/systemd/systemd-9999.ebuild b/sys-apps/systemd/systemd-9999.ebuild
14 index 76a3dd24f6d..ab38fcea7b1 100644
15 --- a/sys-apps/systemd/systemd-9999.ebuild
16 +++ b/sys-apps/systemd/systemd-9999.ebuild
17 @@ -14,7 +14,7 @@ fi
18
19 PYTHON_COMPAT=( python{3_4,3_5,3_6} )
20
21 -inherit autotools bash-completion-r1 linux-info multilib-minimal pam python-any-r1 systemd toolchain-funcs udev user
22 +inherit bash-completion-r1 linux-info multilib-minimal multiprocessing pam python-any-r1 systemd toolchain-funcs udev user
23
24 DESCRIPTION="System and service manager for Linux"
25 HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd"
26 @@ -89,6 +89,8 @@ DEPEND="${COMMON_DEPEND}
27 app-arch/xz-utils:0
28 dev-util/gperf
29 >=dev-util/intltool-0.50
30 + >=dev-util/meson-0.40.0
31 + dev-util/ninja
32 >=sys-apps/coreutils-8.16
33 >=sys-kernel/linux-headers-${MINKV}
34 virtual/pkgconfig
35 @@ -163,16 +165,9 @@ src_prepare() {
36 [[ -d "${WORKDIR}"/patches ]] && PATCHES+=( "${WORKDIR}"/patches )
37
38 default
39 -
40 - eautoreconf
41 }
42
43 src_configure() {
44 - # Keep using the one where the rules were installed.
45 - MY_UDEVDIR=$(get_udevdir)
46 - # Fix systems broken by bug #509454.
47 - [[ ${MY_UDEVDIR} ]] || MY_UDEVDIR=/lib/udev
48 -
49 # Prevent conflicts with i686 cross toolchain, bug 559726
50 tc-export AR CC NM OBJCOPY RANLIB
51
52 @@ -181,148 +176,106 @@ src_configure() {
53 multilib-minimal_src_configure
54 }
55
56 +meson_use() {
57 + usex "$1" true false
58 +}
59 +
60 +meson_ml() {
61 + if multilib_is_native_abi; then
62 + echo true
63 + else
64 + echo false
65 + fi
66 +}
67 +
68 +meson_ml_use() {
69 + if multilib_is_native_abi; then
70 + usex "$1" true false
71 + else
72 + echo false
73 + fi
74 +}
75 +
76 multilib_src_configure() {
77 - local myeconfargs=(
78 - # disable -flto since it is an optimization flag
79 - # and makes distcc less effective
80 - cc_cv_CFLAGS__flto=no
81 - # disable -fuse-ld=gold since Gentoo supports explicit linker
82 - # choice and forcing gold is undesired, #539998
83 - # ld.gold may collide with user's LDFLAGS, #545168
84 - # ld.gold breaks sparc, #573874
85 - cc_cv_LDFLAGS__Wl__fuse_ld_gold=no
86 -
87 - # Workaround for gcc-4.7, bug 554454.
88 - cc_cv_CFLAGS__Werror_shadow=no
89 -
90 - # Workaround for bug 516346
91 - --enable-dependency-tracking
92 -
93 - --disable-maintainer-mode
94 + local myconf=(
95 + --buildtype=plain
96 + --prefix=/usr
97 + --libdir="$(get_libdir)"
98 --localstatedir=/var
99 - --with-pamlibdir=$(getpam_mod_dir)
100 + -Dpamlibdir="$(getpam_mod_dir)"
101 # avoid bash-completion dep
102 - --with-bashcompletiondir="$(get_bashcompdir)"
103 + -Dbashcompletiondir="$(get_bashcompdir)"
104 # make sure we get /bin:/sbin in $PATH
105 - --enable-split-usr
106 - # For testing.
107 - --with-rootprefix="${ROOTPREFIX-/usr}"
108 - --with-rootlibdir="${ROOTPREFIX-/usr}/$(get_libdir)"
109 - # disable sysv compatibility
110 - --with-sysvinit-path=
111 - --with-sysvrcnd-path=
112 + -Dsplit-usr=true
113 + -Drootprefix="${ROOTPREFIX}"
114 + -Dsysvinit-path=
115 + -Dsysvrcnd-path=
116 # no deps
117 - --enable-efi
118 - --enable-ima
119 -
120 + -Defi=$(meson_ml)
121 + -Dima=true
122 # Optional components/dependencies
123 - $(multilib_native_use_enable acl)
124 - $(multilib_native_use_enable apparmor)
125 - $(multilib_native_use_enable audit)
126 - $(multilib_native_use_enable cryptsetup libcryptsetup)
127 - $(multilib_native_use_enable curl libcurl)
128 - $(multilib_native_use_enable elfutils)
129 - $(use_enable gcrypt)
130 - $(multilib_native_use_enable gnuefi)
131 - --with-efi-libdir="/usr/$(get_libdir)"
132 - $(multilib_native_use_enable http microhttpd)
133 - $(usex http $(multilib_native_use_enable ssl gnutls) --disable-gnutls)
134 - $(multilib_native_use_enable idn libidn)
135 - $(multilib_native_use_enable importd)
136 - $(multilib_native_use_enable importd bzip2)
137 - $(multilib_native_use_enable importd zlib)
138 - $(multilib_native_use_enable kmod)
139 - $(use_enable lz4)
140 - $(use_enable lzma xz)
141 - $(multilib_native_use_enable nat libiptc)
142 - $(use_enable pam)
143 - $(multilib_native_use_enable policykit polkit)
144 - $(multilib_native_use_enable qrcode qrencode)
145 - $(multilib_native_use_enable seccomp)
146 - $(multilib_native_use_enable selinux)
147 - $(multilib_native_use_enable test tests)
148 - $(multilib_native_use_enable test dbus)
149 - $(multilib_native_use_enable xkb xkbcommon)
150 - $(multilib_native_use_with doc python)
151 -
152 + -Dacl=$(meson_ml_use acl)
153 + -Dapparmor=$(meson_ml_use apparmor)
154 + -Daudit=$(meson_ml_use audit)
155 + -Dlibcryptsetup=$(meson_ml_use cryptsetup)
156 + -Dlibcurl=$(meson_ml_use curl)
157 + -Delfutils=$(meson_ml_use elfutils)
158 + -Dgcrypt=$(meson_use gcrypt)
159 + -Dgnuefi=$(meson_ml_use gnuefi)
160 + -Defi-libdir="/usr/$(get_libdir)"
161 + -Dmicrohttpd=$(meson_ml_use http)
162 + $(usex http -Dgnutls=$(meson_ml_use ssl) -Dgnutls=false)
163 + -Dlibidn=$(meson_ml_use idn)
164 + -Dimportd=$(meson_ml_use importd)
165 + -Dbzip2=$(meson_ml_use importd)
166 + -Dzlib=$(meson_ml_use importd)
167 + -Dkmod=$(meson_ml_use kmod)
168 + -Dlz4=$(meson_use lz4)
169 + -Dxz=$(meson_use lzma)
170 + -Dlibiptc=$(meson_ml_use nat)
171 + -Dpam=$(meson_use pam)
172 + -Dpolkit=$(meson_ml_use policykit)
173 + -Dqrencode=$(meson_ml_use qrcode)
174 + -Dseccomp=$(meson_ml_use seccomp)
175 + -Dselinux=$(meson_ml_use selinux)
176 + #-Dtests=$(meson_ml_use test)
177 + -Ddbus=$(meson_ml_use test)
178 + -Dxkbcommon=$(meson_ml_use xkb)
179 + -Ddoc=$(meson_ml_use doc python)
180 # hardcode a few paths to spare some deps
181 - KILL=/bin/kill
182 - QUOTAON=/usr/sbin/quotaon
183 - QUOTACHECK=/usr/sbin/quotacheck
184 -
185 - # TODO: we may need to restrict this to gcc
186 - EFI_CC="$(tc-getCC)"
187 -
188 - # dbus paths
189 - --with-dbuspolicydir="${EPREFIX}/etc/dbus-1/system.d"
190 - --with-dbussessionservicedir="${EPREFIX}/usr/share/dbus-1/services"
191 - --with-dbussystemservicedir="${EPREFIX}/usr/share/dbus-1/system-services"
192 -
193 - --with-ntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
194 -
195 + -Dpath-kill=/bin/kill
196 + -Dntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
197 # Breaks screen, tmux, etc.
198 - --without-kill-user-processes
199 + -Ddefault-kill-user-processes=false
200 )
201
202 - # Work around bug 463846.
203 - tc-export CC
204 + set -- meson "${myconf[@]}" "${S}"
205 + echo "$@"
206 + "$@" || die
207 +}
208
209 - ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
210 +eninja() {
211 + if [[ -z ${NINJAOPTS+set} ]]; then
212 + NINJAOPTS="-j$(makeopts_jobs) -l$(makeopts_loadavg 0)"
213 + fi
214 + set -- ninja -v ${NINJAOPTS} "$@"
215 + echo "$@"
216 + "$@" || die
217 }
218
219 multilib_src_compile() {
220 - local mymakeopts=(
221 - udevlibexecdir="${MY_UDEVDIR}"
222 - )
223 -
224 - if multilib_is_native_abi; then
225 - emake "${mymakeopts[@]}"
226 - else
227 - emake built-sources
228 - local targets=(
229 - '$(rootlib_LTLIBRARIES)'
230 - '$(lib_LTLIBRARIES)'
231 - '$(pamlib_LTLIBRARIES)'
232 - '$(pkgconfiglib_DATA)'
233 - )
234 - echo "gentoo: ${targets[*]}" | emake "${mymakeopts[@]}" -f Makefile -f - gentoo
235 - fi
236 + eninja
237 }
238
239 multilib_src_test() {
240 - multilib_is_native_abi || return 0
241 - default
242 + eninja test
243 }
244
245 multilib_src_install() {
246 - local mymakeopts=(
247 - # automake fails with parallel libtool relinking
248 - # https://bugs.gentoo.org/show_bug.cgi?id=491398
249 - -j1
250 -
251 - udevlibexecdir="${MY_UDEVDIR}"
252 - dist_udevhwdb_DATA=
253 - DESTDIR="${D}"
254 - )
255 -
256 - if multilib_is_native_abi; then
257 - emake "${mymakeopts[@]}" install
258 - else
259 - mymakeopts+=(
260 - install-rootlibLTLIBRARIES
261 - install-libLTLIBRARIES
262 - install-pamlibLTLIBRARIES
263 - install-pkgconfiglibDATA
264 - install-includeHEADERS
265 - install-pkgincludeHEADERS
266 - )
267 -
268 - emake "${mymakeopts[@]}"
269 - fi
270 + DESTDIR="${D}" eninja install
271 }
272
273 multilib_src_install_all() {
274 - prune_libtool_files --modules
275 einstalldocs
276 dodoc "${FILESDIR}"/nsswitch.conf
277
278 @@ -332,9 +285,9 @@ multilib_src_install_all() {
279
280 if use sysv-utils; then
281 for app in halt poweroff reboot runlevel shutdown telinit; do
282 - dosym "..${ROOTPREFIX-/usr}/bin/systemctl" /sbin/${app}
283 + dosym "..${ROOTPREFIX%/}/bin/systemctl" /sbin/${app}
284 done
285 - dosym "..${ROOTPREFIX-/usr}/lib/systemd/systemd" /sbin/init
286 + dosym "..${ROOTPREFIX%/}/lib/systemd/systemd" /sbin/init
287 else
288 # we just keep sysvinit tools, so no need for the mans
289 rm "${D}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 \
290 @@ -357,6 +310,8 @@ multilib_src_install_all() {
291 rm -r "${D}"/etc/systemd/system/network-online.target.wants || die
292 rm -r "${D}"/etc/systemd/system/sockets.target.wants || die
293 rm -r "${D}"/etc/systemd/system/sysinit.target.wants || die
294 +
295 + rm -r "${D}${ROOTPREFIX%/}/lib/udev/hwdb.d" || die
296 }
297
298 migrate_locale() {
299 @@ -443,7 +398,7 @@ pkg_postinst() {
300
301 if [[ $(readlink "${ROOT}"etc/resolv.conf) == */run/systemd/* ]]; then
302 ewarn "You should replace the resolv.conf symlink:"
303 - ewarn "ln -snf ${ROOTPREFIX-/usr}/lib/systemd/resolv.conf ${ROOT}etc/resolv.conf"
304 + ewarn "ln -snf ${ROOTPREFIX%/}/lib/systemd/resolv.conf ${ROOT}etc/resolv.conf"
305 fi
306 }