sed-4.4.ebuild 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. inherit eutils flag-o-matic toolchain-funcs
  5. DESCRIPTION="Super-useful stream editor"
  6. HOMEPAGE="http://sed.sourceforge.net/"
  7. SRC_URI="mirror://gnu/sed/${P}.tar.xz"
  8. LICENSE="GPL-3"
  9. SLOT="0"
  10. KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
  11. IUSE="acl nls selinux static"
  12. RDEPEND="acl? ( virtual/acl )
  13. nls? ( virtual/libintl )
  14. selinux? ( sys-libs/libselinux )"
  15. DEPEND="${RDEPEND}
  16. nls? ( sys-devel/gettext )"
  17. #PATCHES=(
  18. #)
  19. src_bootstrap_sed() {
  20. # make sure system-sed works #40786
  21. export NO_SYS_SED=""
  22. if ! type -p sed > /dev/null ; then
  23. NO_SYS_SED="!!!"
  24. ./bootstrap.sh || die "couldnt bootstrap"
  25. cp sed/sed "${T}"/ || die "couldnt copy"
  26. export PATH="${PATH}:${T}"
  27. make clean || die "couldnt clean"
  28. fi
  29. }
  30. src_prepare() {
  31. #epatch "${PATCHES[@]}"
  32. # don't use sed before bootstrap if we have to recover a broken host sed
  33. src_bootstrap_sed
  34. }
  35. src_configure() {
  36. local myconf=()
  37. if use userland_GNU; then
  38. myconf+=( --exec-prefix="${EPREFIX}" )
  39. else
  40. myconf+=( --program-prefix=g )
  41. fi
  42. export ac_cv_search_setfilecon=$(usex selinux -lselinux)
  43. export ac_cv_header_selinux_{context,selinux}_h=$(usex selinux)
  44. use static && append-ldflags -static
  45. myconf+=(
  46. $(use_enable acl)
  47. $(use_enable nls)
  48. )
  49. econf "${myconf[@]}"
  50. }