mksh-53a.ebuild 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils toolchain-funcs
  5. DESCRIPTION="MirBSD KSH Shell"
  6. HOMEPAGE="http://mirbsd.de/mksh"
  7. SRC_URI="http://www.mirbsd.org/MirOS/dist/mir/mksh/${PN}-R${PV}.tgz"
  8. LICENSE="BSD"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
  11. IUSE="static"
  12. DEPEND="static? ( dev-libs/klibc )"
  13. RDEPEND=""
  14. S="${WORKDIR}/${PN}"
  15. src_compile() {
  16. tc-export CC
  17. # we want to build static with klibc
  18. if use static ; then
  19. unset CC
  20. export CC="/usr/bin/klcc"
  21. export LDSTATIC="-static"
  22. fi
  23. export CPPFLAGS="${CPPFLAGS} -DMKSH_DEFAULT_PROFILEDIR=\\\"${EPREFIX}/etc\\\""
  24. # we can't assume lto existing/enabled, so we add a fallback
  25. sh Build.sh -r -c lto || sh Build.sh -r || die
  26. }
  27. src_install() {
  28. exeinto /bin
  29. doexe mksh
  30. doman mksh.1
  31. dodoc dot.mkshrc
  32. }
  33. src_test() {
  34. ./test.sh || die
  35. }
  36. pkg_postinst() {
  37. ebegin "Updating /etc/shells"
  38. ( grep -v "^/bin/mksh$" "${ROOT}"etc/shells; echo "/bin/mksh" ) > "${T}"/shells
  39. mv -f "${T}"/shells "${ROOT}"etc/shells
  40. eend $?
  41. }