summaryrefslogtreecommitdiff
path: root/ios
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-10-18 13:36:52 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-10-18 13:36:52 +0300
commit2d29615b9e7ebce07b4d8b3745e3515b32c199c0 (patch)
treef334ab0a7f1e411f8cbfe78932fdc48430801a5d /ios
parentbaf4f8d5b02952e4adfcf60acdd1ac904c132c89 (diff)
Updated README: Notes about iOS
Also cleaned up some styling inconsistencies.
Diffstat (limited to 'ios')
-rwxr-xr-xios/cmake-ios-lagrange.sh13
-rwxr-xr-xios/cmake-ios-tf.sh11
-rw-r--r--ios/cross-mac-arm64-ios-arm64.ini27
-rwxr-xr-xios/deps.sh81
-rw-r--r--ios/iconfigure-osminver.patch18
5 files changed, 150 insertions, 0 deletions
diff --git a/ios/cmake-ios-lagrange.sh b/ios/cmake-ios-lagrange.sh
new file mode 100755
index 00000000..598d89a5
--- /dev/null
+++ b/ios/cmake-ios-lagrange.sh
@@ -0,0 +1,13 @@
1#!/bin/sh
2IOS_DIR="$HOME/SDK/ios/arm64"
3cmake ../lagrange \
4 -G Xcode \
5 -DCMAKE_TOOLCHAIN_FILE=$HOME/src/libs/ios-cmake/ios.toolchain.cmake \
6 -DPLATFORM=OS64 \
7 -DENABLE_BITCODE=0 \
8 -DDEPLOYMENT_TARGET=9.0 \
9 -DIOS_DIR=$IOS_DIR \
10 -Dthe_Foundation_DIR=$IOS_DIR/lib/cmake/the_Foundation \
11 -DXCODE_DEVELOPMENT_TEAM=XXXXXXXXXX \
12 -DENABLE_BINCAT_SH=YES \
13 -DENABLE_DOWNLOAD_EDIT=NO
diff --git a/ios/cmake-ios-tf.sh b/ios/cmake-ios-tf.sh
new file mode 100755
index 00000000..89d3bd14
--- /dev/null
+++ b/ios/cmake-ios-tf.sh
@@ -0,0 +1,11 @@
1#!/bin/sh
2cmake ../the_Foundation \
3 -DCMAKE_TOOLCHAIN_FILE=$HOME/src/libs/ios-cmake/ios.toolchain.cmake \
4 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
5 -DPLATFORM=OS64 \
6 -DENABLE_BITCODE=0 \
7 -DTFDN_STATIC_LIBRARY=YES \
8 -DTFDN_ENABLE_TESTS=NO \
9 -DTFDN_ENABLE_WEBREQUEST=NO \
10 -DIOS_DIR=$HOME/SDK/ios/arm64 \
11 -DCMAKE_INSTALL_PREFIX=$HOME/SDK/ios/arm64
diff --git a/ios/cross-mac-arm64-ios-arm64.ini b/ios/cross-mac-arm64-ios-arm64.ini
new file mode 100644
index 00000000..aa759cf2
--- /dev/null
+++ b/ios/cross-mac-arm64-ios-arm64.ini
@@ -0,0 +1,27 @@
1[constants]
2xcode = '/Applications/Xcode.app/Contents/Developer'
3platform = xcode + '/Platforms/iPhoneOS.platform'
4sdk = platform + '/Developer/SDKs/iPhoneOS.sdk'
5osminver = '9.0'
6
7common_flags = ['-arch', 'arm64', '-isysroot', sdk, '-miphoneos-version-min=' + osminver]
8
9[properties]
10sizeof_int = 4
11sizeof_wchar_t = 4
12sizeof_void* = 8
13c_args = common_flags + ['-fobjc-abi-version=2', '-ffast-math']
14cpp_args = common_flags + ['-fobjc-abi-version=2', '-ffast-math', '-fvisibility-inlines-hidden']
15c_link_args = common_flags
16
17[binaries]
18c = xcode + '/usr/bin/gcc'
19cpp = xcode + '/usr/bin/g++'
20c_ld = xcode + '/usr/bin/ld'
21strip = xcode + '/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip'
22
23[host_machine]
24system = 'darwin'
25cpu_family = 'aarc64'
26cpu = 'arm64'
27endian = 'little'
diff --git a/ios/deps.sh b/ios/deps.sh
new file mode 100755
index 00000000..9970087d
--- /dev/null
+++ b/ios/deps.sh
@@ -0,0 +1,81 @@
1#!/bin/sh
2KIND=iphone$1
3if [ -z "$1" ]; then
4 echo "Usage: ios-deps.sh os|simulator"
5 exit 0
6fi
7if [ "$KIND" = "iphoneos" ]; then
8 PREFIX=$HOME/SDK/ios
9else
10 PREFIX=$HOME/SDK/ios-sim
11fi
12DIR_FRIBIDI=$HOME/src/libs/fribidi
13DIR_HARFBUZZ=$HOME/src/libs/harfbuzz
14DIR_ICONV=$HOME/src/libs/libiconv-1.16
15DIR_UNISTRING=$HOME/src/libs/libunistring-0.9.10
16DIR_PCRE=$HOME/src/libs/pcre-8.44
17
18echo "Prefix: ${PREFIX}"
19read -p "--- Press Enter to begin ---"
20
21ICONF=$HOME/src/libs/ios-autotools/iconfigure
22# Note: There's a small modification to the `iconfigure` script.
23export OSMINVER=9.0
24export SDK=$KIND
25
26function build_arch() {
27 arch=$1
28
29 cd $DIR_FRIBIDI
30 rm -rf ios-build
31 mkdir ios-build
32 cd ios-build
33 meson .. \
34 --cross-file $HOME/cross-mac-arm64-ios-arm64.ini \
35 -Dbuildtype=release \
36 -Ddefault_library=static \
37 -Dtests=false \
38 -Ddocs=false \
39 -Dbin=false \
40 -Ddocs=false \
41 --prefix ${PREFIX}/arm64
42 ninja install
43
44 cd $DIR_HARFBUZZ
45 make clean
46 PREFIX=$PREFIX/$arch $ICONF $arch --with-cairo=no --with-glib=no --with-freetype=no --with-gobject=no --with-chafa=no --with-graphite2=no --with-coretext=no
47 make install
48
49 cd $DIR_ICONV
50 make clean
51 PREFIX=$PREFIX/$arch $ICONF $arch
52 make install
53
54 cd $DIR_UNISTRING
55 make clean
56 PREFIX=$PREFIX/$arch $ICONF $arch --disable-namespacing --with-libiconv-prefix=$PREFIX/$arch
57 make install
58
59 cd $DIR_PCRE
60 make clean
61 PREFIX=$PREFIX/$arch $ICONF $arch --enable-unicode-properties
62 make install
63}
64
65function fat_archive() {
66 lipo \
67 -arch x86_64 $PREFIX/x86_64/lib/$1 \
68 -arch arm64 $PREFIX/arm64/lib/$1 \
69 -output $PREFIX/fat/lib/$1 -create
70}
71
72#build_arch x86_64
73build_arch arm64
74
75#fat_archive libiconv.a
76#fat_archive libunistring.a
77#fat_archive libpcre.a
78
79#mkdir -p $PREFIX/fat/include
80#cp -r $PREFIX/arm64/include/* $PREFIX/fat/include
81
diff --git a/ios/iconfigure-osminver.patch b/ios/iconfigure-osminver.patch
new file mode 100644
index 00000000..2ef0076d
--- /dev/null
+++ b/ios/iconfigure-osminver.patch
@@ -0,0 +1,18 @@
1diff --git a/iconfigure b/iconfigure
2index 734bb47..e31c6cf 100755
3--- a/iconfigure
4+++ b/iconfigure
5@@ -93,10 +93,10 @@ export CXX=$(xcrun --sdk $SDK --find g++)
6 export LD=$(xcrun --sdk $SDK --find ld)
7
8 # Flags
9-export CFLAGS="$CFLAGS -arch $ARCH -isysroot $SDKROOT -I$PREFIX/include -miphoneos-version-min=$SDKVERSION"
10-export CPPFLAGS="$CPPFLAGS -arch $ARCH -isysroot $SDKROOT -I$PREFIX/include -miphoneos-version-min=$SDKVERSION"
11+export CFLAGS="$CFLAGS -arch $ARCH -isysroot $SDKROOT -I$PREFIX/include -miphoneos-version-min=$OSMINVER"
12+export CPPFLAGS="$CPPFLAGS -arch $ARCH -isysroot $SDKROOT -I$PREFIX/include -miphoneos-version-min=$OSMINVER"
13 export CXXFLAGS="$CXXFLAGS -arch $ARCH -isysroot $SDKROOT -I$PREFIX/include"
14-export LDFLAGS="$LDFLAGS -arch $ARCH -isysroot $SDKROOT -L$PREFIX/lib"
15+export LDFLAGS="$LDFLAGS -arch $ARCH -isysroot $SDKROOT -L$PREFIX/lib -miphoneos-version-min=$OSMINVER"
16 export PKG_CONFIG_PATH="$PKG_CONFIG_PATH":"$SDKROOT/usr/lib/pkgconfig":"$PREFIX/lib/pkgconfig"
17
18 # Remove script parameters