dev-python/pytest: arm64 stable (bug #723996)
[gentoo.git] / dev-lang / xsb / xsb-3.7.0-r1.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 MY_P="XSB${PV//./}"
7
8 PATCHSET_VER="3"
9
10 inherit autotools java-pkg-opt-2
11
12 DESCRIPTION="XSB is a logic programming and deductive database system"
13 HOMEPAGE="http://xsb.sourceforge.net"
14 SRC_URI="http://xsb.sourceforge.net/downloads/${MY_P}.tar.gz
15         mirror://gentoo/${P}-gentoo-patchset-${PATCHSET_VER}.tar.gz"
16
17 LICENSE="GPL-2 LGPL-2"
18 SLOT="0"
19 KEYWORDS="~amd64 ~x86"
20 IUSE="curl debug iodbc java mysql odbc pcre threads xml"
21
22 RDEPEND="curl? ( net-misc/curl )
23         iodbc? ( dev-db/libiodbc )
24         java? ( >=virtual/jdk-1.4:= )
25         mysql? ( dev-db/mysql-connector-c:0= )
26         odbc? ( dev-db/unixODBC )
27         pcre? ( dev-libs/libpcre )
28         xml? ( dev-libs/libxml2 )"
29
30 DEPEND="${RDEPEND}"
31
32 S="${WORKDIR}"/XSB
33
34 PATCHES=( "${WORKDIR}/${PV}" )
35
36 src_prepare() {
37         default
38         cd "${S}"/build
39         eautoconf
40 }
41
42 src_configure() {
43         cd "${S}"/build
44
45         econf \
46                 --prefix=/usr/$(get_libdir) \
47                 --disable-optimization \
48                 --without-smodels \
49                 $(use_with odbc) \
50                 $(use_with iodbc) \
51                 $(use_enable threads mt) \
52                 $(use_enable debug)
53
54         if use curl ; then
55                 cd "${S}"/packages/curl
56                 econf
57         fi
58
59         if use mysql ; then
60                 cd "${S}"/packages/dbdrivers/mysql
61                 econf
62         fi
63
64         if use odbc ; then
65                 cd "${S}"/packages/dbdrivers/odbc
66                 econf
67         fi
68
69         if use pcre ; then
70                 cd "${S}"/packages/pcre
71                 econf
72         fi
73
74         if use xml ; then
75                 cd "${S}"/packages/xpath
76                 econf
77         fi
78 }
79
80 src_compile() {
81         cd "${S}"/build
82
83         default
84
85         # All XSB Packages are compiled using a single Prolog engine.
86         # Consequently they must all be compiled using a single make job.
87
88         cd "${S}"/packages
89         rm -f *.xwam
90         emake -j1
91
92         if use curl ; then
93                 emake -j1 curl
94                 emake -j1 sgml
95                 if use xml ; then
96                         emake -j1 xpath
97                 fi
98         fi
99
100         if use mysql ; then
101                 emake -j1 mysql
102         fi
103
104         if use odbc ; then
105                 emake -j1 odbc
106         fi
107
108         if use pcre ; then
109                 emake -j1 pcre
110         fi
111 }
112
113 src_install() {
114         cd "${S}"/build
115         default
116
117         local XSB_INSTALL_DIR=/usr/$(get_libdir)/xsb-${PV}
118         dosym ${XSB_INSTALL_DIR}/bin/xsb /usr/bin/xsb
119
120         cd "${S}"/packages
121         local PACKAGES=${XSB_INSTALL_DIR}/packages
122         insinto ${PACKAGES}
123         doins *.xwam
124
125         insinto ${PACKAGES}/chr
126         doins chr/*.xwam
127
128         insinto ${PACKAGES}/clpqr
129         doins clpqr/*.xwam
130
131         insinto ${PACKAGES}/gap
132         doins gap/*.xwam
133
134         insinto ${PACKAGES}/justify
135         doins justify/*.xwam
136         doins justify/*.H
137
138         insinto ${PACKAGES}/regmatch
139         doins regmatch/*.xwam
140         insinto ${PACKAGES}/regmatch/cc
141         doins regmatch/cc/*.H
142
143         insinto ${PACKAGES}/slx
144         doins slx/*.xwam
145
146         insinto ${PACKAGES}/wildmatch
147         doins wildmatch/*.xwam
148         insinto ${PACKAGES}/wildmatch/cc
149         doins wildmatch/cc/*.H
150
151         if use curl ; then
152                 insinto ${PACKAGES}/curl
153                 doins curl/*.xwam
154                 insinto ${PACKAGES}/curl/cc
155                 doins curl/cc/*.H
156                 insinto ${PACKAGES}/sgml
157                 doins sgml/*.xwam
158                 insinto ${PACKAGES}/sgml/cc
159                 doins sgml/cc/*.H
160                 insinto ${PACKAGES}/sgml/cc/dtd
161                 doins sgml/cc/dtd/*
162                 if use xml ; then
163                         insinto ${PACKAGES}/xpath
164                         doins xpath/*xwam
165                         insinto ${PACKAGES}/xpath/cc
166                         doins xpath/cc/*.H
167                 fi
168         fi
169
170         if use mysql || use odbc ; then
171                 insinto ${PACKAGES}/dbdrivers
172                 doins dbdrivers/*.xwam
173                 doins dbdrivers/*.H
174                 insinto ${PACKAGES}/dbdrivers/cc
175                 doins dbdrivers/cc/*.H
176                 if use mysql ; then
177                         insinto ${PACKAGES}/dbdrivers/mysql
178                         doins dbdrivers/mysql/*.xwam
179                         insinto ${PACKAGES}/dbdrivers/mysql/cc
180                         doins dbdrivers/mysql/cc/*.H
181                 fi
182                 if use odbc ; then
183                         insinto ${PACKAGES}/dbdrivers/odbc
184                         doins dbdrivers/odbc/*.xwam
185                         insinto ${PACKAGES}/dbdrivers/odbc/cc
186                         doins dbdrivers/odbc/cc/*.H
187                 fi
188         fi
189
190         if use pcre ; then
191                 insinto ${PACKAGES}/pcre
192                 doins pcre/*.xwam
193                 insinto ${PACKAGES}/pcre/cc
194                 doins pcre/cc/*.H
195         fi
196
197         cd "${S}"
198         dodoc FAQ README
199 }