dev-ml/llvm-ocaml: Enable py3.8
[gentoo.git] / dev-ml / ocamlnet / ocamlnet-4.1.4.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 eutils findlib
7
8 MY_P=${P/_beta/test}
9 DESCRIPTION="Modules for OCaml application-level Internet protocols"
10 HOMEPAGE="http://projects.camlcity.org/projects/ocamlnet.html"
11 SRC_URI="http://download.camlcity.org/download/${MY_P}.tar.gz"
12
13 LICENSE="ZLIB GPL-2+"
14 SLOT="0/${PV}"
15 KEYWORDS="~amd64 ~ppc ~x86"
16 IUSE="gtk kerberos tk httpd +ocamlopt +pcre ssl zip"
17 RESTRICT="installsources strip"
18
19 # the auth-dh compile flag has been disabled as well, since it depends on
20 # ocaml-cryptgps, which is not available.
21
22 RDEPEND=">=dev-ml/findlib-1.0
23                 pcre? ( >=dev-ml/pcre-ocaml-5:= )
24                 >=dev-lang/ocaml-3.10.2:=[ocamlopt?]
25                 tk? ( dev-ml/labltk:= )
26                 ssl? ( net-libs/gnutls:= )
27                 gtk? ( >=dev-ml/lablgtk-2:= )
28                 kerberos? ( virtual/krb5 )
29                 zip? ( dev-ml/camlzip:= )
30                 "
31 DEPEND="${RDEPEND}
32         virtual/pkgconfig
33 "
34
35 S=${WORKDIR}/${MY_P}
36
37 ocamlnet_use_with() {
38         if use $1; then
39                 echo "-with-$2"
40         else
41                 echo "-without-$2"
42         fi
43 }
44
45 ocamlnet_use_enable() {
46         if use $1; then
47                 echo "-enable-$2"
48         else
49                 echo "-disable-$2"
50         fi
51 }
52
53 src_configure() {
54         ./configure \
55                 -bindir /usr/bin \
56                 -datadir /usr/share/${PN} \
57                 $(ocamlnet_use_enable ssl gnutls) \
58                 $(ocamlnet_use_enable gtk gtk2) \
59                 $(ocamlnet_use_enable kerberos gssapi) \
60                 $(ocamlnet_use_enable pcre pcre) \
61                 $(ocamlnet_use_enable tk tcl) \
62                 $(ocamlnet_use_enable zip zip) \
63                 $(ocamlnet_use_with httpd nethttpd) \
64                 || die "Error : econf failed!"
65 }
66
67 src_compile() {
68         emake -j1 all
69         if use ocamlopt; then
70                 emake -j1 opt
71         fi
72 }