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

Commit 771845c

Browse files
committed
Added Rubicon to the build.
1 parent 110aabe commit 771845c

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

Makefile

+21-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ OSX_SDK_ROOT=$(shell xcrun --sdk macosx --show-sdk-path)
66
# Version of packages that will be compiled by this meta-package
77
FFI_VERSION=3.0.13
88
PYTHON_VERSION=2.7.1
9+
RUBICON_VERSION=0.1.2
910

1011
# IPHONE build commands and flags
1112
IPHONE_ARMV7_SDK_ROOT=$(shell xcrun --sdk iphoneos --show-sdk-path)
@@ -80,6 +81,23 @@ build/ffi.framework: src/libffi-$(FFI_VERSION)
8081
cd src/libffi-$(FFI_VERSION) && xcodebuild -project libffi.xcodeproj -target "Framework" -configuration Release -sdk iphoneos$(SDKVER) OTHER_CFLAGS="-no-integrated-as"
8182
cp -a src/libffi-$(FFI_VERSION)/build/Release-universal/ffi.framework build
8283

84+
###########################################################################
85+
# rubicon-objc
86+
###########################################################################
87+
88+
# Clean the libffi project
89+
clean-rubicon-objc:
90+
rm -rf src/rubicon-objc-$(RUBICON_VERSION)
91+
92+
# Down original librubicon-objc source code archive.
93+
downloads/rubicon-objc-$(RUBICON_VERSION).tar.gz:
94+
curl -L https://github.com/pybee/rubicon-objc/archive/v$(RUBICON_VERSION).tar.gz > downloads/rubicon-objc-$(RUBICON_VERSION).tar.gz
95+
96+
# Unpack rubicon-objc source archive into src working directory
97+
src/rubicon-objc-$(RUBICON_VERSION): downloads/rubicon-objc-$(RUBICON_VERSION).tar.gz
98+
tar xvf downloads/rubicon-objc-$(RUBICON_VERSION).tar.gz
99+
mv rubicon-objc-$(RUBICON_VERSION) src
100+
83101
###########################################################################
84102
# Python
85103
###########################################################################
@@ -234,7 +252,7 @@ build/python/ios-armv7s/Python: src/Python-$(PYTHON_VERSION)/build
234252
cd build/python/ios-armv7s/Headers && mv ../include/python$(basename $(PYTHON_VERSION))/* .
235253
cd build/python/ios-armv7s/Headers && mv pyconfig.h ../include/python$(basename $(PYTHON_VERSION))
236254

237-
build/Python.framework: build/python/ios-simulator/Python build/python/ios-armv7/Python build/python/ios-armv7s/Python
255+
build/Python.framework: build/python/ios-simulator/Python build/python/ios-armv7/Python build/python/ios-armv7s/Python src/rubicon-objc-$(RUBICON_VERSION)
238256
# Create the framework directory from the compiled resrouces
239257
mkdir -p build/Python.framework/Versions/$(basename $(PYTHON_VERSION))/
240258
cd build/Python.framework/Versions && ln -fs $(basename $(PYTHON_VERSION)) Current
@@ -253,6 +271,8 @@ build/Python.framework: build/python/ios-simulator/Python build/python/ios-armv7
253271
# Build a fat library with all targets included.
254272
xcrun lipo -create -output build/Python.framework/Versions/Current/Python build/python/ios-simulator/Python build/python/ios-armv7/Python build/python/ios-armv7s/Python
255273
cd build/Python.framework && ln -fs Versions/Current/Python
274+
# Install Rubicon into site packages.
275+
cd src && cp -r rubicon-objc-$(RUBICON_VERSION)/rubicon ../build/Python.framework/Resources/lib/python$(basename $(PYTHON_VERSION))/site-packages/
256276
# Clean up temporary build dirs
257277
rm -rf build/python
258278

README.rst

+13-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ into an iOS project.
77
It works by downloading, patching, and building a fat binary static libffi.a
88
and libPython.a, and packaging them both in iOS Framework format.
99

10+
The ``site-packages`` has the `Rubicon Objective-C`_ library pre-installed.
11+
This library enables you to have direct access to the iOS system libraries
12+
from within the Python environment.
13+
1014
The binaries support the ``$(ARCHS_STANDARD_32_BIT)`` set - that is, armv7 and
1115
armv7s. This should enable the code to run on:
1216

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

55-
.. _downloaded: https://github.com/pybee/Python-iOS-support/releases/download/2.7.1-b1/Python-2.7.1-iOS-support.b1.tar.gz
59+
.. note:: Xcode version compatibility
60+
61+
At this time, the libraries only compile work with Xcode 5.1.1 and
62+
earlier. See `this ticket`_ for details of a workaround if you need
63+
to have Xcode 6 installed on your machine.
64+
65+
.. _downloaded: https://github.com/pybee/Python-iOS-support/releases/download/2.7.1-b2/Python-2.7.1-iOS-support.b2.tar.gz
5666

5767
Acknowledgements
5868
----------------
@@ -65,3 +75,5 @@ The approach to framework packaging is drawn from `Jeff Verkoeyen`_, and
6575
.. _Kivy's iOS packaging tools.: https://github.com/kivy/kivy-ios
6676
.. _Jeff Verkoeyen: https://github.com/jverkoey/iOS-Framework
6777
.. _Ernesto García's: http://www.raywenderlich.com/41377/creating-a-static-library-in-ios-tutorial
78+
.. _Rubicon Objective-C: http://github.com/pybee/rubicon-objc
79+
.. _this ticket: https://github.com/pybee/Python-iOS-template/issues/3

0 commit comments

Comments
 (0)