1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit elisp-common eutils flag-o-matic
8 DESCRIPTION="GNU Common Lisp"
9 HOMEPAGE="https://www.gnu.org/software/gcl/gcl.html"
10 SRC_URI="mirror://gnu/${PN}/${P}.tar.gz https://dev.gentoo.org/~grozin/${P}-fedora.tar.bz2"
12 LICENSE="LGPL-2 GPL-2"
14 KEYWORDS="amd64 ~arm x86"
15 IUSE="+ansi athena emacs +readline tk X"
20 RDEPEND="emacs? ( >=app-editors/emacs-23.1:* )
21 readline? ( sys-libs/readline:= )
22 athena? ( x11-libs/libXaw )
25 X? ( x11-libs/libXt x11-libs/libXext x11-libs/libXmu x11-libs/libXaw )
29 >=app-text/texi2html-1.64
30 >=sys-devel/autoconf-2.52"
35 mv "${WORKDIR}"/fedora/info/* info/
36 cp -p /usr/share/texmf-dist/tex/texinfo/texinfo.tex info/
37 find . -type f -perm /0111 | xargs chmod a-x
38 chmod a+x add-defs add-defs1 config.guess config.sub configure install.sh
39 chmod a+x bin/info bin/info1 gcl-tk/gcltksrv.in gcl-tk/ngcltksrv mp/gcclab
40 chmod a+x o/egrep-def utils/replace xbin/*
43 epatch "${WORKDIR}"/fedora/fd-leak.patch
44 epatch "${WORKDIR}"/fedora/latex.patch
45 epatch "${WORKDIR}"/fedora/texinfo.patch
46 epatch "${WORKDIR}"/fedora/elisp.patch
47 epatch "${WORKDIR}"/fedora/rename.patch
48 epatch "${WORKDIR}"/fedora/getcwd.patch
49 epatch "${WORKDIR}"/fedora/infrastructure.patch
50 epatch "${WORKDIR}"/fedora/extension.patch
51 epatch "${WORKDIR}"/fedora/unrandomize.patch
52 epatch "${WORKDIR}"/fedora/asm-signal-h.patch
53 epatch "${WORKDIR}"/fedora/plt.patch
54 epatch "${WORKDIR}"/fedora/ellipsis.patch
55 epatch "${WORKDIR}"/fedora/man.patch
56 epatch "${WORKDIR}"/fedora/reloc-type.patch
57 epatch "${WORKDIR}"/fedora/largefile.patch
59 epatch "${FILESDIR}"/${PN}-tcl-8.6.patch
60 epatch "${FILESDIR}"/${PN}-gmp-6.patch
61 epatch "${FILESDIR}"/${PN}-readline-6.3.patch
63 sed -e 's|"-fomit-frame-pointer"|""|' -i configure
64 sed -e 's|@EXT@||g' debian/in.gcl.1 > gcl.1
69 filter-flags -fstack-protector -fstack-protector-all
73 tcl="--enable-tclconfig=/usr/lib --enable-tkconfig=/usr/lib"
76 econf --enable-dynsysgmp \
78 --enable-emacsdir=/usr/share/emacs/site-lisp/gcl \
79 --enable-infodir=/usr/share/info \
80 $(use_enable readline) \
82 $(use_enable athena xgcl) \
89 VARTEXFONTS="${T}"/fonts emake -C info gcl.info
91 pushd xgcl-2 > /dev/null
98 local make_ansi_tests_clean="rm -f test.out *.fasl *.o *.so *~ *.fn *.x86f *.fasl *.ufsl"
102 ( make clean && make test-unixport ) \
103 || die "make ansi-tests failed!"
105 cat "${FILESDIR}/bootstrap-gcl" \
106 | ../unixport/saved_ansi_gcl
108 cat "${FILESDIR}/bootstrap-gcl" \
109 |sed s/bootstrapped_ansi_gcl/bootstrapped_r_ansi_gcl/g \
110 | ./bootstrapped_ansi_gcl
112 ( ${make_ansi_tests_clean} && \
113 echo "(load \"gclload.lsp\")" \
114 | ./bootstrapped_r_ansi_gcl ) \
115 || die "Phase 2, bootstraped compiler failed in tests"
120 emake DESTDIR="${D}" install
121 mv "${D}"usr/share/doc/*.dvi .
122 rm -rf "${D}"usr/share/doc
123 rm -rf "${D}"usr/share/emacs
124 rm -rf "${D}"usr/lib/gcl-*/info
126 rm doc/makefile elisp/add-defaults.el
127 dodoc readme* RELEASE* ChangeLog* doc/*
130 dohtml -r info/gcl-si info/gcl-tk
133 elisp-site-file-install "${FILESDIR}"/64${PN}-gentoo.el
134 elisp-install ${PN} elisp/*.el
137 insinto /usr/share/doc/${PF}
140 pushd xgcl-2 > /dev/null
141 insinto /usr/share/doc/${PF}
148 use emacs && elisp-site-regen
152 use emacs && elisp-site-regen