From 1c37a80b81dba47c0dd9c34a528f2bcf6915efad Mon Sep 17 00:00:00 2001 From: Robert Niederreiter Date: Fri, 14 Oct 2016 14:57:49 +0200 Subject: [PATCH] Install pure python packages like werkzeug --- recipes/autobahn/__init__.py | 16 ++++++++++++++++ recipes/idna/__init__.py | 17 ++++++++++++++++- recipes/pyasn1/__init__.py | 17 ++++++++++++++++- recipes/pycparser/__init__.py | 17 ++++++++++++++++- recipes/pyopenssl/__init__.py | 17 ++++++++++++++++- recipes/six/__init__.py | 17 ++++++++++++++++- recipes/txaio/__init__.py | 17 ++++++++++++++++- 7 files changed, 112 insertions(+), 6 deletions(-) diff --git a/recipes/autobahn/__init__.py b/recipes/autobahn/__init__.py index 7b59ff0..dd15d29 100644 --- a/recipes/autobahn/__init__.py +++ b/recipes/autobahn/__init__.py @@ -1,4 +1,8 @@ +from os.path import join from toolchain import PythonRecipe +from toolchain import shprint +import os +import sh class AutobahnRecipe(PythonRecipe): @@ -7,4 +11,16 @@ class AutobahnRecipe(PythonRecipe): url = "https://github.com/crossbario/autobahn-python/archive/v{version}.zip" depends = ["twisted", "six", "txaio"] + def install(self): + arch = list(self.filtered_archs)[0] + build_dir = self.get_build_dir(arch.arch) + os.chdir(build_dir) + hostpython = sh.Command(self.ctx.hostpython) + build_env = arch.get_env() + dest_dir = join(self.ctx.dist_dir, "root", "python") + pythonpath = join(dest_dir, 'lib', 'python2.7', 'site-packages') + build_env['PYTHONPATH'] = pythonpath + args = [hostpython, "setup.py", "install", "--prefix", dest_dir] + shprint(*args, _env=build_env) + recipe = AutobahnRecipe() diff --git a/recipes/idna/__init__.py b/recipes/idna/__init__.py index a9d00f5..5ff50f8 100644 --- a/recipes/idna/__init__.py +++ b/recipes/idna/__init__.py @@ -1,8 +1,11 @@ +from os.path import join from toolchain import PythonRecipe +from toolchain import shprint +import os +import sh class IdnaRecipe(PythonRecipe): - name = "idna" version = "2.1" url = ( "https://pypi.python.org/packages/fb/84/" @@ -11,4 +14,16 @@ class IdnaRecipe(PythonRecipe): ) depends = ["python"] + def install(self): + arch = list(self.filtered_archs)[0] + build_dir = self.get_build_dir(arch.arch) + os.chdir(build_dir) + hostpython = sh.Command(self.ctx.hostpython) + build_env = arch.get_env() + dest_dir = join(self.ctx.dist_dir, "root", "python") + pythonpath = join(dest_dir, 'lib', 'python2.7', 'site-packages') + build_env['PYTHONPATH'] = pythonpath + args = [hostpython, "setup.py", "install", "--prefix", dest_dir] + shprint(*args, _env=build_env) + recipe = IdnaRecipe() diff --git a/recipes/pyasn1/__init__.py b/recipes/pyasn1/__init__.py index 1a4ac31..f652e14 100644 --- a/recipes/pyasn1/__init__.py +++ b/recipes/pyasn1/__init__.py @@ -1,8 +1,11 @@ +from os.path import join from toolchain import PythonRecipe +from toolchain import shprint +import os +import sh class Pyasn1Recipe(PythonRecipe): - name = "pyasn1" version = "0.1.9" url = ( "https://pypi.python.org/packages/f7/83/" @@ -11,4 +14,16 @@ class Pyasn1Recipe(PythonRecipe): ) depends = ["python"] + def install(self): + arch = list(self.filtered_archs)[0] + build_dir = self.get_build_dir(arch.arch) + os.chdir(build_dir) + hostpython = sh.Command(self.ctx.hostpython) + build_env = arch.get_env() + dest_dir = join(self.ctx.dist_dir, "root", "python") + pythonpath = join(dest_dir, 'lib', 'python2.7', 'site-packages') + build_env['PYTHONPATH'] = pythonpath + args = [hostpython, "setup.py", "install", "--prefix", dest_dir] + shprint(*args, _env=build_env) + recipe = Pyasn1Recipe() diff --git a/recipes/pycparser/__init__.py b/recipes/pycparser/__init__.py index 1b73f83..a155693 100644 --- a/recipes/pycparser/__init__.py +++ b/recipes/pycparser/__init__.py @@ -1,8 +1,11 @@ +from os.path import join from toolchain import PythonRecipe +from toolchain import shprint +import os +import sh class PycparserRecipe(PythonRecipe): - name = "pycparser" version = "2.14" url = ( "https://pypi.python.org/packages/6d/31/" @@ -11,4 +14,16 @@ class PycparserRecipe(PythonRecipe): ) depends = ["python"] + def install(self): + arch = list(self.filtered_archs)[0] + build_dir = self.get_build_dir(arch.arch) + os.chdir(build_dir) + hostpython = sh.Command(self.ctx.hostpython) + build_env = arch.get_env() + dest_dir = join(self.ctx.dist_dir, "root", "python") + pythonpath = join(dest_dir, 'lib', 'python2.7', 'site-packages') + build_env['PYTHONPATH'] = pythonpath + args = [hostpython, "setup.py", "install", "--prefix", dest_dir] + shprint(*args, _env=build_env) + recipe = PycparserRecipe() diff --git a/recipes/pyopenssl/__init__.py b/recipes/pyopenssl/__init__.py index 36ea02e..4f2ca49 100644 --- a/recipes/pyopenssl/__init__.py +++ b/recipes/pyopenssl/__init__.py @@ -1,8 +1,11 @@ +from os.path import join from toolchain import PythonRecipe +from toolchain import shprint +import os +import sh class PyOpenSSLRecipe(PythonRecipe): - name = "OpenSSL" version = "16.1.0" url = ( "https://pypi.python.org/packages/15/1e/" @@ -11,4 +14,16 @@ class PyOpenSSLRecipe(PythonRecipe): ) depends = ["openssl", "six", "cryptography"] + def install(self): + arch = list(self.filtered_archs)[0] + build_dir = self.get_build_dir(arch.arch) + os.chdir(build_dir) + hostpython = sh.Command(self.ctx.hostpython) + build_env = arch.get_env() + dest_dir = join(self.ctx.dist_dir, "root", "python") + pythonpath = join(dest_dir, 'lib', 'python2.7', 'site-packages') + build_env['PYTHONPATH'] = pythonpath + args = [hostpython, "setup.py", "install", "--prefix", dest_dir] + shprint(*args, _env=build_env) + recipe = PyOpenSSLRecipe() diff --git a/recipes/six/__init__.py b/recipes/six/__init__.py index 16d17f7..7ef82d1 100644 --- a/recipes/six/__init__.py +++ b/recipes/six/__init__.py @@ -1,8 +1,11 @@ +from os.path import join from toolchain import PythonRecipe +from toolchain import shprint +import os +import sh class SixRecipe(PythonRecipe): - name = "six" version = "1.10.0" url = ( "https://pypi.python.org/packages/b3/b2/" @@ -11,4 +14,16 @@ class SixRecipe(PythonRecipe): ) depends = ["python"] + def install(self): + arch = list(self.filtered_archs)[0] + build_dir = self.get_build_dir(arch.arch) + os.chdir(build_dir) + hostpython = sh.Command(self.ctx.hostpython) + build_env = arch.get_env() + dest_dir = join(self.ctx.dist_dir, "root", "python") + pythonpath = join(dest_dir, 'lib', 'python2.7', 'site-packages') + build_env['PYTHONPATH'] = pythonpath + args = [hostpython, "setup.py", "install", "--prefix", dest_dir] + shprint(*args, _env=build_env) + recipe = SixRecipe() diff --git a/recipes/txaio/__init__.py b/recipes/txaio/__init__.py index 1fd710e..22646e0 100644 --- a/recipes/txaio/__init__.py +++ b/recipes/txaio/__init__.py @@ -1,8 +1,11 @@ +from os.path import join from toolchain import PythonRecipe +from toolchain import shprint +import os +import sh class TxaioRecipe(PythonRecipe): - name = "txaio" version = "2.5.1" url = ( "https://pypi.python.org/packages/45/e1/" @@ -11,4 +14,16 @@ class TxaioRecipe(PythonRecipe): ) depends = ["six"] + def install(self): + arch = list(self.filtered_archs)[0] + build_dir = self.get_build_dir(arch.arch) + os.chdir(build_dir) + hostpython = sh.Command(self.ctx.hostpython) + build_env = arch.get_env() + dest_dir = join(self.ctx.dist_dir, "root", "python") + pythonpath = join(dest_dir, 'lib', 'python2.7', 'site-packages') + build_env['PYTHONPATH'] = pythonpath + args = [hostpython, "setup.py", "install", "--prefix", dest_dir] + shprint(*args, _env=build_env) + recipe = TxaioRecipe()