www-servers/nginx-unit: Fixed modules directory, Python dependencies
authorRalph Seichter <ralph@seichter.de>
Sat, 28 Jul 2018 13:04:43 +0000 (15:04 +0200)
committerMichał Górny <mgorny@gentoo.org>
Mon, 30 Jul 2018 20:22:59 +0000 (22:22 +0200)
Also added pkg_setup() to conditionally support Python and fixed
contents of REQUIRED_USE.

Closes: https://github.com/gentoo/gentoo/pull/9278

www-servers/nginx-unit/nginx-unit-1.3-r1.ebuild

index 9a9a22e39cd3332857108e5993018e1c75442ef8..304602c948a503c0d137baeb12e42e0e3105e2d5 100644 (file)
@@ -3,8 +3,11 @@
 
 EAPI=7
 
-MY_P="unit-${PV}"
+PYTHON_COMPAT=(python2_7 python3_{3,4,5,6})
+
+inherit python-single-r1
 
+MY_P="unit-${PV}"
 DESCRIPTION="A dynamic web and application server"
 HOMEPAGE="https://unit.nginx.org"
 SRC_URI="https://unit.nginx.org/download/${MY_P}.tar.gz -> ${P}.tar.gz"
@@ -12,23 +15,29 @@ SRC_URI="https://unit.nginx.org/download/${MY_P}.tar.gz -> ${P}.tar.gz"
 LICENSE="Apache-2.0"
 SLOT="0"
 KEYWORDS="~amd64"
-IUSE="perl python ruby"
-REQUIRED_USE="|| ( ${IUSE} )"
+MY_IUSE="perl python ruby"
+IUSE="${MY_IUSE}"
+REQUIRED_USE="|| ( ${MY_IUSE} ) python? ( ${PYTHON_REQUIRED_USE} )"
 
 DEPEND="perl? ( dev-lang/perl:= )
-       python? ( dev-lang/python:= )
+       python? ( ${PYTHON_DEPS} )
        ruby? ( dev-lang/ruby:= )"
 RDEPEND="${DEPEND}"
 S="${WORKDIR}/${MY_P}"
 
+pkg_setup() {
+       use python && python-single-r1_pkg_setup
+}
+
 src_configure() {
        ./configure \
                --prefix=/usr \
+               --modules=$(get_libdir)/${PN} \
                --log=/var/log/${PN} \
                --state=/var/lib/${PN} \
                --pid=/run/${PN}.pid \
                --control=unix:/run/${PN}.sock || die "Core configuration failed"
-       for flag in ${IUSE} ; do
+       for flag in ${MY_IUSE} ; do
                if use ${flag} ; then
                        ./configure ${flag} || die "Module configuration failed: ${flag}"
                fi