gcl-2.6.11.ebuild 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit elisp-common eutils flag-o-matic
  5. DESCRIPTION="GNU Common Lisp"
  6. HOMEPAGE="https://www.gnu.org/software/gcl/gcl.html"
  7. SRC_URI="mirror://gnu/${PN}/${P}.tar.gz https://dev.gentoo.org/~grozin/${P}-fedora.tar.bz2"
  8. LICENSE="LGPL-2 GPL-2"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~arm ~x86"
  11. IUSE="+ansi athena emacs +readline tk X"
  12. # See bug #205803
  13. RESTRICT="strip"
  14. RDEPEND="emacs? ( virtual/emacs )
  15. readline? ( sys-libs/readline )
  16. athena? ( x11-libs/libXaw )
  17. >=dev-libs/gmp-4.1
  18. tk? ( dev-lang/tk )
  19. X? ( x11-libs/libXt x11-libs/libXext x11-libs/libXmu x11-libs/libXaw )
  20. virtual/latex-base"
  21. DEPEND="${RDEPEND}
  22. virtual/texi2dvi
  23. >=app-text/texi2html-1.64
  24. >=sys-devel/autoconf-2.52"
  25. S="${WORKDIR}"/${PN}
  26. src_prepare() {
  27. mv "${WORKDIR}"/fedora/info/* info/
  28. cp -p /usr/share/texmf-dist/tex/texinfo/texinfo.tex info/
  29. find . -type f -perm /0111 | xargs chmod a-x
  30. chmod a+x add-defs add-defs1 config.guess config.sub configure install.sh
  31. chmod a+x bin/info bin/info1 gcl-tk/gcltksrv.in gcl-tk/ngcltksrv mp/gcclab
  32. chmod a+x o/egrep-def utils/replace xbin/*
  33. # fedora patches
  34. epatch "${WORKDIR}"/fedora/fd-leak.patch
  35. epatch "${WORKDIR}"/fedora/latex.patch
  36. epatch "${WORKDIR}"/fedora/texinfo.patch
  37. epatch "${WORKDIR}"/fedora/elisp.patch
  38. epatch "${WORKDIR}"/fedora/selinux.patch
  39. epatch "${WORKDIR}"/fedora/rename.patch
  40. epatch "${WORKDIR}"/fedora/getcwd.patch
  41. epatch "${WORKDIR}"/fedora/plt.patch
  42. epatch "${WORKDIR}"/fedora/ellipsis.patch
  43. epatch "${WORKDIR}"/fedora/reloc-type.patch
  44. epatch "${WORKDIR}"/fedora/infrastructure.patch
  45. epatch "${WORKDIR}"/fedora/extension.patch
  46. epatch "${WORKDIR}"/fedora/unrandomize.patch
  47. epatch "${WORKDIR}"/fedora/asm-signal-h.patch
  48. epatch "${WORKDIR}"/fedora/largefile.patch
  49. epatch "${WORKDIR}"/fedora/arm.patch
  50. sed -e 's|"-fomit-frame-pointer"|""|' -i configure
  51. sed -e 's|@EXT@||g' debian/in.gcl.1 > gcl.1
  52. }
  53. src_configure() {
  54. strip-flags
  55. filter-flags -fstack-protector -fstack-protector-all
  56. local tcl=""
  57. if use tk; then
  58. tcl="--enable-tclconfig=/usr/lib --enable-tkconfig=/usr/lib"
  59. fi
  60. econf --enable-dynsysgmp \
  61. --disable-xdr \
  62. --enable-emacsdir=/usr/share/emacs/site-lisp/gcl \
  63. --enable-infodir=/usr/share/info \
  64. $(use_enable readline) \
  65. $(use_enable ansi) \
  66. $(use_enable athena xgcl) \
  67. $(use_with X x) \
  68. ${tcl}
  69. }
  70. src_compile() {
  71. emake -j1
  72. emake -C info gcl.info
  73. if use athena; then
  74. pushd xgcl-2 > /dev/null
  75. pdflatex dwdoc.tex
  76. popd > /dev/null
  77. fi
  78. }
  79. src_test() {
  80. local make_ansi_tests_clean="rm -f test.out *.fasl *.o *.so *~ *.fn *.x86f *.fasl *.ufsl"
  81. if use ansi; then
  82. cd ansi-tests
  83. ( make clean && make test-unixport ) \
  84. || die "make ansi-tests failed!"
  85. cat "${FILESDIR}/bootstrap-gcl" \
  86. | ../unixport/saved_ansi_gcl
  87. cat "${FILESDIR}/bootstrap-gcl" \
  88. |sed s/bootstrapped_ansi_gcl/bootstrapped_r_ansi_gcl/g \
  89. | ./bootstrapped_ansi_gcl
  90. ( ${make_ansi_tests_clean} && \
  91. echo "(load \"gclload.lsp\")" \
  92. | ./bootstrapped_r_ansi_gcl ) \
  93. || die "Phase 2, bootstraped compiler failed in tests"
  94. fi
  95. }
  96. src_install() {
  97. emake DESTDIR="${D}" install
  98. rm -rf "${D}"usr/share/doc
  99. rm -rf "${D}"usr/share/emacs
  100. rm elisp/add-defaults.el
  101. dodoc readme* RELEASE* ChangeLog* doc/*
  102. doman gcl.1
  103. doinfo info/*.info*
  104. dohtml -r info/gcl-si info/gcl-tk
  105. if use emacs; then
  106. elisp-site-file-install "${FILESDIR}"/64${PN}-gentoo.el
  107. elisp-install ${PN} elisp/*.el
  108. fi
  109. insinto /usr/share/doc/${PF}
  110. doins info/*.pdf
  111. if use athena; then
  112. pushd xgcl-2 > /dev/null
  113. insinto /usr/share/doc/${PF}
  114. doins *.pdf
  115. popd > /dev/null
  116. fi
  117. }
  118. pkg_postinst() {
  119. use emacs && elisp-site-regen
  120. }
  121. pkg_postrm() {
  122. use emacs && elisp-site-regen
  123. }