From 18c67317fefe3828bcec18ef6637ee551a50f1c4 Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Mon, 2 Feb 2015 05:22:01 +0100 Subject: [PATCH] new ffi recipe --- .gitignore | 2 ++ recipes/libffi/__init__.py | 33 +++++++++++++++++++ .../libffi}/ffi-3.0.13-sysv.S.patch | 0 3 files changed, 35 insertions(+) create mode 100644 recipes/libffi/__init__.py rename {src/ffi_files => recipes/libffi}/ffi-3.0.13-sysv.S.patch (100%) diff --git a/.gitignore b/.gitignore index e3a2185..7874b10 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ *.swo +*.pyc +*.pyo *.swp freetype-* build/* diff --git a/recipes/libffi/__init__.py b/recipes/libffi/__init__.py new file mode 100644 index 0000000..b738c09 --- /dev/null +++ b/recipes/libffi/__init__.py @@ -0,0 +1,33 @@ +from toolchain import Recipe, shprint +import sh + + +class LibffiRecipe(Recipe): + version = "3.0.13" + url = "ftp://sourceware.org/pub/libffi/libffi-{version}.tar.gz" + + def prebuild_arch(self, arch): + if self.has_marker("patched"): + return + self.apply_patch("ffi-3.0.13-sysv.S.patch") + if arch in ("armv7", "armv7s", "arm64"): + shprint(sh.sed, + "-i.bak", + "s/-miphoneos-version-min=4.0/-miphoneos-version-min=6.0/g", + "generate-ios-source-and-headers.py") + self.set_marker("patched") + + def build_arch(self, arch): + if arch == "i386": + target_name = "libffi OS X" + else: + target_name = "libffi iOS" + + shprint(sh.xcodebuild, + "-project", "libffi.xcodeproj", + "-target", target_name, + "-configuration", "Release", + "-sdk", "iphoneos{}".format(self.ctx.sdkver), + "OTHER_CFLAGS=-no-integrated-as") + +recipe = LibffiRecipe() diff --git a/src/ffi_files/ffi-3.0.13-sysv.S.patch b/recipes/libffi/ffi-3.0.13-sysv.S.patch similarity index 100% rename from src/ffi_files/ffi-3.0.13-sysv.S.patch rename to recipes/libffi/ffi-3.0.13-sysv.S.patch