1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit eutils autotools flag-o-matic elisp-common
8 DESCRIPTION="Scheme interpreter"
9 HOMEPAGE="https://www.gnu.org/software/guile/"
10 SRC_URI="mirror://gnu/guile/${P}.tar.gz"
13 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~x86-interix ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
14 IUSE="debug debug-freelist debug-malloc +deprecated discouraged emacs networking nls readline +regex +threads"
16 RESTRICT="!regex? ( test )"
23 emacs? ( virtual/emacs )
24 readline? ( sys-libs/readline:0= )"
29 # Guile seems to contain some slotting support, /usr/share/guile/ is slotted,
30 # but there are lots of collisions. Most in /usr/share/libguile. Therefore
31 # I'm slotting this in the same slot as guile-1.6* for now.
36 epatch "${FILESDIR}/${P}-fix_guile-config.patch" \
37 "${FILESDIR}/${P}-gcc46.patch" \
38 "${FILESDIR}/${P}-gcc5.patch" \
39 "${FILESDIR}/${P}-makeinfo-5.patch" \
40 "${FILESDIR}/${P}-gtexinfo-5.patch" \
41 "${FILESDIR}/${P}-readline.patch" \
42 "${FILESDIR}/${P}-tinfo.patch" \
43 "${FILESDIR}/${P}-sandbox.patch" \
44 "${FILESDIR}/${P}-mkdir-mask.patch"
47 -e "s/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/g" \
48 -e "/AM_PROG_CC_STDC/d" \
49 -i guile-readline/configure.in || die
53 mv "${S}"/configure.{in,ac} || die
54 mv "${S}"/guile-readline/configure.{in,ac} || die
61 filter-flags -ftree-vectorize
63 #will fail for me if posix is disabled or without modules -- hkBst
65 --disable-error-on-warning \
68 $(use_enable networking) \
69 $(use_enable readline) \
71 $(use deprecated || use_enable discouraged) \
72 $(use_enable deprecated) \
73 $(use_enable emacs elisp) \
76 $(use_enable debug-freelist) \
77 $(use_enable debug-malloc) \
78 $(use_enable debug guile-debug) \
87 # Above we have disabled the build system's Emacs support;
88 # for USE=emacs we compile (and install) the files manually
91 elisp-compile *.el || die
96 emake DESTDIR="${D}" install
98 dodoc AUTHORS ChangeLog GUILE-VERSION HACKING NEWS README THANKS
100 # texmacs needs this, closing bug #23493
102 echo "GUILE_LOAD_PATH=\"${EPREFIX}/usr/share/guile/${MAJOR}\"" > "${ED}"/etc/env.d/50guile || die
104 # necessary for registering slib, see bug 206896
105 keepdir /usr/share/guile/site
108 elisp-install ${PN} emacs/*.{el,elc} || die
109 elisp-site-file-install "${FILESDIR}/50${PN}-gentoo.el" || die
114 use emacs && elisp-site-regen
118 use emacs && elisp-site-regen