485682ad5c8017c8482c80627ff642c8591b88b9
[gentoo.git] / dev-scheme / guile / guile-2.0.12.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=6
6 inherit flag-o-matic
7
8 DESCRIPTION="GNU Ubiquitous Intelligent Language for Extensions"
9 HOMEPAGE="https://www.gnu.org/software/guile/"
10 SRC_URI="mirror://gnu/guile/${P}.tar.gz"
11 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"
12 LICENSE="LGPL-3+"
13 IUSE="debug debug-malloc +deprecated networking nls +regex static-libs +threads"
14
15 # emacs useflag removal not working
16
17 RDEPEND="
18         >=dev-libs/boehm-gc-7.0[threads?]
19         dev-libs/gmp:=
20         virtual/libffi
21         dev-libs/libltdl:=
22         sys-devel/libtool
23         sys-libs/ncurses:="
24 DEPEND="${RDEPEND}
25         virtual/pkgconfig
26         sys-apps/texinfo
27         sys-devel/gettext"
28
29 SLOT="12"
30 MAJOR="2.0"
31
32 DOCS=( GUILE-VERSION HACKING README )
33
34 src_configure() {
35         # see bug #178499
36         filter-flags -ftree-vectorize
37
38         # will fail for me if posix is disabled or without modules -- hkBst
39         econf \
40                 --disable-error-on-warning \
41                 --disable-rpath \
42                 --enable-posix \
43                 --with-modules \
44                 $(use_enable debug guile-debug) \
45                 $(use_enable debug-malloc) \
46                 $(use_enable deprecated) \
47                 $(use_enable networking) \
48                 $(use_enable nls) \
49                 $(use_enable regex) \
50                 $(use_with threads)
51 }
52
53 src_install() {
54         default
55
56         # From Novell
57         #       https://bugzilla.novell.com/show_bug.cgi?id=874028#c0
58         dodir /usr/share/gdb/auto-load/$(get_libdir)
59         mv "${D}"/usr/$(get_libdir)/libguile-*-gdb.scm "${D}"/usr/share/gdb/auto-load/$(get_libdir) || die
60
61         # texmacs needs this, closing bug #23493
62         dodir /etc/env.d
63         echo "GUILE_LOAD_PATH=\"${EPREFIX}/usr/share/guile/${MAJOR}\"" > "${ED}"/etc/env.d/50guile || die
64
65         # necessary for registering slib, see bug 206896
66         keepdir /usr/share/guile/site
67
68         # Dark magic necessary for some deps
69         dosym /usr/$(get_libdir)/libguile-2.0.so /usr/$(get_libdir)/libguile.so
70 }
71
72 pkg_postinst() {
73         [[ "${EROOT}" == "/" ]] && pkg_config
74 }
75
76 pkg_config() {
77         if has_version '>dev-scheme/slib-3.2.4'; then
78                 einfo "Registering slib with guile"
79                 install_slib_for_guile
80         fi
81 }