Install pure python packages like werkzeug

This commit is contained in:
Robert Niederreiter 2016-10-14 14:57:49 +02:00
parent d4cb02ccf1
commit 1c37a80b81
7 changed files with 112 additions and 6 deletions

View file

@ -1,4 +1,8 @@
from os.path import join
from toolchain import PythonRecipe from toolchain import PythonRecipe
from toolchain import shprint
import os
import sh
class AutobahnRecipe(PythonRecipe): class AutobahnRecipe(PythonRecipe):
@ -7,4 +11,16 @@ class AutobahnRecipe(PythonRecipe):
url = "https://github.com/crossbario/autobahn-python/archive/v{version}.zip" url = "https://github.com/crossbario/autobahn-python/archive/v{version}.zip"
depends = ["twisted", "six", "txaio"] 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() recipe = AutobahnRecipe()

View file

@ -1,8 +1,11 @@
from os.path import join
from toolchain import PythonRecipe from toolchain import PythonRecipe
from toolchain import shprint
import os
import sh
class IdnaRecipe(PythonRecipe): class IdnaRecipe(PythonRecipe):
name = "idna"
version = "2.1" version = "2.1"
url = ( url = (
"https://pypi.python.org/packages/fb/84/" "https://pypi.python.org/packages/fb/84/"
@ -11,4 +14,16 @@ class IdnaRecipe(PythonRecipe):
) )
depends = ["python"] 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() recipe = IdnaRecipe()

View file

@ -1,8 +1,11 @@
from os.path import join
from toolchain import PythonRecipe from toolchain import PythonRecipe
from toolchain import shprint
import os
import sh
class Pyasn1Recipe(PythonRecipe): class Pyasn1Recipe(PythonRecipe):
name = "pyasn1"
version = "0.1.9" version = "0.1.9"
url = ( url = (
"https://pypi.python.org/packages/f7/83/" "https://pypi.python.org/packages/f7/83/"
@ -11,4 +14,16 @@ class Pyasn1Recipe(PythonRecipe):
) )
depends = ["python"] 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() recipe = Pyasn1Recipe()

View file

@ -1,8 +1,11 @@
from os.path import join
from toolchain import PythonRecipe from toolchain import PythonRecipe
from toolchain import shprint
import os
import sh
class PycparserRecipe(PythonRecipe): class PycparserRecipe(PythonRecipe):
name = "pycparser"
version = "2.14" version = "2.14"
url = ( url = (
"https://pypi.python.org/packages/6d/31/" "https://pypi.python.org/packages/6d/31/"
@ -11,4 +14,16 @@ class PycparserRecipe(PythonRecipe):
) )
depends = ["python"] 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() recipe = PycparserRecipe()

View file

@ -1,8 +1,11 @@
from os.path import join
from toolchain import PythonRecipe from toolchain import PythonRecipe
from toolchain import shprint
import os
import sh
class PyOpenSSLRecipe(PythonRecipe): class PyOpenSSLRecipe(PythonRecipe):
name = "OpenSSL"
version = "16.1.0" version = "16.1.0"
url = ( url = (
"https://pypi.python.org/packages/15/1e/" "https://pypi.python.org/packages/15/1e/"
@ -11,4 +14,16 @@ class PyOpenSSLRecipe(PythonRecipe):
) )
depends = ["openssl", "six", "cryptography"] 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() recipe = PyOpenSSLRecipe()

View file

@ -1,8 +1,11 @@
from os.path import join
from toolchain import PythonRecipe from toolchain import PythonRecipe
from toolchain import shprint
import os
import sh
class SixRecipe(PythonRecipe): class SixRecipe(PythonRecipe):
name = "six"
version = "1.10.0" version = "1.10.0"
url = ( url = (
"https://pypi.python.org/packages/b3/b2/" "https://pypi.python.org/packages/b3/b2/"
@ -11,4 +14,16 @@ class SixRecipe(PythonRecipe):
) )
depends = ["python"] 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() recipe = SixRecipe()

View file

@ -1,8 +1,11 @@
from os.path import join
from toolchain import PythonRecipe from toolchain import PythonRecipe
from toolchain import shprint
import os
import sh
class TxaioRecipe(PythonRecipe): class TxaioRecipe(PythonRecipe):
name = "txaio"
version = "2.5.1" version = "2.5.1"
url = ( url = (
"https://pypi.python.org/packages/45/e1/" "https://pypi.python.org/packages/45/e1/"
@ -11,4 +14,16 @@ class TxaioRecipe(PythonRecipe):
) )
depends = ["six"] 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() recipe = TxaioRecipe()