gcl-2.6.10.ebuild 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. # Copyright 1999-2015 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/rename.patch
  39. epatch "${WORKDIR}"/fedora/getcwd.patch
  40. epatch "${WORKDIR}"/fedora/infrastructure.patch
  41. epatch "${WORKDIR}"/fedora/extension.patch
  42. epatch "${WORKDIR}"/fedora/unrandomize.patch
  43. epatch "${WORKDIR}"/fedora/asm-signal-h.patch
  44. epatch "${WORKDIR}"/fedora/plt.patch
  45. epatch "${WORKDIR}"/fedora/ellipsis.patch
  46. epatch "${WORKDIR}"/fedora/man.patch
  47. epatch "${WORKDIR}"/fedora/reloc-type.patch
  48. epatch "${WORKDIR}"/fedora/largefile.patch
  49. epatch "${FILESDIR}"/${PN}-tcl-8.6.patch
  50. epatch "${FILESDIR}"/${PN}-gmp-6.patch
  51. epatch "${FILESDIR}"/${PN}-readline-6.3.patch
  52. sed -e 's|"-fomit-frame-pointer"|""|' -i configure
  53. sed -e 's|@EXT@||g' debian/in.gcl.1 > gcl.1
  54. }
  55. src_configure() {
  56. strip-flags
  57. filter-flags -fstack-protector -fstack-protector-all
  58. local tcl=""
  59. if use tk; then
  60. tcl="--enable-tclconfig=/usr/lib --enable-tkconfig=/usr/lib"
  61. fi
  62. econf --enable-dynsysgmp \
  63. --disable-xdr \
  64. --enable-emacsdir=/usr/share/emacs/site-lisp/gcl \
  65. --enable-infodir=/usr/share/info \
  66. $(use_enable readline) \
  67. $(use_enable ansi) \
  68. $(use_enable athena xgcl) \
  69. $(use_with X x) \
  70. ${tcl}
  71. }
  72. src_compile() {
  73. emake -j1
  74. emake -C info gcl.info
  75. if use athena; then
  76. pushd xgcl-2 > /dev/null
  77. pdflatex dwdoc.tex
  78. popd > /dev/null
  79. fi
  80. }
  81. src_test() {
  82. local make_ansi_tests_clean="rm -f test.out *.fasl *.o *.so *~ *.fn *.x86f *.fasl *.ufsl"
  83. if use ansi; then
  84. cd ansi-tests
  85. ( make clean && make test-unixport ) \
  86. || die "make ansi-tests failed!"
  87. cat "${FILESDIR}/bootstrap-gcl" \
  88. | ../unixport/saved_ansi_gcl
  89. cat "${FILESDIR}/bootstrap-gcl" \
  90. |sed s/bootstrapped_ansi_gcl/bootstrapped_r_ansi_gcl/g \
  91. | ./bootstrapped_ansi_gcl
  92. ( ${make_ansi_tests_clean} && \
  93. echo "(load \"gclload.lsp\")" \
  94. | ./bootstrapped_r_ansi_gcl ) \
  95. || die "Phase 2, bootstraped compiler failed in tests"
  96. fi
  97. }
  98. src_install() {
  99. emake DESTDIR="${D}" install
  100. mv "${D}"usr/share/doc/*.dvi .
  101. rm -rf "${D}"usr/share/doc
  102. rm -rf "${D}"usr/share/emacs
  103. rm -rf "${D}"usr/lib/gcl-*/info
  104. rm doc/makefile elisp/add-defaults.el
  105. dodoc readme* RELEASE* ChangeLog* doc/*
  106. doman gcl.1
  107. doinfo info/*.info*
  108. dohtml -r info/gcl-si info/gcl-tk
  109. if use emacs; then
  110. elisp-site-file-install "${FILESDIR}"/64${PN}-gentoo.el
  111. elisp-install ${PN} elisp/*.el
  112. fi
  113. insinto /usr/share/doc/${PF}
  114. doins *.dvi
  115. if use athena; then
  116. pushd xgcl-2 > /dev/null
  117. insinto /usr/share/doc/${PF}
  118. doins *.pdf
  119. popd > /dev/null
  120. fi
  121. }
  122. pkg_postinst() {
  123. use emacs && elisp-site-regen
  124. }
  125. pkg_postrm() {
  126. use emacs && elisp-site-regen
  127. }