1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 inherit eutils versionator fdo-mime
7 DESCRIPTION="Open source object-oriented logic programming language"
8 HOMEPAGE="http://logtalk.org"
9 MY_PV="lgt$(delete_all_version_separators)"
10 SRC_URI="http://logtalk.org/files/${MY_PV}.tar.bz2"
14 KEYWORDS="~amd64 ~ppc ~x86"
15 IUSE="gnupl qupl swipl xsbpl yappl xslt fop"
19 gnupl? ( dev-lang/gprolog )
20 qupl? ( !amd64? ( dev-lang/qu-prolog ) )
21 swipl? ( dev-lang/swi-prolog )
22 xsbpl? ( x86? ( dev-lang/xsb ) )
23 yappl? ( dev-lang/yap )
24 xslt? ( dev-libs/libxslt )
28 S="${WORKDIR}/${MY_PV}"
31 # Look at scripts/install.sh for upstream installation process.
32 # Install logtalk base
33 mv scripts/logtalk_user_setup.sh integration/
34 mkdir -p "${D}/usr/share/${P}"
35 cp -r compiler configs contributions VERSION.txt \
36 integration library wenv xml libpaths \
37 examples settings.lgt "${D}/usr/share/${P}" \
38 || die "Failed to install files"
40 # Install mime file, the database will be updated later
41 insinto /usr/share/mime/packages
42 doins scripts/freedesktop/logtalk.xml
44 # Install documentation
45 dodoc BIBLIOGRAPHY.bib CUSTOMIZE.txt INSTALL.txt \
46 LICENSE.txt QUICK_START.txt README.txt \
47 RELEASE_NOTES.txt UPGRADING.txt VERSION.txt
48 dohtml -r manuals/* || die "Failed to install html manual"
50 rm -f man/man1/logtalk_backend_select.1
51 rm -f man/man1/logtalk_version_select.1
52 doman man/man1/*.1 || die "Failed to install man pages"
54 # Integration symlinks
55 dosym /usr/share/${P}/integration/logtalk_user_setup.sh \
56 /usr/bin/logtalk_user_setup
57 use gnupl && dosym /usr/share/${P}/integration/gplgt.sh \
59 use qupl && ! use amd64 && dosym /usr/share/${P}/integration/qplgt.sh \
61 use swipl && dosym /usr/share/${P}/integration/swilgt.sh \
63 use xsbpl && use x86 && dosym /usr/share/${P}/integration/xsblgt.sh \
65 use yappl && dosym /usr/share/${P}/integration/yaplgt.sh \
68 dosym /usr/share/${P}/xml/lgt2xml.sh /usr/bin/lgt2xml
69 use xslt && dosym /usr/share/${P}/xml/lgt2html.sh /usr/bin/lgt2html
70 use xslt && dosym /usr/share/${P}/xml/lgt2txt.sh /usr/bin/lgt2txt
71 use fop && dosym /usr/share/${P}/xml/lgt2pdf.sh /usr/bin/lgt2pdf
73 # Install environment files
74 echo "LOGTALKHOME=/usr/share/${P}" > 99logtalk
79 fdo-mime_desktop_database_update
81 ewarn "Before running logtalk, users should execute"
82 ewarn "logtalk_user_setup *once*."
83 ewarn "To start logtalk use one of the following:"
84 use gnupl && ewarn "GNU Prolog: /usr/bin/gplgt"
85 use qupl && ! use amd64 && ewarn "Qu Prolog: /usr/bin/qplgt"
86 use swipl && ewarn "SWI Prolog: /usr/bin/swilgt"
87 use xsbpl && use x86 && ewarn "XSB: /usr/bin/xsblgt"
88 use yappl && ewarn "YAP: /usr/bin/yaplgt"
91 ewarn "The environment has been set up to make the above"
92 ewarn "integration scripts find files automatically for logtalk."
93 ewarn "Please run 'etc-update && source /etc/profile' to update"
94 ewarn "the environment now, otherwise it will be updated at next"
99 fdo-mime_desktop_database_update