Set PKG_OPTIONS via INSTALL_ENV variable instead of using SUBST FRAMEWORK.

Applied patch from upstream.
This commit is contained in:
Blue Rats 2014-01-05 06:21:12 +00:00 committed by Thomas Klausner
parent 432a3abac0
commit c79adce9b5
4 changed files with 37 additions and 26 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.2 2014/01/05 03:37:54 othyro Exp $
# $NetBSD: Makefile,v 1.3 2014/01/05 06:21:12 othyro Exp $
DISTNAME= uwsgi-2.0
PKGNAME= ${PYPKGPREFIX}-${DISTNAME}
@ -17,14 +17,10 @@ USE_TOOLS+= pkg-config
PLIST_SUBST+= PYVERSSUFFIX=${PYVERSSUFFIX}
EGG_NAME= ${DISTNAME:S/uwsgi/uWSGI/}
SUBST_CLASSES+= options
SUBST_FILES.options= buildconf/base.ini
SUBST_MESSAGE.options= Fixing PKG_OPTIONS.
SUBST_STAGE.options= pre-configure
.include "options.mk"
INSTALL_ENV+= UWSGI_INCLUDES=${PREFIX}/include
INSTALL_ENV+= UWSGI_PROFILE_OVERRIDE="${UWSGI_DEBUG}${UWSGI_JSON}${UWSGI_PCRE}${UWSGI_SSL}${UWSGI_UUID}${UWSGI_XML}${UWSGI_YAML}"
INSTALLATION_DIRS+= share/examples/py-uwsgi
post-install:

View file

@ -1,8 +1,8 @@
$NetBSD: distinfo,v 1.3 2014/01/05 04:59:51 othyro Exp $
$NetBSD: distinfo,v 1.4 2014/01/05 06:21:12 othyro Exp $
SHA1 (uwsgi-2.0.tar.gz) = 6a210d25ab66b5726850fe0c80793ede55f02bcf
RMD160 (uwsgi-2.0.tar.gz) = d42e8d630e08696247de75ec208de6c57a918ca8
Size (uwsgi-2.0.tar.gz) = 744221 bytes
SHA1 (patch-base.ini) = f1b61f8323a7be92ebae5c87b8a32b3109145036
SHA1 (patch-uwsgi.h) = 911aa69e7973b92c726fa293748ae6a875b45353
SHA1 (patch-uwsgiconfig.py) = 9d84206e86168465d83eec640bd4b575fc428d43
SHA1 (patch-uwsgiconfig.py) = 712bed7b8c114f1c9c457660151137fa469f0cb5

View file

@ -1,4 +1,4 @@
# $NetBSD: options.mk,v 1.1 2014/01/05 03:42:11 othyro Exp $
# $NetBSD: options.mk,v 1.2 2014/01/05 06:21:12 othyro Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.py-uwsgi
PKG_SUPPORTED_OPTIONS= debug openssl pcre uuid yaml zlib
@ -10,58 +10,64 @@ PKG_OPTIONS_GROUP.xml= expat libxml2
.include "../../mk/bsd.options.mk"
UWSGI_DEBUG= debug=false;
.if !empty(PKG_OPTIONS:Mdebug)
# XXX: This doesn't work for some reason.
# XXX: "if self.get('debug')" evaluates to "None". What.
SUBST_SED.options+= -e 's|debug = false|debug = true|1'
UWSGI_DEBUG= debug=true;
.endif
UWSGI_XML= xml=auto;
.if !empty(PKG_OPTIONS:Mexpat)
.include "../../textproc/expat/buildlink3.mk"
SUBST_SED.options+= -e 's|xml = auto|xml = expat|1'
UWSGI_XML= xml=expat;
.elif !empty(PKG_OPTIONS:Mlibxml2)
.include "../../textproc/libxml2/buildlink3.mk"
SUBST_SED.options+= -e 's|xml = auto|xml = libxml2|1'
UWSGI_XML= xml=libxml2;
.else
SUBST_SED.options+= -e 's|xml = auto|xml = false|1'
UWSGI_XML= xml=false;
.endif
UWSGI_JSON= json=auto;
.if !empty(PKG_OPTIONS:Mjansson)
.include "../../textproc/jansson/buildlink3.mk"
SUBST_SED.options+= -e 's|json = auto|json = jansson|1'
UWSGI_JSON= json=jansson;
.elif !empty(PKG_OPTIONS:Myajl)
.include "../../devel/yajl/buildlink3.mk"
SUBST_SED.options+= -e 's|json = auto|json = yajl|1'
UWSGI_JSON= json=yajl;
BROKEN= The yajl option requires a yajl.pc file which that package doesn't have.
.else
SUBST_SED.options+= -e 's|json = auto|json = false|1'
UWSGI_JSON= json=false;
.endif
UWSGI_SSL= ssl=auto;
.if !empty(PKG_OPTIONS:Mopenssl)
.include "../../security/openssl/buildlink3.mk"
SUBST_SED.options+= -e 's|ssl = auto|ssl = true|1'
UWSGI_SSL= ssl=true;
.else
SUBST_SED.options+= -e 's|ssl = auto|ssl = false|1'
UWSGI_SSL= ssl=false;
.endif
UWSGI_PCRE= pcre=auto;
.if !empty(PKG_OPTIONS:Mpcre)
.include "../../devel/pcre/buildlink3.mk"
SUBST_SED.options+= -e 's|pcre = auto|pcre = true|1'
UWSGI_PCRE= pcre=true;
.else
SUBST_SED.options+= -e 's|pcre = auto|pcre = false|1'
UWSGI_PCRE= pcre=false;
.endif
UWSGI_UUID= uuid=auto;
.if !empty(PKG_OPTIONS:Muuid)
.include "../../devel/libuuid/buildlink3.mk"
SUBST_SED.options+= -e 's|uuid = auto|uuid = true|1'
UWSGI_UUID= uuid=true;
.else
SUBST_SED.options+= -e 's|uuid = auto|uuid = false|1'
UWSGI_UUID= uuid=false;
.endif
UWSGI_YAML= yaml=auto
.if !empty(PKG_OPTIONS:Myaml)
.include "../../textproc/libyaml/buildlink3.mk"
UWSGI_YAML= yaml=true
.else
SUBST_SED.options+= -e 's|yaml = true|yaml = false|1'
UWSGI_YAML= yaml=false
.endif
.if !empty(PKG_OPTIONS:Mzlib)

View file

@ -1,4 +1,4 @@
$NetBSD: patch-uwsgiconfig.py,v 1.3 2014/01/05 04:59:51 othyro Exp $
$NetBSD: patch-uwsgiconfig.py,v 1.4 2014/01/05 06:21:12 othyro Exp $
Disable inclusion of certain packages by default. Use options framework instead.
@ -12,6 +12,15 @@ Disable inclusion of certain packages by default. Use options framework instead.
'routing': False,
'capabilities': False,
'yaml': False,
@@ -734,7 +735,7 @@ class uConf(object):
if 'UWSGI_PROFILE_OVERRIDE' in os.environ:
for item in os.environ['UWSGI_PROFILE_OVERRIDE'].split(';'):
k,v = item.split('=', 2)
- uc.set(k, v)
+ self.set(k, v)
if 'UWSGI_AS_LIB' in os.environ:
self.set('as_shared_library', 'true')
@@ -816,6 +817,8 @@ class uConf(object):
if locking_mode == 'auto':
if uwsgi_os == 'Linux' or uwsgi_os == 'SunOS':