logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git

mksh-57-r2.ebuild (1291B)


  1. # Copyright 1999-2019 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit eutils toolchain-funcs
  5. if [[ $PV = 9999 ]]; then
  6. inherit cvs
  7. ECVS_SERVER="anoncvs.mirbsd.org:/cvs"
  8. ECVS_MODULE="mksh"
  9. ECVS_USER="_anoncvs"
  10. ECVS_AUTH="ext"
  11. KEYWORDS=""
  12. else
  13. SRC_URI="https://www.mirbsd.org/MirOS/dist/mir/mksh/${PN}-R${PV}.tgz"
  14. KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
  15. fi
  16. DESCRIPTION="MirBSD Korn Shell"
  17. HOMEPAGE="http://mirbsd.de/mksh"
  18. LICENSE="BSD"
  19. SLOT="0"
  20. IUSE="static +lksh"
  21. S="${WORKDIR}/${PN}"
  22. src_prepare() {
  23. default
  24. if use lksh; then
  25. cp "${S}" "${S}"_lksh
  26. fi
  27. }
  28. src_compile() {
  29. tc-export CC
  30. if use static; then
  31. export LDSTATIC="-static"
  32. fi
  33. export CPPFLAGS="${CPPFLAGS} -DMKSH_DEFAULT_PROFILEDIR=\\\"${EPREFIX}/etc\\\""
  34. # TODO: Add lksh to `/etc/shells (sys-apps/baselayout)` and `app-eselect/eselect-sh`
  35. if use lksh; then
  36. cd "${S}"_lksh
  37. CPPFLAGS="${CPPFLAGS} -DMKSH_BINSHPOSIX -DMKSH_BINSHREDUCED" \
  38. sh Build.sh -r -L || die
  39. fi
  40. sh Build.sh -r || die
  41. }
  42. src_install() {
  43. exeinto /bin
  44. doexe mksh
  45. doman mksh.1
  46. dodoc dot.mkshrc
  47. if use lksh; then
  48. cd "${S}"_lksh
  49. doexe lksh
  50. doman lksh.1
  51. fi
  52. }
  53. src_test() {
  54. ./test.sh -v || die
  55. if use lksh; then
  56. cd "${S}"_lksh
  57. ./test.sh -v || die
  58. fi
  59. }