Skip to content
This repository was archived by the owner on Mar 30, 2019. It is now read-only.

Commit 174a5be

Browse files
committed
Updated libffi build to 3.1.
1 parent f536835 commit 174a5be

File tree

7 files changed

+43
-646
lines changed

7 files changed

+43
-646
lines changed

Makefile

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ PROJECTDIR=$(shell pwd)
44
OSX_SDK_ROOT=$(shell xcrun --sdk macosx --show-sdk-path)
55

66
# Version of packages that will be compiled by this meta-package
7-
FFI_VERSION=3.0.13
8-
PYTHON_VERSION=2.7.1
7+
FFI_VERSION=3.1
8+
PYTHON_VERSION=3.4.2
99
RUBICON_VERSION=0.1.2
1010

1111
# IPHONE build commands and flags
@@ -30,7 +30,8 @@ IPHONE_SIMULATOR_CFLAGS=-arch i386 -pipe -no-cpp-precomp -isysroot $(IPHONE_SIMU
3030
IPHONE_SIMULATOR_LDFLAGS=-arch i386 -isysroot $(IPHONE_SIMULATOR_SDK_ROOT) -miphoneos-version-min=6.0
3131

3232

33-
all: working-dirs build/ffi.framework build/Python.framework
33+
#all: working-dirs build/ffi.framework build/Python.framework
34+
all: working-dirs build/ffi.framework
3435

3536
# Clean all builds
3637
clean:
@@ -75,13 +76,23 @@ src/libffi-$(FFI_VERSION): downloads/libffi-$(FFI_VERSION).tar.gz
7576

7677
# Patch and build the framework
7778
build/ffi.framework: src/libffi-$(FFI_VERSION)
78-
cd src/libffi-$(FFI_VERSION) && patch -p1 -N < ../../patch/libffi/ffi-sysv.S.patch
79-
cd src/libffi-$(FFI_VERSION) && patch -p1 -N < ../../patch/libffi/project.pbxproj.patch
80-
cd src/libffi-$(FFI_VERSION) && patch -p1 -N < ../../patch/libffi/build-ios.sh.patch
81-
cd src/libffi-$(FFI_VERSION) && patch -p1 -N < ../../patch/libffi/generate-ios-source-and-headers.py.patch
82-
cd src/libffi-$(FFI_VERSION) && python generate-ios-source-and-headers.py
83-
cd src/libffi-$(FFI_VERSION) && xcodebuild -project libffi.xcodeproj -target "Framework" -configuration Release -sdk iphoneos$(SDKVER) OTHER_CFLAGS="-no-integrated-as"
84-
cp -a src/libffi-$(FFI_VERSION)/build/Release-universal/ffi.framework build
79+
cd src/libffi-$(FFI_VERSION) && patch -p1 -N < ../../patch/libffi/generate-darwin-source-and-headers.py.patch
80+
cd src/libffi-$(FFI_VERSION) && python generate-darwin-source-and-headers.py --only-ios
81+
# Build all required targets.
82+
cd src/libffi-$(FFI_VERSION)/build_iphoneos-armv7 && make
83+
cd src/libffi-$(FFI_VERSION)/build_iphoneos-arm64 && make
84+
cd src/libffi-$(FFI_VERSION)/build_iphonesimulator-i386 && make
85+
cd src/libffi-$(FFI_VERSION)/build_iphonesimulator-x86_64 && make
86+
# Copy the headers into a single directory
87+
mkdir -p build/ffi.framework/Versions/${FFI_VERSION}/Headers
88+
cp src/libffi-$(FFI_VERSION)/darwin_common/include/* build/ffi.framework/Versions/${FFI_VERSION}/Headers
89+
cp src/libffi-$(FFI_VERSION)/darwin_ios/include/* build/ffi.framework/Versions/${FFI_VERSION}/Headers
90+
# Make the fat binary
91+
xcrun lipo -create -output build/ffi.framework/Versions/$(FFI_VERSION)/ffi src/libffi-$(FFI_VERSION)/build_iphoneos-arm64/.libs/libffi.a src/libffi-$(FFI_VERSION)/build_iphoneos-armv7/.libs/libffi.a src/libffi-$(FFI_VERSION)/build_iphonesimulator-i386/.libs/libffi.a src/libffi-$(FFI_VERSION)/build_iphonesimulator-x86_64/.libs/libffi.a
92+
# Link the Current, Headers and binary.
93+
cd build/ffi.framework/Versions && ln -si ${FFI_VERSION} Current
94+
cd build/ffi.framework && ln -si Versions/Current/Headers
95+
cd build/ffi.framework && ln -si Versions/Current/ffi
8596

8697
###########################################################################
8798
# rubicon-objc

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ armv7s. This should enable the code to run on:
3232
- iPod Touch (4th gen)
3333
- iPod Touch (5th gen)
3434

35-
This repository branch builds a packaged version of **Python 2.7.1**.
35+
This repository branch builds a packaged version of **Python 3.4.2**.
3636
Other Python versions are available by cloning other branches of the main
3737
repository.
3838

@@ -56,7 +56,7 @@ This should:
5656
The build products will be in the `build` directory. You'll need to add
5757
**all** these frameworks (not just Python.framework) to your project.
5858

59-
.. _downloaded: https://github.com/pybee/Python-iOS-support/releases/download/2.7.1-b3/Python-2.7.1-iOS-support.b3.tar.gz
59+
.. _downloaded: https://github.com/pybee/Python-iOS-support/releases/download/3.4.2-b1/Python-3.4.2-iOS-support.b1.tar.gz
6060

6161
Acknowledgements
6262
----------------

patch/libffi/build-ios.sh.patch

Lines changed: 0 additions & 13 deletions
This file was deleted.

patch/libffi/ffi-sysv.S.patch

Lines changed: 0 additions & 137 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--- libffi-3.1-old/generate-darwin-source-and-headers.py 2014-10-23 17:49:33.000000000 +0800
2+
+++ libffi-3.1-new/generate-darwin-source-and-headers.py 2014-10-23 17:50:01.000000000 +0800
3+
@@ -14,7 +14,7 @@
4+
sdk = 'iphonesimulator'
5+
arch = 'i386'
6+
triple = 'i386-apple-darwin11'
7+
- version_min = '-miphoneos-version-min=5.1.1'
8+
+ version_min = '-miphoneos-version-min=6.0'
9+
10+
prefix = "#ifdef __i386__\n\n"
11+
suffix = "\n\n#endif"
12+
@@ -40,7 +40,7 @@
13+
sdk = 'iphoneos'
14+
arch = 'armv7'
15+
triple = 'arm-apple-darwin11'
16+
- version_min = '-miphoneos-version-min=5.1.1'
17+
+ version_min = '-miphoneos-version-min=6.0'
18+
19+
prefix = "#ifdef __arm__\n\n"
20+
suffix = "\n\n#endif"

patch/libffi/generate-ios-source-and-headers.py.patch

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)