Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/coreutils/
Date: Tue, 14 Mar 2023 19:48:59
Message-Id: 1678823313.cd0377a8949670625747ec22daf86f5bed7025d6.sam@gentoo
1 commit: cd0377a8949670625747ec22daf86f5bed7025d6
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Tue Mar 14 19:43:38 2023 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Tue Mar 14 19:48:33 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cd0377a8
7
8 sys-apps/coreutils: add 9.1_p20230313 (unkeyworded, pre-release)
9
10 Bug: https://bugs.gentoo.org/885793
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12
13 sys-apps/coreutils/Manifest | 2 +
14 sys-apps/coreutils/coreutils-9.1_p20230313.ebuild | 267 ++++++++++++++++++++++
15 2 files changed, 269 insertions(+)
16
17 diff --git a/sys-apps/coreutils/Manifest b/sys-apps/coreutils/Manifest
18 index 7ea8df983e96..03a6a957fb99 100644
19 --- a/sys-apps/coreutils/Manifest
20 +++ b/sys-apps/coreutils/Manifest
21 @@ -3,3 +3,5 @@ DIST coreutils-8.32.tar.xz 5547836 BLAKE2B 0ad99c176c19ec214fcfd0845523e5362f015
22 DIST coreutils-9.0_p20220409-patches-01.tar.xz 6244 BLAKE2B 8ca9855680719660782931467ec70095c826e66b9850890b8cf456963f8114f63940707386b97c766172d01e55e17b7db2aa1c329208a873a76e2293b29f565f SHA512 4b43c25832122d241f33e6b4eff24bc1fa045b9ca5af45a49d22ecb1fa282986c4e4a045ef24c34b3d94fd9a2247247c42c344261e3f464d881969e6f3351d3f
23 DIST coreutils-9.1.tar.xz 5712104 BLAKE2B f5654e4935535275615d44a56c071d1c0746af36cf4615fcc0a5a0d387af9c9023adac31f31a52e16b3d1105b9d4c0fb7ebff9b2862498849f867a866049dd6e SHA512 a6ee2c549140b189e8c1b35e119d4289ec27244ec0ed9da0ac55202f365a7e33778b1dc7c4e64d1669599ff81a8297fe4f5adbcc8a3a2f75c919a43cd4b9bdfa
24 DIST coreutils-9.1.tar.xz.sig 833 BLAKE2B e9627a066f3c67596feaa8d43d5785076230f440bacea84d8b5736e51a22787c2d5df1f3e2cd8523d01fb7b468933d3c17fce3cb1fbefef322a0e0d820b81842 SHA512 9f0766531afd4faa3e2c337730f61db55605cf06729e9c61f644594883732c2e0b1ddb0005b492be309c53e6f45b8ff875398163a48699d52517ea49e9bdbc91
25 +DIST coreutils-9.1_p20230313.tar.xz 5741248 BLAKE2B b86a67c266fad13fc1d9a4c4775c60e480ab2925e1d2c8313d9da2e4eb45bb609641fa28336c54f05d7e22627906196ac52451a5fc18f538b6b133d7fdef56a7 SHA512 3046a4e02143105c4c7936ce67a59f99a3193fbb28b5bb491fcbb86a8698bf9f9bb83ea94aad225afaf3e2dd8a704fb77298e41fc3aebd1a42e3897e105bed0e
26 +DIST coreutils-9.1_p20230313.tar.xz.sig 833 BLAKE2B 44db6c8295b6edfa435853c9391f43f47cfe4ffbc7b58b5fc031c5f05fd4f850ec76bff79d9b53ae0aae84278b51cf3acf00a0a062b5928b407042a5072f65e8 SHA512 078b5158a6ad14ba51fb4e5bc4b4effda8011e6e12ebdc0cd864227c8405f8092502bca9b6bde49a802f77dea2b9c3441af0fd3bafc08354e1e8cc038fd42f6d
27
28 diff --git a/sys-apps/coreutils/coreutils-9.1_p20230313.ebuild b/sys-apps/coreutils/coreutils-9.1_p20230313.ebuild
29 new file mode 100644
30 index 000000000000..2c0011780d87
31 --- /dev/null
32 +++ b/sys-apps/coreutils/coreutils-9.1_p20230313.ebuild
33 @@ -0,0 +1,267 @@
34 +# Copyright 1999-2023 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=8
38 +
39 +# Try to keep an eye on Fedora's packaging: https://src.fedoraproject.org/rpms/coreutils
40 +# The upstream coreutils maintianers also maintain the package in Fedora and may
41 +# backport fixes which we want to pick up.
42 +
43 +PYTHON_COMPAT=( python3_{9..11} )
44 +VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/coreutils.asc
45 +inherit flag-o-matic python-any-r1 toolchain-funcs verify-sig
46 +
47 +MY_PATCH="${PN}-9.0_p20220409-patches-01"
48 +DESCRIPTION="Standard GNU utilities (chmod, cp, dd, ls, sort, tr, head, wc, who,...)"
49 +HOMEPAGE="https://www.gnu.org/software/coreutils/"
50 +
51 +if [[ ${PV} == 9999 ]] ; then
52 + EGIT_REPO_URI="https://git.savannah.gnu.org/git/coreutils.git"
53 + inherit git-r3
54 +elif [[ ${PV} == *_p* ]] ; then
55 + # Note: could put this in devspace, but if it's gone, we don't want
56 + # it in tree anyway. It's just for testing.
57 + MY_SNAPSHOT="$(ver_cut 1-2).198-e68b1"
58 + SRC_URI="https://www.pixelbeat.org/cu/coreutils-${MY_SNAPSHOT}.tar.xz -> ${P}.tar.xz"
59 + SRC_URI+=" verify-sig? ( https://www.pixelbeat.org/cu/coreutils-${MY_SNAPSHOT}.tar.xz.sig -> ${P}.tar.xz.sig )"
60 + S="${WORKDIR}"/${PN}-${MY_SNAPSHOT}
61 +else
62 + SRC_URI="
63 + mirror://gnu/${PN}/${P}.tar.xz
64 + verify-sig? ( mirror://gnu/${PN}/${P}.tar.xz.sig )
65 + "
66 +
67 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x86-linux"
68 +fi
69 +
70 +SRC_URI+=" !vanilla? ( https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${MY_PATCH}.tar.xz )"
71 +
72 +LICENSE="GPL-3+"
73 +SLOT="0"
74 +IUSE="acl caps gmp hostname kill multicall nls +openssl selinux +split-usr static test vanilla xattr"
75 +RESTRICT="!test? ( test )"
76 +
77 +LIB_DEPEND="
78 + acl? ( sys-apps/acl[static-libs] )
79 + caps? ( sys-libs/libcap )
80 + gmp? ( dev-libs/gmp:=[static-libs] )
81 + openssl? ( dev-libs/openssl:=[static-libs] )
82 + xattr? ( sys-apps/attr[static-libs] )
83 +"
84 +RDEPEND="
85 + !static? ( ${LIB_DEPEND//\[static-libs]} )
86 + selinux? ( sys-libs/libselinux )
87 + nls? ( virtual/libintl )
88 +"
89 +DEPEND="
90 + ${RDEPEND}
91 + static? ( ${LIB_DEPEND} )
92 +"
93 +BDEPEND="
94 + app-arch/xz-utils
95 + dev-lang/perl
96 + test? (
97 + dev-lang/perl
98 + dev-perl/Expect
99 + dev-util/strace
100 + ${PYTHON_DEPS}
101 + )
102 + verify-sig? ( >=sec-keys/openpgp-keys-coreutils-20230313 )
103 +"
104 +RDEPEND+="
105 + hostname? ( !sys-apps/net-tools[hostname] )
106 + kill? (
107 + !sys-apps/util-linux[kill]
108 + !sys-process/procps[kill]
109 + )
110 + !app-misc/realpath
111 + !<sys-apps/util-linux-2.13
112 + !<sys-apps/sandbox-2.10-r4
113 + !sys-apps/stat
114 + !net-mail/base64
115 + !sys-apps/mktemp
116 + !<app-forensics/tct-1.18-r1
117 + !<net-fs/netatalk-2.0.3-r4"
118 +
119 +pkg_setup() {
120 + if use test ; then
121 + python-any-r1_pkg_setup
122 + fi
123 +}
124 +
125 +src_unpack() {
126 + if [[ ${PV} == 9999 ]] ; then
127 + git-r3_src_unpack
128 +
129 + cd "${S}" || die
130 + ./bootstrap || die
131 +
132 + sed -i -e "s:submodule-checks ?= no-submodule-changes public-submodule-commit:submodule-checks ?= no-submodule-changes:" gnulib/top/maint.mk || die
133 + elif use verify-sig ; then
134 + # Needed for downloaded patch (which is unsigned, which is fine)
135 + verify-sig_verify_detached "${DISTDIR}"/${P}.tar.xz{,.sig}
136 + fi
137 +
138 + default
139 +}
140 +
141 +src_prepare() {
142 + local PATCHES=(
143 + # Upstream patches
144 + )
145 +
146 + if ! use vanilla && [[ -d "${WORKDIR}"/patch ]] ; then
147 + PATCHES+=( "${WORKDIR}"/patch )
148 + fi
149 +
150 + default
151 +
152 + # Since we've patched many .c files, the make process will try to
153 + # re-build the manpages by running `./bin --help`. When doing a
154 + # cross-compile, we can't do that since 'bin' isn't a native bin.
155 + #
156 + # Also, it's not like we changed the usage on any of these things,
157 + # so let's just update the timestamps and skip the help2man step.
158 + set -- man/*.x
159 + touch ${@/%x/1} || die
160 +
161 + # Avoid perl dep for compiled in dircolors default (bug #348642)
162 + if ! has_version dev-lang/perl ; then
163 + touch src/dircolors.h || die
164 + touch ${@/%x/1} || die
165 + fi
166 +}
167 +
168 +src_configure() {
169 + local myconf=(
170 + --with-packager="Gentoo"
171 + --with-packager-version="${PVR} (p${PATCH_VER:-0})"
172 + --with-packager-bug-reports="https://bugs.gentoo.org/"
173 + # kill/uptime - procps
174 + # groups/su - shadow
175 + # hostname - net-tools
176 + --enable-install-program="arch,$(usev hostname),$(usev kill)"
177 + --enable-no-install-program="groups,$(usev !hostname),$(usev !kill),su,uptime"
178 + --enable-largefile
179 + $(usex caps '' --disable-libcap)
180 + $(use_enable nls)
181 + $(use_enable acl)
182 + $(use_enable multicall single-binary)
183 + $(use_enable xattr)
184 + $(use_with gmp libgmp)
185 + $(use_with openssl)
186 + )
187 +
188 + if use gmp ; then
189 + myconf+=( --with-libgmp-prefix="${ESYSROOT}"/usr )
190 + fi
191 +
192 + if tc-is-cross-compiler && [[ ${CHOST} == *linux* ]] ; then
193 + # bug #311569
194 + export fu_cv_sys_stat_statfs2_bsize=yes
195 + # bug #416629
196 + export gl_cv_func_realpath_works=yes
197 + fi
198 +
199 + # bug #409919
200 + export gl_cv_func_mknod_works=yes
201 +
202 + if use static ; then
203 + append-ldflags -static
204 + # bug #321821
205 + sed -i '/elf_sys=yes/s:yes:no:' configure || die
206 + fi
207 +
208 + if ! use selinux ; then
209 + # bug #301782
210 + export ac_cv_{header_selinux_{context,flash,selinux}_h,search_setfilecon}=no
211 + fi
212 +
213 + econf "${myconf[@]}"
214 +}
215 +
216 +src_test() {
217 + # Known to fail with FEATURES=usersandbox (bug #439574):
218 + # - tests/du/long-from-unreadable.sh} (bug #413621)
219 + # - tests/rm/deep-2.sh (bug #413621)
220 + # - tests/dd/no-allocate.sh (bug #629660)
221 + if has usersandbox ${FEATURES} ; then
222 + ewarn "You are emerging ${P} with 'usersandbox' enabled." \
223 + "Expect some test failures or emerge with 'FEATURES=-usersandbox'!"
224 + fi
225 +
226 + # Non-root tests will fail if the full path isn't
227 + # accessible to non-root users
228 + chmod -R go-w "${WORKDIR}" || die
229 + chmod a+rx "${WORKDIR}" || die
230 +
231 + # coreutils tests like to do `mount` and such with temp dirs,
232 + # so make sure:
233 + # - /etc/mtab is writable (bug #265725)
234 + # - /dev/loop* can be mounted (bug #269758)
235 + mkdir -p "${T}"/mount-wrappers || die
236 + mkwrap() {
237 + local w ww
238 + for w in "${@}" ; do
239 + ww="${T}/mount-wrappers/${w}"
240 + cat <<-EOF > "${ww}"
241 + #!${EPREFIX}/bin/sh
242 + exec env SANDBOX_WRITE="\${SANDBOX_WRITE}:/etc/mtab:/dev/loop" $(type -P ${w}) "\$@"
243 + EOF
244 + chmod a+rx "${ww}" || die
245 + done
246 + }
247 + mkwrap mount umount
248 +
249 + addwrite /dev/full
250 + #export RUN_EXPENSIVE_TESTS="yes"
251 + #export FETISH_GROUPS="portage wheel"
252 + env PATH="${T}/mount-wrappers:${PATH}" gl_public_submodule_commit= \
253 + emake -k check VERBOSE=yes
254 +}
255 +
256 +src_install() {
257 + default
258 +
259 + insinto /etc
260 + newins src/dircolors.hin DIR_COLORS
261 +
262 + if use split-usr ; then
263 + cd "${ED}"/usr/bin || die
264 + dodir /bin
265 +
266 + # Move critical binaries into /bin (required by FHS)
267 + local fhs="cat chgrp chmod chown cp date dd df echo false ln ls
268 + mkdir mknod mv pwd rm rmdir stty sync true uname"
269 + mv ${fhs} ../../bin/ || die "Could not move FHS bins!"
270 +
271 + if use hostname ; then
272 + mv hostname ../../bin/ || die
273 + fi
274 +
275 + if use kill ; then
276 + mv kill ../../bin/ || die
277 + fi
278 +
279 + # Move critical binaries into /bin (common scripts)
280 + # (Why are these required for booting?)
281 + local com="basename chroot cut dir dirname du env expr head mkfifo
282 + mktemp readlink seq sleep sort tail touch tr tty vdir wc yes"
283 + mv ${com} ../../bin/ || die "Could not move common bins!"
284 +
285 + # Create a symlink for uname in /usr/bin/ since autotools require it.
286 + # (Other than uname, we need to figure out why we are
287 + # creating symlinks for these in /usr/bin instead of leaving
288 + # the files there in the first place...)
289 + local x
290 + for x in ${com} uname ; do
291 + dosym ../../bin/${x} /usr/bin/${x}
292 + done
293 + fi
294 +}
295 +
296 +pkg_postinst() {
297 + ewarn "Make sure you run 'hash -r' in your active shells."
298 + ewarn "You should also re-source your shell settings for LS_COLORS"
299 + ewarn " changes, such as: source /etc/profile"
300 +}