diff options
author | Benedikt Boehm <hollow@gentoo.org> | 2010-05-03 19:24:28 +0000 |
---|---|---|
committer | Benedikt Boehm <hollow@gentoo.org> | 2010-05-03 19:24:28 +0000 |
commit | c41bf196066030471d8bd085eba5d896ed44e54b (patch) | |
tree | fe9000bd0f67cb8f3632a06c61165980f534a550 /www-servers/uwsgi | |
parent | old (diff) | |
download | gentoo-2-c41bf196066030471d8bd085eba5d896ed44e54b.tar.gz gentoo-2-c41bf196066030471d8bd085eba5d896ed44e54b.tar.bz2 gentoo-2-c41bf196066030471d8bd085eba5d896ed44e54b.zip |
initial ebuild. thanks to Arfrever Frehtes Taifersar Arahesis for sane python ABI support. closes #314931
(Portage version: 2.2_rc67/cvs/Linux i686)
Diffstat (limited to 'www-servers/uwsgi')
-rw-r--r-- | www-servers/uwsgi/ChangeLog | 12 | ||||
-rw-r--r-- | www-servers/uwsgi/files/uwsgi-0.9.5-fix_uwsgiconfig.py_indentation.patch | 51 | ||||
-rw-r--r-- | www-servers/uwsgi/files/uwsgi-0.9.5-respect_flags.patch | 127 | ||||
-rw-r--r-- | www-servers/uwsgi/metadata.xml | 9 | ||||
-rw-r--r-- | www-servers/uwsgi/uwsgi-0.9.5.ebuild | 44 |
5 files changed, 243 insertions, 0 deletions
diff --git a/www-servers/uwsgi/ChangeLog b/www-servers/uwsgi/ChangeLog new file mode 100644 index 000000000000..893166c9982e --- /dev/null +++ b/www-servers/uwsgi/ChangeLog @@ -0,0 +1,12 @@ +# ChangeLog for www-servers/uwsgi +# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/ChangeLog,v 1.1 2010/05/03 19:24:28 hollow Exp $ + +*uwsgi-0.9.5 (03 May 2010) + + 03 May 2010; Benedikt Böhm <hollow@gentoo.org> +uwsgi-0.9.5.ebuild, + +files/uwsgi-0.9.5-fix_uwsgiconfig.py_indentation.patch, + +files/uwsgi-0.9.5-respect_flags.patch, +metadata.xml: + initial ebuild. thanks to Arfrever Frehtes Taifersar Arahesis for sane + python ABI support. closes #314931 + diff --git a/www-servers/uwsgi/files/uwsgi-0.9.5-fix_uwsgiconfig.py_indentation.patch b/www-servers/uwsgi/files/uwsgi-0.9.5-fix_uwsgiconfig.py_indentation.patch new file mode 100644 index 000000000000..e02f497c0eab --- /dev/null +++ b/www-servers/uwsgi/files/uwsgi-0.9.5-fix_uwsgiconfig.py_indentation.patch @@ -0,0 +1,51 @@ +--- uwsgiconfig.py ++++ uwsgiconfig.py +@@ -68,9 +68,9 @@ + p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) + + if p.wait() == 0: +- return p.stdout.read().rstrip().decode() ++ return p.stdout.read().rstrip().decode() + else: +- return None ++ return None + + def add_o(x): + if x == 'uwsgi': +@@ -149,11 +149,11 @@ + kvm_list = ['FreeBSD', 'OpenBSD', 'NetBSD', 'DragonFly'] + + if uwsgi_os == 'SunOS': +- ldflags.append('-lsendfile') ++ ldflags.append('-lsendfile') + ldflags.remove('-rdynamic') + + if uwsgi_os in kvm_list: +- ldflags.append('-lkvm') ++ ldflags.append('-lkvm') + + if uwsgi_os == 'OpenBSD': + UGREEN = False +@@ -245,8 +245,8 @@ + gcc_list.append('erlang') + + if SCTP: +- ldflags.append("-lsctp") +- cflags.append("-DUWSGI_SCTP") ++ ldflags.append("-lsctp") ++ cflags.append("-DUWSGI_SCTP") + + if SPOOLER: + depends_on("SPOOLER", ['EMBEDDED']) +@@ -294,9 +294,9 @@ + sys.exit(1) + + if cmd == '--cflags': +- print(' '.join(cflags)) ++ print(' '.join(cflags)) + if cmd == '--ldflags': +- print(' '.join(ldflags)) ++ print(' '.join(ldflags)) + elif cmd == '--build': + parse_vars() + build_uwsgi(UWSGI_BIN_NAME) diff --git a/www-servers/uwsgi/files/uwsgi-0.9.5-respect_flags.patch b/www-servers/uwsgi/files/uwsgi-0.9.5-respect_flags.patch new file mode 100644 index 000000000000..c3f740d5aa7f --- /dev/null +++ b/www-servers/uwsgi/files/uwsgi-0.9.5-respect_flags.patch @@ -0,0 +1,127 @@ +--- uwsgiconfig.py ++++ uwsgiconfig.py +@@ -20,7 +20,6 @@ + PLUGINS = [] + UNBIT=False + UWSGI_BIN_NAME = 'uwsgi' +-GCC='gcc' + + # specific compilation flags + # libxml2 or expat +@@ -46,17 +45,22 @@ + + from distutils import sysconfig + ++GCC = os.environ.get('CC', sysconfig.get_config_var('CC')) ++if not GCC: ++ GCC = 'gcc' ++ + gcc_list = ['utils', 'pyutils', 'protocol', 'socket', 'logging', 'wsgi_handlers', 'wsgi_headers', 'uwsgi_handlers', 'uwsgi'] + + # large file support + try: +- cflags = ['-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64'] + sysconfig.get_config_var('CFLAGS').split() ++ cflags = ['-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64'] + os.environ.get("CFLAGS", "").split() + except: + print("You need python headers to build uWSGI.") + sys.exit(1) + + cflags = cflags + ['-I' + sysconfig.get_python_inc(), '-I' + sysconfig.get_python_inc(plat_specific=True) ] +-ldflags = ['-lpthread', '-rdynamic'] + sysconfig.get_config_var('LIBS').split() + sysconfig.get_config_var('SYSLIBS').split() ++ldflags = os.environ.get("LDFLAGS", "").split() ++libs = ['-lpthread', '-rdynamic'] + sysconfig.get_config_var('LIBS').split() + sysconfig.get_config_var('SYSLIBS').split() + + def depends_on(what, dep): + for d in dep: +@@ -97,7 +101,7 @@ + print(plugin) + + print("*** uWSGI linking ***") +- ldline = "%s -o %s %s %s" % (GCC, bin_name, ' '.join(map(add_o, gcc_list)), ' '.join(ldflags)) ++ ldline = "%s -o %s %s %s %s" % (GCC, bin_name, ' '.join(ldflags), ' '.join(map(add_o, gcc_list)), ' '.join(libs)) + print(ldline) + ret = os.system(ldline) + if ret != 0: +@@ -141,19 +145,19 @@ + version = sys.version_info + uver = "%d.%d" % (version[0], version[1]) + +- ldflags.append('-lpython' + uver) ++ libs.append('-lpython' + uver) + + if str(PYLIB_PATH) != '': +- ldflags.insert(0,'-L' + PYLIB_PATH) ++ libs.insert(0,'-L' + PYLIB_PATH) + + kvm_list = ['FreeBSD', 'OpenBSD', 'NetBSD', 'DragonFly'] + + if uwsgi_os == 'SunOS': +- ldflags.append('-lsendfile') +- ldflags.remove('-rdynamic') ++ libs.append('-lsendfile') ++ libs.remove('-rdynamic') + + if uwsgi_os in kvm_list: +- ldflags.append('-lkvm') ++ libs.append('-lkvm') + + if uwsgi_os == 'OpenBSD': + UGREEN = False +@@ -221,7 +225,7 @@ + print("*** libxml2 headers unavailable. uWSGI build is interrupted. You have to install libxml2 development package or use libexpat or disable XML") + sys.exit(1) + else: +- ldflags.append(xmlconf) ++ libs.append(xmlconf) + xmlconf = spcall("xml2-config --cflags") + if xmlconf is None: + print("*** libxml2 headers unavailable. uWSGI build is interrupted. You have to install libxml2 development package or use libexpat or disable XML") +@@ -232,20 +236,20 @@ + gcc_list.append('xmlconf') + elif XML_IMPLEMENTATION == 'expat': + cflags.append("-DUWSGI_XML -DUWSGI_XML_EXPAT") +- ldflags.append('-lexpat') ++ libs.append('-lexpat') + gcc_list.append('xmlconf') + + + if ERLANG: + depends_on("ERLANG", ['EMBEDDED']) + cflags.append("-DUWSGI_ERLANG") +- ldflags.append(ERLANG_LDFLAGS) ++ libs.append(ERLANG_LDFLAGS) + if str(ERLANG_CFLAGS) != '': + cflags.append(ERLANG_CFLAGS) + gcc_list.append('erlang') + + if SCTP: +- ldflags.append("-lsctp") ++ libs.append("-lsctp") + cflags.append("-DUWSGI_SCTP") + + if SPOOLER: +@@ -263,13 +267,13 @@ + import uwsgiplugin as up + + cflags.append(up.CFLAGS) +- ldflags.append(up.LDFLAGS) ++ libs.append(up.LDFLAGS) + + cflags.insert(0, '-I.') + + plugin_base = path + '/' + up.NAME + '_plugin' + +- gccline = "%s -fPIC -shared -o %s.so %s %s.c %s" % (GCC, plugin_base, ' '.join(cflags), plugin_base, ' '.join(ldflags)) ++ gccline = "%s -fPIC -shared -o %s.so %s %s %s.c %s" % (GCC, plugin_base, ' '.join(cflags), ' '.join(ldflags), plugin_base, ' '.join(libs)) + print(gccline) + + ret = os.system(gccline) +@@ -297,6 +301,8 @@ + print(' '.join(cflags)) + if cmd == '--ldflags': + print(' '.join(ldflags)) ++ if cmd == '--libs': ++ print(' '.join(libs)) + elif cmd == '--build': + parse_vars() + build_uwsgi(UWSGI_BIN_NAME) diff --git a/www-servers/uwsgi/metadata.xml b/www-servers/uwsgi/metadata.xml new file mode 100644 index 000000000000..18c5a8ce6539 --- /dev/null +++ b/www-servers/uwsgi/metadata.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>no-herd</herd> + <maintainer> + <email>hollow@gentoo.org</email> + <name>Benedikt Böhm</name> + </maintainer> +</pkgmetadata> diff --git a/www-servers/uwsgi/uwsgi-0.9.5.ebuild b/www-servers/uwsgi/uwsgi-0.9.5.ebuild new file mode 100644 index 000000000000..ca24328e1fdc --- /dev/null +++ b/www-servers/uwsgi/uwsgi-0.9.5.ebuild @@ -0,0 +1,44 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/uwsgi-0.9.5.ebuild,v 1.1 2010/05/03 19:24:28 hollow Exp $ + +EAPI="3" +PYTHON_DEPEND="*" +SUPPORT_PYTHON_ABIS="1" + +inherit eutils python toolchain-funcs + +DESCRIPTION="uWSGI server for Python web applications" +HOMEPAGE="http://projects.unbit.it/uwsgi/" +SRC_URI="http://projects.unbit.it/downloads/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +RDEPEND="dev-libs/libxml2" +DEPEND="${RDEPEND}" + +src_prepare() { + # Python 3 requires constant indentation. + epatch "${FILESDIR}/${PN}-0.9.5-fix_uwsgiconfig.py_indentation.patch" + + # Respect CC, CFLAGS and LDFLAGS. + epatch "${FILESDIR}/${PN}-0.9.5-respect_flags.patch" + + python_copy_sources +} + +src_compile() { + python_src_compile CC="$(tc-getCC)" +} + +src_install() { + installation() { + newbin uwsgi uwsgi-${PYTHON_ABI} + } + python_execute_function -s installation + + python_generate_wrapper_scripts "${ED}usr/bin/uwsgi" +} |