Skip to content
Permalink
Browse files

nghttp2: permit build w/o python

Closes: https://trac.macports.org/ticket/58287
remove traces of python34
  • Loading branch information
Schamschula committed Apr 2, 2019
1 parent 6588a7e commit 484b0e9201ce6934c95fcbfb7767c27fe7f89c32
Showing with 57 additions and 31 deletions.
  1. +37 −31 www/nghttp2/Portfile
  2. +20 −0 www/nghttp2/files/patch-configure-nopython.diff
@@ -28,18 +28,6 @@ checksums rmd160 6743620cb9e0001b4ba8401cb744cd544a9f70c9 \
# nghttp2 requires C++14
compiler.blacklist-append {clang < 602}

if {![variant_isset python34] && ![variant_isset python35] && ![variant_isset python36] && ![variant_isset python37]} { default_variants +python27 }

if {![variant_isset python27] && ![variant_isset python34] && ![variant_isset python35] && ![variant_isset python36] && ![variant_isset python37]} {
error "You must select one of the python variants."
}

if {[variant_isset python27]} { set PythonVersion 2.7 }
if {[variant_isset python35]} { set PythonVersion 3.5 }
if {[variant_isset python36]} { set PythonVersion 3.6 }
if {[variant_isset python37]} { set PythonVersion 3.7 }
set PythonBranch [join [lrange [split ${PythonVersion} .] 0 1] ""]

depends_build port:pkgconfig

depends_lib port:c-ares \
@@ -48,43 +36,61 @@ depends_lib port:c-ares \
port:libevent \
port:libxml2 \
path:lib/libssl.dylib:openssl \
port:py${PythonBranch}-cython \
port:py${PythonBranch}-setuptools \
port:python${PythonBranch} \
port:zlib

# See: https://trac.macports.org/ticket/57960
patchfiles-append patch-src-shrpx_client_handler.cc.diff \
patchfiles-append patch-configure-nopython.diff \
patch-src-shrpx_client_handler.cc.diff \
src-shrpx_config.diff

use_autoreconf yes

configure.args --disable-silent-rules \
--disable-threads \
--enable-app \
ac_cv_prog_AWK=/usr/bin/awk

configure.env JANSSON_CFLAGS=-I${prefix}/include \
LIBEVENT_OPENSSL_CFLAGS=-I${prefix}/include/event2 \
OPENSSL_CFLAGS=-I${prefix}/include/openssl

if {[vercmp [macports_version] 2.5.99] >= 0} {
configure.env CYTHON=${prefix}/bin/cython-${PythonVersion} \
JANSSON_CFLAGS=-I${prefix}/include \
configure.env-append \
"JANSSON_LIBS=-L${prefix}/lib -ljansson" \
LIBEVENT_OPENSSL_CFLAGS=-I${prefix}/include/event2 \
"LIBEVENT_OPENSSL_LIBS=-L${prefix}/lib -levent -levent_openssl" \
OPENSSL_CFLAGS=-I${prefix}/include/openssl \
"OPENSSL_LIBS=-L${prefix}/lib -lcrypto -lssl" \
PYTHON=${prefix}/bin/python${PythonVersion}
"OPENSSL_LIBS=-L${prefix}/lib -lcrypto -lssl"
} else {
configure.env CYTHON=${prefix}/bin/cython-${PythonVersion} \
JANSSON_CFLAGS=-I${prefix}/include JANSSON_LIBS="-L${prefix}/lib -ljansson" \
LIBEVENT_OPENSSL_CFLAGS=-I${prefix}/include/event2 \
configure.env-append \
JANSSON_LIBS="-L${prefix}/lib -ljansson" \
LIBEVENT_OPENSSL_LIBS="-L${prefix}/lib -levent -levent_openssl" \
OPENSSL_CFLAGS=-I${prefix}/include/openssl \
OPENSSL_LIBS="-L${prefix}/lib -lcrypto -lssl" \
PYTHON=${prefix}/bin/python${PythonVersion}
OPENSSL_LIBS="-L${prefix}/lib -lcrypto -lssl"
}

destroot.env PYTHONPATH=${destroot}${prefix}/lib/python${PythonVersion}/site-packages/
if {[variant_isset python27]} { set PythonVersion 2.7 }
if {[variant_isset python36]} { set PythonVersion 3.6 }
if {[variant_isset python37]} { set PythonVersion 3.7 }

if {[variant_isset python27] || [variant_isset python36] || [variant_isset python37]} {
set PythonBranch [join [lrange [split ${PythonVersion} .] 0 1] ""]

depends_lib-append \
port:py${PythonBranch}-cython \
port:py${PythonBranch}-setuptools \
port:python${PythonBranch}

configure.env-append \
CYTHON=${prefix}/bin/cython-${PythonVersion} \
PYTHON=${prefix}/bin/python${PythonVersion}

pre-destroot {
xinstall -d ${destroot}${prefix}/lib/python${PythonVersion}/site-packages/
destroot.env PYTHONPATH=${destroot}${prefix}/lib/python${PythonVersion}/site-packages/

pre-destroot {
xinstall -d ${destroot}${prefix}/lib/python${PythonVersion}/site-packages/
}
} else {
configure.args-append \
--disable-python-bindings \
--without-cython
}

variant python27 conflicts python35 python36 python37 description {Build using Python 2.7} {
@@ -0,0 +1,20 @@
diff --git a/configure.ac b/configure.ac
index 051eb139..e2a00ac8 100644
--- configure.ac
+++ configure.ac
@@ -151,8 +151,6 @@ AC_PROG_MKDIR_P

PKG_PROG_PKG_CONFIG([0.20])

-AM_PATH_PYTHON([2.7],, [:])
-
if [test "x$request_lib_only" = "xyes"]; then
request_app=no
request_hpack_tools=no
@@ -161,6 +159,7 @@ if [test "x$request_lib_only" = "xyes"]; then
fi

if [test "x$request_python_bindings" != "xno"]; then
+ AM_PATH_PYTHON([2.7],, [:])
AX_PYTHON_DEVEL([>= '2.7'])
fi

0 comments on commit 484b0e9

Please sign in to comment.
You can’t perform that action at this time.