sys-apps/sed: Bump to version 4.5
authorLars Wendler <polynomial-c@gentoo.org>
Sun, 1 Apr 2018 14:05:44 +0000 (16:05 +0200)
committerLars Wendler <polynomial-c@gentoo.org>
Sun, 1 Apr 2018 14:13:36 +0000 (16:13 +0200)
Package-Manager: Portage-2.3.27, Repoman-2.3.9

sys-apps/sed/Manifest
sys-apps/sed/sed-4.5.ebuild [new file with mode: 0644]

index 063000c91f0539a0ccf444a6a2cbf85df961d332..ab61ab27d0e7b084c2704a36255e70485d232aef 100644 (file)
@@ -1,3 +1,4 @@
 DIST sed-4.2.2.tar.bz2 1059414 BLAKE2B aebe0bf90e9f9c7907e0baa8a4d1a16e59a5893198382fb9fe08ed66cab670921c0db1e07f668bf3db8dfe9bb4f0e68b9c34fd7228c70df24be043d3e7ea8d92 SHA512 dbbb0bb348fac54612d29182c09c88bda7096dea03bd94f03c580c24146e65a06db12808c6a1a9adc94548fa3843511e3e80b251cb07142110cf149eab23f573
 DIST sed-4.3.tar.xz 1167168 BLAKE2B 5751943cb64d03afef727deba3bee7027a1611b4729c7b33497c28513b61571d1c323f1d07ab68a252a9e45d0f7c95e303f05443310dcae74bedab28160b079d SHA512 4d76a099cf7115763b79b45be5c96338750baa47e34c36075f714e022614397aa9240099d6d009e69aa4d06b6cfc14dcc0f8313442a1465f448b36fb6874a26d
 DIST sed-4.4.tar.xz 1181664 BLAKE2B 03804c209c2108cca4aa991cd68065fd03a15c726b6daf5212603835b5c046c63e9c2e4c28f76dfe165128f060db5b992c981f314d2fe230f30521545d00a468 SHA512 4e1b0a7403913f1e25047eb2292a0a9b3488b15b4463ce2803e05eaecbc2da19f477a18e6a70c992461c38ced90774415091aa2d8ce85cb74e391610d9eedb70
+DIST sed-4.5.tar.xz 1274252 BLAKE2B 08525659e0e01ec50e736c1665634f3816f57c48aeefa7f6bc7a152cd6c171bb4e96e5c215429fc5edbe6e1de6cc3efe4f2f3bf6865933a30dd1700e921d5b3f SHA512 f95fb27e03b2301dae63878413b4c48e40341cc676945a612e1d0bd911da3192858ae142791292a99fbdaacbc7dab2d6fccb50787c06846f99b0b3740b40c196
diff --git a/sys-apps/sed/sed-4.5.ebuild b/sys-apps/sed/sed-4.5.ebuild
new file mode 100644 (file)
index 0000000..8dba972
--- /dev/null
@@ -0,0 +1,66 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="Super-useful stream editor"
+HOMEPAGE="http://sed.sourceforge.net/"
+SRC_URI="mirror://gnu/sed/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
+IUSE="acl forced-sandbox nls selinux static"
+
+RDEPEND="acl? ( virtual/acl )
+       nls? ( virtual/libintl )
+       selinux? ( sys-libs/libselinux )"
+DEPEND="${RDEPEND}
+       nls? ( sys-devel/gettext )"
+
+src_bootstrap_sed() {
+       # make sure system-sed works #40786 #650052
+       if ! type -p sed > /dev/null || has_version 'sys-apps/sed[forced-sandbox]' ; then
+               mkdir -p "${T}/bootstrap"
+               printf '#!/bin/sh\nexec busybox sed "$@"\n' > "${T}/bootstrap/sed" || die
+               chmod a+rx "${T}/bootstrap/sed"
+               PATH="${T}/bootstrap:${PATH}"
+       fi
+}
+
+src_prepare() {
+       # Don't use sed before bootstrap if we have to recover a broken host sed.
+       src_bootstrap_sed
+
+       default
+
+       if use forced-sandbox ; then
+               # Upstream doesn't want to add a configure flag for this.
+               # https://lists.gnu.org/archive/html/bug-sed/2018-03/msg00001.html
+               sed -i \
+                       -e '/^bool sandbox = false;/s:false:true:' \
+                       sed/sed.c || die
+               # Make sure the sed took.
+               grep -q '^bool sandbox = true;' sed/sed.c || die "forcing sandbox failed"
+       fi
+}
+
+src_configure() {
+       local myconf=()
+       if use userland_GNU; then
+               myconf+=( --exec-prefix="${EPREFIX}" )
+       else
+               myconf+=( --program-prefix=g )
+       fi
+
+       export ac_cv_search_setfilecon=$(usex selinux -lselinux)
+       export ac_cv_header_selinux_{context,selinux}_h=$(usex selinux)
+       use static && append-ldflags -static
+       myconf+=(
+               $(use_enable acl)
+               $(use_enable nls)
+       )
+       econf "${myconf[@]}"
+}