From 0df37129802200de54e9d30d688e7315dd3c2d8d Mon Sep 17 00:00:00 2001 From: Stepan Rakhimov Date: Tue, 26 Jan 2016 22:37:33 +0100 Subject: [PATCH 1/5] PyYaml recipe --- recipes/pyyaml/__init__.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 recipes/pyyaml/__init__.py diff --git a/recipes/pyyaml/__init__.py b/recipes/pyyaml/__init__.py new file mode 100644 index 0000000..276d733 --- /dev/null +++ b/recipes/pyyaml/__init__.py @@ -0,0 +1,22 @@ +# pure-python package, this can be removed when we'll support any python package +from toolchain import PythonRecipe, shprint +from os.path import join +import sh, os + +class PyYamlRecipe(PythonRecipe): + version = "3.11" + # url = "https://github.com/mitsuhiko/click/archive/{version}.zip" + 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 = 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 = PyYamlRecipe() From 9c828b2932e09ee4af819051e84e743d36eb906e Mon Sep 17 00:00:00 2001 From: Stepan Rakhimov Date: Sun, 14 Feb 2016 14:42:47 +0100 Subject: [PATCH 2/5] pyyaml cleanup --- recipes/pyyaml/__init__.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/recipes/pyyaml/__init__.py b/recipes/pyyaml/__init__.py index 276d733..9f06bfa 100644 --- a/recipes/pyyaml/__init__.py +++ b/recipes/pyyaml/__init__.py @@ -1,11 +1,10 @@ # pure-python package, this can be removed when we'll support any python package +import os +import sh from toolchain import PythonRecipe, shprint -from os.path import join -import sh, os class PyYamlRecipe(PythonRecipe): version = "3.11" - # url = "https://github.com/mitsuhiko/click/archive/{version}.zip" url = "https://pypi.python.org/packages/source/P/PyYAML/PyYAML-{version}.tar.gz" depends = ["python"] @@ -15,8 +14,8 @@ class PyYamlRecipe(PythonRecipe): 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') + 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() From 6b09dacfbabcf546bec1c25406e2853dade87bbb Mon Sep 17 00:00:00 2001 From: Stepan Rakhimov Date: Sun, 14 Feb 2016 14:47:35 +0100 Subject: [PATCH 3/5] numpy fix to provide includes for other recipes --- recipes/numpy/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/recipes/numpy/__init__.py b/recipes/numpy/__init__.py index a30af2d..3ecdad4 100644 --- a/recipes/numpy/__init__.py +++ b/recipes/numpy/__init__.py @@ -9,6 +9,7 @@ class NumpyRecipe(CythonRecipe): url = "http://pypi.python.org/packages/source/n/numpy/numpy-{version}.tar.gz" library = "libnumpy.a" libraries = ["libnpymath.a", "libnpysort.a"] + include_dir = "numpy/core/include" depends = ["python"] pbx_frameworks = ["Accelerate"] cythonize = False @@ -51,5 +52,3 @@ class NumpyRecipe(CythonRecipe): shutil.rmtree(join(dest_dir, "tests")) recipe = NumpyRecipe() - - From 3a3cb2266669309f58e644c6f694b3ab9da86868 Mon Sep 17 00:00:00 2001 From: Stepan Rakhimov Date: Sun, 14 Feb 2016 14:49:25 +0100 Subject: [PATCH 4/5] my failed try to fix setuptools --- recipes/host_setuptools/__init__.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/recipes/host_setuptools/__init__.py b/recipes/host_setuptools/__init__.py index 95e6ff9..ccd0ffe 100644 --- a/recipes/host_setuptools/__init__.py +++ b/recipes/host_setuptools/__init__.py @@ -8,14 +8,26 @@ import shutil class HostSetuptools(Recipe): depends = ["hostpython"] - archs = 'i386' + archs = ["x86_64"] url = "" def prebuild_arch(self, arch): hostpython = sh.Command(self.ctx.hostpython) 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() - - From d00ad73752a52a80e16ebc6e56fa7c966ebe0327 Mon Sep 17 00:00:00 2001 From: Stepan Rakhimov Date: Sun, 14 Feb 2016 14:50:43 +0100 Subject: [PATCH 5/5] distriute recipe, may be useless since distribute is already in python --- recipes/distribute/__init__.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 recipes/distribute/__init__.py diff --git a/recipes/distribute/__init__.py b/recipes/distribute/__init__.py new file mode 100644 index 0000000..fc82a11 --- /dev/null +++ b/recipes/distribute/__init__.py @@ -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()