sys-apps/groff: stable 1.22.4 for hppa, bug #704420
[gentoo.git] / dev-lisp / gcl / gcl-2.6.10.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 inherit elisp-common eutils flag-o-matic
7
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"
11
12 LICENSE="LGPL-2 GPL-2"
13 SLOT="0"
14 KEYWORDS="amd64 ~arm x86"
15 IUSE="+ansi athena emacs +readline tk X"
16
17 # See bug #205803
18 RESTRICT="strip"
19
20 RDEPEND="emacs? ( >=app-editors/emacs-23.1:* )
21         readline? ( sys-libs/readline:= )
22         athena? ( x11-libs/libXaw )
23         >=dev-libs/gmp-4.1:=
24         tk? ( dev-lang/tk:= )
25         X? ( x11-libs/libXt x11-libs/libXext x11-libs/libXmu x11-libs/libXaw )
26         virtual/latex-base"
27 DEPEND="${RDEPEND}
28         virtual/texi2dvi
29         >=app-text/texi2html-1.64
30         >=sys-devel/autoconf-2.52"
31
32 S="${WORKDIR}"/${PN}
33
34 src_prepare() {
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/*
41
42         # fedora patches
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
58
59         epatch "${FILESDIR}"/${PN}-tcl-8.6.patch
60         epatch "${FILESDIR}"/${PN}-gmp-6.patch
61         epatch "${FILESDIR}"/${PN}-readline-6.3.patch
62
63         sed -e 's|"-fomit-frame-pointer"|""|' -i configure
64         sed -e 's|@EXT@||g' debian/in.gcl.1 > gcl.1
65 }
66
67 src_configure() {
68         strip-flags
69         filter-flags -fstack-protector -fstack-protector-all
70
71         local tcl=""
72         if use tk; then
73                 tcl="--enable-tclconfig=/usr/lib --enable-tkconfig=/usr/lib"
74         fi
75
76         econf --enable-dynsysgmp \
77                 --disable-xdr \
78                 --enable-emacsdir=/usr/share/emacs/site-lisp/gcl \
79                 --enable-infodir=/usr/share/info \
80                 $(use_enable readline) \
81                 $(use_enable ansi) \
82                 $(use_enable athena xgcl) \
83                 $(use_with X x) \
84                 ${tcl}
85 }
86
87 src_compile() {
88         emake -j1
89         VARTEXFONTS="${T}"/fonts emake -C info gcl.info
90         if use athena; then
91                 pushd xgcl-2 > /dev/null
92                 pdflatex dwdoc.tex
93                 popd > /dev/null
94         fi
95 }
96
97 src_test() {
98         local make_ansi_tests_clean="rm -f test.out *.fasl *.o *.so *~ *.fn *.x86f *.fasl *.ufsl"
99         if use ansi; then
100                 cd ansi-tests
101
102                 ( make clean && make test-unixport ) \
103                         || die "make ansi-tests failed!"
104
105                 cat "${FILESDIR}/bootstrap-gcl" \
106                         | ../unixport/saved_ansi_gcl
107
108                 cat "${FILESDIR}/bootstrap-gcl" \
109                         |sed s/bootstrapped_ansi_gcl/bootstrapped_r_ansi_gcl/g \
110                         | ./bootstrapped_ansi_gcl
111
112                 ( ${make_ansi_tests_clean} && \
113                         echo "(load \"gclload.lsp\")" \
114                         | ./bootstrapped_r_ansi_gcl ) \
115                         || die "Phase 2, bootstraped compiler failed in tests"
116         fi
117 }
118
119 src_install() {
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
125
126         rm doc/makefile elisp/add-defaults.el
127         dodoc readme* RELEASE* ChangeLog* doc/*
128         doman gcl.1
129         doinfo info/*.info*
130         dohtml -r info/gcl-si info/gcl-tk
131
132         if use emacs; then
133                 elisp-site-file-install "${FILESDIR}"/64${PN}-gentoo.el
134                 elisp-install ${PN} elisp/*.el
135         fi
136
137         insinto /usr/share/doc/${PF}
138         doins *.dvi
139         if use athena; then
140                 pushd xgcl-2 > /dev/null
141                 insinto /usr/share/doc/${PF}
142                 doins *.pdf
143                 popd > /dev/null
144         fi
145 }
146
147 pkg_postinst() {
148         use emacs && elisp-site-regen
149 }
150
151 pkg_postrm() {
152         use emacs && elisp-site-regen
153 }