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

Commit 431d79e

Browse files
committed
Move to a Makefile-based build.
1 parent 212a5a3 commit 431d79e

File tree

6 files changed

+63
-165
lines changed

6 files changed

+63
-165
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
*.swp
33
src/*
44
build/*
5-
.cache
5+
downloads/*

Makefile

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# iOS Build variables.
2+
SDKVER=$(xcodebuild -showsdks | fgrep "iphoneos" | tail -n 1 | awk '{print $2}')
3+
DEVROOT=$(xcode-select -print-path)/Platforms/iPhoneOS.platform/Developer
4+
IOSSDKROOT=$DEVROOT/SDKs/iPhoneOS$SDKVER.sdk
5+
6+
# Version of packages that will be compiled by this meta-package
7+
PYTHON_VERSION=2.7.1
8+
FFI_VERSION=3.0.13
9+
10+
all: dirs libffi
11+
12+
download:
13+
mkdir -p downloads
14+
15+
src:
16+
mkdir -p src
17+
18+
build:
19+
mkdir -p build
20+
21+
dirs: download src build
22+
23+
# Clean the libffi project
24+
clean-libffi:
25+
rm -rf src/libffi-$(FFI_VERSION)
26+
rm -rf build/ffi.framework
27+
28+
# Down original libffi source code archive.
29+
downloads/libffi-$(FFI_VERSION).tar.gz:
30+
curl -L ftp://sourceware.org/pub/libffi/libffi-$(FFI_VERSION).tar.gz > downloads/libffi-$(FFI_VERSION).tar.gz
31+
32+
# Unpack libffi source archive into src working directory
33+
src/libffi-$(FFI_VERSION): downloads/libffi-$(FFI_VERSION).tar.gz
34+
tar xvf downloads/libffi-$(FFI_VERSION).tar.gz
35+
mv libffi-$(FFI_VERSION) src
36+
37+
# Patch libffi source with iOS patches
38+
# Produce a dummy ".patches-applied" file to mark that this has happened.
39+
src/libffi-$(FFI_VERSION)/.patches-applied: src/libffi-$(FFI_VERSION)
40+
cd src/libffi-$(FFI_VERSION) && patch -p1 < ../../patch/libffi/$(FFI_VERSION)/ffi-sysv.S.patch
41+
cd src/libffi-$(FFI_VERSION) && patch -p1 < ../../patch/libffi/$(FFI_VERSION)/project.pbxproj.patch
42+
touch src/libffi-$(FFI_VERSION)/.patches-applied
43+
44+
# Generate iOS specific source and headers
45+
src/libffi-$(FFI_VERSION)/ios/include/ffi.h: src/libffi-$(FFI_VERSION)/.patches-applied
46+
cd src/libffi-$(FFI_VERSION) && python generate-ios-source-and-headers.py
47+
48+
# Build the iOS project
49+
src/libffi-$(FFI_VERSION)/build/Release-universal/ffi.framework: src/libffi-$(FFI_VERSION)/ios/include/ffi.h
50+
cd src/libffi-$(FFI_VERSION) && xcodebuild -project libffi.xcodeproj -target "Framework" -configuration Release -sdk iphoneos$(SDKVER) OTHER_CFLAGS="-no-integrated-as"
51+
52+
# Collate the libffi project
53+
libffi: clean-libffi src/libffi-$(FFI_VERSION)/build/Release-universal/ffi.framework
54+
cp -a src/libffi-$(FFI_VERSION)/build/Release-universal/ffi.framework build
55+
56+
# Clean all builds
57+
clean:
58+
rm -rf src build
59+
60+
# Full clean - includes all downloaded products
61+
distclean: clean
62+
rm -rf downloads

bin/environment.sh

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

bin/prepare-libffi.sh

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

bin/prepare-python.sh

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

bin/prepare.sh

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

0 commit comments

Comments
 (0)