File tree Expand file tree Collapse file tree 2 files changed +16
-9
lines changed Expand file tree Collapse file tree 2 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,17 @@ ARCH=aarch64
8
8
SDKROOT=${TMPDIR:-/ tmp} /swift-android-sdk
9
9
mkdir -p ${SDKROOT}
10
10
11
+ # fetch the patches
12
+ PATCHDIR=${SDKROOT} /patches
13
+ if [[ ! -d ${PATCHDIR} ]]; then
14
+ git clone https://github.com/finagolfin/swift-android-sdk.git ${PATCHDIR}
15
+ fi
16
+
17
+ HOST_TOOLCHAIN=${HOST_TOOLCHAIN:- $(dirname $(dirname $(which swiftc)))}
18
+ # HOST_TOOLCHAIN=${HOST_TOOLCHAIN:-${HOME}/.local/share/swiftly/toolchains/6.1.0/usr}
19
+
20
+ ${HOST_TOOLCHAIN} /bin/swift --version
21
+
11
22
export ANDROID_NDK_HOME=${SDKROOT} /ndk/android-ndk-r27c
12
23
export ANDROID_NDK=${ANDROID_NDK_HOME}
13
24
@@ -20,7 +31,6 @@ if [[ ! -d ${ANDROID_NDK_HOME} ]]; then
20
31
popd
21
32
fi
22
33
23
-
24
34
mkdir -p ${SDKROOT} /products
25
35
26
36
# Check-out the sources
@@ -32,9 +42,5 @@ if [[ ! -d ${SDKROOT}/src ]]; then
32
42
./scripts/fetch-source.sh --source-dir ${SDKROOT} /src
33
43
fi
34
44
35
- HOST_TOOLCHAIN=${HOST_TOOLCHAIN:- $(dirname $(dirname $(which swiftc)))}
36
- # HOST_TOOLCHAIN=${HOST_TOOLCHAIN:-${HOME}/.local/share/swiftly/toolchains/6.1.0/usr}
37
-
38
- ./scripts/build.sh --products-dir ${SDKROOT} /prod --source-dir ${SDKROOT} /src --build-dir ${SDKROOT} /build --ndk-home ${ANDROID_NDK_HOME} --host-toolchain ${HOST_TOOLCHAIN} --archs $ARCH
39
-
45
+ ./scripts/build.sh --patch-dir ${PATCHDIR} --products-dir ${SDKROOT} /products --source-dir ${SDKROOT} /src --build-dir ${SDKROOT} /build --ndk-home ${ANDROID_NDK_HOME} --host-toolchain ${HOST_TOOLCHAIN} --archs $ARCH
40
46
Original file line number Diff line number Diff line change @@ -108,13 +108,14 @@ source_dir=
108
108
ndk_home=${ANDROID_NDK}
109
109
build_dir=$( pwd) /build
110
110
products_dir=
111
- # the location of the patches to apply
112
- patch_dir=$( dirname $( dirname $( realpath $0 ) ) )
111
+ patch_dir=
113
112
114
113
while [ " $# " -gt 0 ]; do
115
114
case " $1 " in
116
115
--source-dir)
117
116
source_dir=" $2 " ; shift ;;
117
+ --patch-dir)
118
+ patch_dir=" $2 " ; shift ;;
118
119
--ndk-home)
119
120
ndk_home=" $2 " ; shift ;;
120
121
--host-toolchain)
142
143
# Change the commas for spaces
143
144
archs=" ${archs// ,/ } "
144
145
145
- if [[ -z " $source_dir " || -z " $products_dir " || -z " $ndk_home " || -z " $host_toolchain " ]]; then
146
+ if [[ -z " $source_dir " || -z " $products_dir " || -z " $patch_dir " || -z " $ ndk_home" || -z " $host_toolchain " ]]; then
146
147
usage
147
148
exit 1
148
149
fi
You can’t perform that action at this time.
0 commit comments