summaryrefslogtreecommitdiff
blob: 04d6f5b11bdec906c0107a887c80bd274ece5b3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_{9,10,11} )

inherit python-r1 toolchain-funcs

DESCRIPTION="Library to parse proxy auto-config files"
HOMEPAGE="http://pacparser.manugarg.com/"
SRC_URI="https://github.com/manugarg/${PN}/archive/v${PV}/${P}.tar.gz"

LICENSE="LGPL-3"
SLOT="0/1"
KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
IUSE="doc python"

DEPEND="python? ( ${PYTHON_DEPS} )"
RDEPEND="${DEPEND}"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"

# spidermonkey-1.7.0 is bundled
# tested unbundling with spidermonkey-1.8* and 1.7
# and got many failures: unbundling not worth it.

PATCHES=(
	"${FILESDIR}/${P}-build.patch"
	"${FILESDIR}/${P}-pymod.patch"
)

src_prepare() {
	default

	sed -e '/CC = gcc/d' \
		-i src/spidermonkey/js/src/config/Linux_All.mk || die

	export NO_INTERNET=yes
	export VERSION="${PV}"
	tc-export CC AR RANLIB
}

src_compile() {
	# Upstream parallel compilation bug, do that first to work around
	emake -C src/spidermonkey
	emake -C src
	use python && python_foreach_impl emake -C src pymod
}

src_install() {
	emake \
		LIB_PREFIX="${ED}/usr/$(get_libdir)" \
		DOC_PREFIX="${ED}/usr/share/doc/${PF}" \
		BIN_PREFIX="${ED}"/usr/bin \
		INC_PREFIX="${ED}"/usr/include \
		MAN_PREFIX="${ED}"/usr/share/man \
		-C src install
	dodoc README.md

	if use python; then
		python_foreach_impl emake DESTDIR="${D}" -C src install-pymod
		python_foreach_impl python_optimize
	fi

	if use doc; then
		docompress -x /usr/share/doc/${PF}/{html,examples}
	else
		rm -r "${ED}"/usr/share/doc/${PF}/{html,examples} || die
	fi
}