diff options
Diffstat (limited to 'ios')
-rwxr-xr-x | ios/cmake-ios-lagrange.sh | 13 | ||||
-rwxr-xr-x | ios/cmake-ios-tf.sh | 11 | ||||
-rw-r--r-- | ios/cross-mac-arm64-ios-arm64.ini | 27 | ||||
-rwxr-xr-x | ios/deps.sh | 81 | ||||
-rw-r--r-- | ios/iconfigure-osminver.patch | 18 |
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 | ||
2 | IOS_DIR="$HOME/SDK/ios/arm64" | ||
3 | cmake ../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 | ||
2 | cmake ../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] | ||
2 | xcode = '/Applications/Xcode.app/Contents/Developer' | ||
3 | platform = xcode + '/Platforms/iPhoneOS.platform' | ||
4 | sdk = platform + '/Developer/SDKs/iPhoneOS.sdk' | ||
5 | osminver = '9.0' | ||
6 | |||
7 | common_flags = ['-arch', 'arm64', '-isysroot', sdk, '-miphoneos-version-min=' + osminver] | ||
8 | |||
9 | [properties] | ||
10 | sizeof_int = 4 | ||
11 | sizeof_wchar_t = 4 | ||
12 | sizeof_void* = 8 | ||
13 | c_args = common_flags + ['-fobjc-abi-version=2', '-ffast-math'] | ||
14 | cpp_args = common_flags + ['-fobjc-abi-version=2', '-ffast-math', '-fvisibility-inlines-hidden'] | ||
15 | c_link_args = common_flags | ||
16 | |||
17 | [binaries] | ||
18 | c = xcode + '/usr/bin/gcc' | ||
19 | cpp = xcode + '/usr/bin/g++' | ||
20 | c_ld = xcode + '/usr/bin/ld' | ||
21 | strip = xcode + '/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip' | ||
22 | |||
23 | [host_machine] | ||
24 | system = 'darwin' | ||
25 | cpu_family = 'aarc64' | ||
26 | cpu = 'arm64' | ||
27 | endian = '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 | ||
2 | KIND=iphone$1 | ||
3 | if [ -z "$1" ]; then | ||
4 | echo "Usage: ios-deps.sh os|simulator" | ||
5 | exit 0 | ||
6 | fi | ||
7 | if [ "$KIND" = "iphoneos" ]; then | ||
8 | PREFIX=$HOME/SDK/ios | ||
9 | else | ||
10 | PREFIX=$HOME/SDK/ios-sim | ||
11 | fi | ||
12 | DIR_FRIBIDI=$HOME/src/libs/fribidi | ||
13 | DIR_HARFBUZZ=$HOME/src/libs/harfbuzz | ||
14 | DIR_ICONV=$HOME/src/libs/libiconv-1.16 | ||
15 | DIR_UNISTRING=$HOME/src/libs/libunistring-0.9.10 | ||
16 | DIR_PCRE=$HOME/src/libs/pcre-8.44 | ||
17 | |||
18 | echo "Prefix: ${PREFIX}" | ||
19 | read -p "--- Press Enter to begin ---" | ||
20 | |||
21 | ICONF=$HOME/src/libs/ios-autotools/iconfigure | ||
22 | # Note: There's a small modification to the `iconfigure` script. | ||
23 | export OSMINVER=9.0 | ||
24 | export SDK=$KIND | ||
25 | |||
26 | function 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 | |||
65 | function 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 | ||
73 | build_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 @@ | |||
1 | diff --git a/iconfigure b/iconfigure | ||
2 | index 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 | ||