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
88SDKROOT=${TMPDIR:-/ tmp} /swift-android-sdk
99mkdir -p ${SDKROOT}
1010
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+
1122export ANDROID_NDK_HOME=${SDKROOT} /ndk/android-ndk-r27c
1223export ANDROID_NDK=${ANDROID_NDK_HOME}
1324
@@ -20,7 +31,6 @@ if [[ ! -d ${ANDROID_NDK_HOME} ]]; then
2031 popd
2132fi
2233
23-
2434mkdir -p ${SDKROOT} /products
2535
2636# Check-out the sources
@@ -32,9 +42,5 @@ if [[ ! -d ${SDKROOT}/src ]]; then
3242 ./scripts/fetch-source.sh --source-dir ${SDKROOT} /src
3343fi
3444
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
4046
Original file line number Diff line number Diff line change @@ -108,13 +108,14 @@ source_dir=
108108ndk_home=${ANDROID_NDK}
109109build_dir=$( pwd) /build
110110products_dir=
111- # the location of the patches to apply
112- patch_dir=$( dirname $( dirname $( realpath $0 ) ) )
111+ patch_dir=
113112
114113while [ " $# " -gt 0 ]; do
115114 case " $1 " in
116115 --source-dir)
117116 source_dir=" $2 " ; shift ;;
117+ --patch-dir)
118+ patch_dir=" $2 " ; shift ;;
118119 --ndk-home)
119120 ndk_home=" $2 " ; shift ;;
120121 --host-toolchain)
142143# Change the commas for spaces
143144archs=" ${archs// ,/ } "
144145
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
146147 usage
147148 exit 1
148149fi
You can’t perform that action at this time.
0 commit comments