Merge pull request #176 from strakh/master

pyyaml recipe
This commit is contained in:
Richard Larkin 2016-07-28 08:36:50 +02:00 committed by GitHub
commit fe5add1699
4 changed files with 59 additions and 6 deletions

View file

@ -0,0 +1,21 @@
from toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class DistributeRecipe(PythonRecipe):
version = "0.7.3"
# url = "https://github.com/mitsuhiko/click/archive/{version}.zip"
url = "https://pypi.python.org/packages/source/d/distribute/distribute-{version}.zip"
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")
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
recipe = DistributeRecipe()

View file

@ -8,14 +8,26 @@ import shutil
class HostSetuptools(Recipe): class HostSetuptools(Recipe):
depends = ["hostpython"] depends = ["hostpython"]
archs = 'i386' archs = ["x86_64"]
url = "" url = ""
def prebuild_arch(self, arch): def prebuild_arch(self, arch):
hostpython = sh.Command(self.ctx.hostpython) hostpython = sh.Command(self.ctx.hostpython)
sh.curl("-O", "https://bootstrap.pypa.io/ez_setup.py") sh.curl("-O", "https://bootstrap.pypa.io/ez_setup.py")
shprint(hostpython, "./ez_setup.py") dest_dir = join(self.ctx.dist_dir, "root", "python")
build_env = arch.get_env()
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
# shprint(hostpython, "./ez_setup.py", "--to-dir", dest_dir)
shprint(hostpython, "./ez_setup.py", _env=build_env)
# 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")
# build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
# shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
recipe = HostSetuptools() recipe = HostSetuptools()

View file

@ -9,6 +9,7 @@ class NumpyRecipe(CythonRecipe):
url = "http://pypi.python.org/packages/source/n/numpy/numpy-{version}.tar.gz" url = "http://pypi.python.org/packages/source/n/numpy/numpy-{version}.tar.gz"
library = "libnumpy.a" library = "libnumpy.a"
libraries = ["libnpymath.a", "libnpysort.a"] libraries = ["libnpymath.a", "libnpysort.a"]
include_dir = "numpy/core/include"
depends = ["python"] depends = ["python"]
pbx_frameworks = ["Accelerate"] pbx_frameworks = ["Accelerate"]
cythonize = False cythonize = False
@ -51,5 +52,3 @@ class NumpyRecipe(CythonRecipe):
shutil.rmtree(join(dest_dir, "tests")) shutil.rmtree(join(dest_dir, "tests"))
recipe = NumpyRecipe() recipe = NumpyRecipe()

View file

@ -0,0 +1,21 @@
# pure-python package, this can be removed when we'll support any python package
import os
import sh
from toolchain import PythonRecipe, shprint
class PyYamlRecipe(PythonRecipe):
version = "3.11"
url = "https://pypi.python.org/packages/source/P/PyYAML/PyYAML-{version}.tar.gz"
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 = os.path.join(self.ctx.dist_dir, "root", "python")
build_env['PYTHONPATH'] = os.path.join(dest_dir, 'lib', 'python2.7', 'site-packages')
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
recipe = PyYamlRecipe()