diff options
Diffstat (limited to 'ios/deps.sh')
-rwxr-xr-x | ios/deps.sh | 81 |
1 files changed, 81 insertions, 0 deletions
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 | |||