1 |
commit: 73d3426b9af66c84b32ea0631205a0546049d9f3 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Apr 6 08:49:02 2018 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Apr 6 11:43:23 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=73d3426b |
7 |
|
8 |
sys-apps/util-linux: Support library-only build for *BSD |
9 |
|
10 |
Closes: https://bugs.gentoo.org/651398 |
11 |
|
12 |
sys-apps/util-linux/util-linux-9999.ebuild | 29 ++++++++++++++++++++++++----- |
13 |
1 file changed, 24 insertions(+), 5 deletions(-) |
14 |
|
15 |
diff --git a/sys-apps/util-linux/util-linux-9999.ebuild b/sys-apps/util-linux/util-linux-9999.ebuild |
16 |
index 2bf922e742b..76ee8160737 100644 |
17 |
--- a/sys-apps/util-linux/util-linux-9999.ebuild |
18 |
+++ b/sys-apps/util-linux/util-linux-9999.ebuild |
19 |
@@ -25,7 +25,7 @@ HOMEPAGE="https://www.kernel.org/pub/linux/utils/util-linux/" |
20 |
|
21 |
LICENSE="GPL-2 LGPL-2.1 BSD-4 MIT public-domain" |
22 |
SLOT="0" |
23 |
-IUSE="build caps +cramfs fdformat kill ncurses nls pam python +readline selinux slang static-libs +suid systemd test tty-helpers udev unicode" |
24 |
+IUSE="build caps +cramfs fdformat kill ncurses nls pam python +readline selinux slang static-libs +suid systemd test tty-helpers udev unicode userland_GNU" |
25 |
|
26 |
# Most lib deps here are related to programs rather than our libs, |
27 |
# so we rarely need to specify ${MULTILIB_USEDEP}. |
28 |
@@ -73,6 +73,13 @@ src_prepare() { |
29 |
-e "s|UUIDD_SOCKET=\"\$(mktemp -u \"\${TS_OUTDIR}/uuiddXXXXXXXXXXXXX\")\"|UUIDD_SOCKET=\"\$(mktemp -u \"${T}/uuiddXXXXXXXXXXXXX.sock\")\"|g" \ |
30 |
tests/ts/uuid/uuidd || die "Failed to fix uuidd test" |
31 |
|
32 |
+ if ! use userland_GNU; then |
33 |
+ # test runner is using GNU-specific xargs call |
34 |
+ sed -i -e 's:xargs:gxargs:' tests/run.sh || die |
35 |
+ # test requires util-linux uuidgen (which we don't build) |
36 |
+ rm tests/ts/uuid/oids || die |
37 |
+ fi |
38 |
+ |
39 |
if [[ ${PV} == 9999 ]] ; then |
40 |
po/update-potfiles |
41 |
eautoreconf |
42 |
@@ -128,7 +135,8 @@ multilib_src_configure() { |
43 |
$(use_with selinux) |
44 |
$(usex ncurses '' '--without-tinfo') |
45 |
) |
46 |
- if multilib_is_native_abi; then |
47 |
+ # build programs only on GNU, on *BSD we want libraries only |
48 |
+ if multilib_is_native_abi && use userland_GNU; then |
49 |
myeconfargs+=( |
50 |
--disable-chfn-chsh |
51 |
--disable-login |
52 |
@@ -156,13 +164,18 @@ multilib_src_configure() { |
53 |
--disable-all-programs |
54 |
--disable-bash-completion |
55 |
--without-systemdsystemunitdir |
56 |
- # build all libraries |
57 |
+ # build libraries |
58 |
--enable-libuuid |
59 |
--enable-libblkid |
60 |
- --enable-libmount |
61 |
--enable-libsmartcols |
62 |
--enable-libfdisk |
63 |
) |
64 |
+ if use userland_GNU; then |
65 |
+ # those libraries don't work on *BSD |
66 |
+ myeconfargs+=( |
67 |
+ --enable-libmount |
68 |
+ ) |
69 |
+ fi |
70 |
fi |
71 |
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}" |
72 |
} |
73 |
@@ -174,7 +187,7 @@ multilib_src_test() { |
74 |
multilib_src_install() { |
75 |
emake DESTDIR="${D}" install |
76 |
|
77 |
- if multilib_is_native_abi; then |
78 |
+ if multilib_is_native_abi && use userland_GNU; then |
79 |
# need the libs in / |
80 |
gen_usr_ldscript -a blkid mount smartcols uuid |
81 |
|
82 |
@@ -188,6 +201,12 @@ multilib_src_install_all() { |
83 |
# e2fsprogs-libs didnt install .la files, and .pc work fine |
84 |
find "${ED}" -name "*.la" -delete || die |
85 |
|
86 |
+ if ! use userland_GNU; then |
87 |
+ # manpage collisions |
88 |
+ # TODO: figure out a good way to keep them |
89 |
+ rm "${ED%/}"/usr/share/man/man3/uuid* || die |
90 |
+ fi |
91 |
+ |
92 |
if use pam; then |
93 |
newpamd "${FILESDIR}/runuser.pamd" runuser |
94 |
newpamd "${FILESDIR}/runuser-l.pamd" runuser-l |