1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python2_7 )
7 inherit cmake-multilib eutils flag-o-matic mono-env python-r1
9 DESCRIPTION="Library for automatic proxy configuration management"
10 HOMEPAGE="https://github.com/libproxy/libproxy"
11 SRC_URI="https://github.com/libproxy/libproxy/archive/${PV}.tar.gz -> ${P}.tar.gz"
16 KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 ~sh sparc x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
18 IUSE="gnome kde mono networkmanager perl python spidermonkey test webkit"
19 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
21 # NOTE: mozjs/spidermonkey might still cause problems like #373397 ?
23 gnome? ( dev-libs/glib:2[${MULTILIB_USEDEP}] )
24 mono? ( dev-lang/mono )
25 networkmanager? ( sys-apps/dbus:0[${MULTILIB_USEDEP}] )
26 perl? ( dev-lang/perl:= )
27 python? ( ${PYTHON_DEPS} )
28 spidermonkey? ( >=dev-lang/spidermonkey-1.8.5:0= )
29 webkit? ( net-libs/webkit-gtk:4 )
32 virtual/pkgconfig:0[${MULTILIB_USEDEP}]
35 kde? ( kde-frameworks/kconfig:5 )
37 # avoid dependency loop, bug #467696
38 PDEPEND="networkmanager? ( net-misc/networkmanager )"
41 # get-pac-test freezes when run by the ebuild, succeeds when building
42 # manually; virtualx.eclass doesn't help :(
43 "${FILESDIR}/${PN}-0.4.10-disable-pac-test.patch"
45 # prevent dependency loop with networkmanager, libsoup, glib-networking; bug #467696
46 # https://github.com/libproxy/libproxy/issues/28
47 "${FILESDIR}/${PN}-0.4.11-avoid-nm-build-dep.patch"
49 # Gentoo's spidermonkey doesn't set Version: in mozjs18[57].pc
50 "${FILESDIR}/${PN}-0.4.12-mozjs.pc.patch"
52 # https://github.com/libproxy/libproxy/issues/27
53 "${FILESDIR}/${PN}-0.4.12-macosx.patch"
56 "${FILESDIR}/${P}-cmake-37.patch"
59 multilib_src_configure() {
61 "$(multilib_is_native_abi && usex perl -DPERL_VENDORINSTALL=ON)"
62 # WITH_VALA just copies the .vapi file over and needs no deps,
63 # hence always enable it unconditionally
65 "-DCMAKE_C_FLAGS=${CFLAGS}"
66 "-DCMAKE_CXX_FLAGS=${CXXFLAGS}"
67 "$(multilib_is_native_abi && usex mono -DGMCS_EXECUTABLE="${EPREFIX}/usr/bin/mcs")"
68 "-DWITH_GNOME3=$(usex gnome)"
69 "-DWITH_KDE=$(usex kde)"
70 "-DWITH_DOTNET=$(multilib_is_native_abi && usex mono || echo 'OFF')"
71 "-DWITH_NM=$(usex networkmanager)"
72 "-DWITH_PERL=$(multilib_is_native_abi && usex perl || echo 'OFF')"
73 "-DWITH_PYTHON=$(multilib_is_native_abi && usex python || echo 'OFF')"
74 "-DWITH_MOZJS=$(multilib_is_native_abi && usex spidermonkey || echo 'OFF')"
77 "-DWITH_WEBKIT3=$(multilib_is_native_abi && usex webkit || echo 'OFF')"
78 "-DBUILD_TESTING=$(usex test)"
80 cmake-utils_src_configure
84 [[ ${CHOST} == *-solaris* ]] && append-libs -lsocket -lnsl
86 use python && python_setup
87 multilib-minimal_src_configure
90 multilib_src_install_all() {
91 doman "${FILESDIR}/proxy.1"
92 use python && python_foreach_impl python_domodule 'bindings/python/libproxy.py'