|
59 | 59 | PATCHDIR=${SDKROOT}/patches
|
60 | 60 | if [[ ! -d ${PATCHDIR} ]]; then
|
61 | 61 | git clone https://github.com/finagolfin/swift-android-sdk.git ${PATCHDIR}
|
62 |
| -fi |
63 | 62 |
|
64 |
| -# Apply patches |
65 |
| -# TODO: need to selectively apply patches based on release or not release |
66 |
| -pushd ${SDKROOT}/src/swift-project |
67 |
| - echo "Applying patches" |
| 63 | + # TODO: need to selectively apply patches based on release or not release |
| 64 | + pushd ${SDKROOT}/src/swift-project |
| 65 | + echo "Applying patches" |
68 | 66 |
|
69 |
| - # patch the patch, which seems to only be needed for an API less than 28 |
70 |
| - # https://github.com/finagolfin/swift-android-sdk/blob/main/swift-android.patch#L110 |
71 |
| - perl -pi -e 's/#if os\(Windows\)/#if os\(Android\)/g' $PATCHDIR/swift-android.patch |
| 67 | + # patch the patch, which seems to only be needed for an API less than 28 |
| 68 | + # https://github.com/finagolfin/swift-android-sdk/blob/main/swift-android.patch#L110 |
| 69 | + perl -pi -e 's/#if os\(Windows\)/#if os\(Android\)/g' $PATCHDIR/swift-android.patch |
72 | 70 |
|
73 |
| - # remove the need to link in android-execinfo |
74 |
| - perl -pi -e 's/dispatch android-execinfo/dispatch/g' $PATCHDIR/swift-android.patch |
| 71 | + # remove the need to link in android-execinfo |
| 72 | + perl -pi -e 's/dispatch android-execinfo/dispatch/g' $PATCHDIR/swift-android.patch |
75 | 73 |
|
76 |
| - git apply -v $PATCHDIR/swift-android.patch |
77 |
| - # swift-android-ci.patch is not needed, since it is only used for llbuild, etc. |
78 |
| - #git apply -C1 $PATCHDIR/swift-android-ci.patch |
79 |
| - git apply -v $PATCHDIR/swift-android-ci-release.patch |
80 |
| - git apply -v $PATCHDIR/swift-android-testing-release.patch |
| 74 | + git apply -v $PATCHDIR/swift-android.patch |
| 75 | + # swift-android-ci.patch is not needed, since it is only used for llbuild, etc. |
| 76 | + #git apply -C1 $PATCHDIR/swift-android-ci.patch |
| 77 | + git apply -v $PATCHDIR/swift-android-ci-release.patch |
| 78 | + git apply -v $PATCHDIR/swift-android-testing-release.patch |
81 | 79 |
|
82 |
| - perl -pi -e 's%String\(cString: getpass%\"fake\" //%' swiftpm/Sources/PackageRegistryCommand/PackageRegistryCommand+Auth.swift |
83 |
| - # disable backtrace() for Android (needs either API33+ or libandroid-execinfo, or to manually add in backtrace backport) |
84 |
| - perl -pi -e 's/os\(Android\)/os\(AndroidDISABLED\)/g' swift-testing/Sources/Testing/SourceAttribution/Backtrace.swift |
| 80 | + perl -pi -e 's%String\(cString: getpass%\"fake\" //%' swiftpm/Sources/PackageRegistryCommand/PackageRegistryCommand+Auth.swift |
| 81 | + # disable backtrace() for Android (needs either API33+ or libandroid-execinfo, or to manually add in backtrace backport) |
| 82 | + perl -pi -e 's/os\(Android\)/os\(AndroidDISABLED\)/g' swift-testing/Sources/Testing/SourceAttribution/Backtrace.swift |
85 | 83 |
|
86 |
| - # need to un-apply libandroid-spawn since we don't need it for API28+ |
87 |
| - perl -pi -e 's/MATCHES "Android"/MATCHES "AndroidDISABLED"/g' llbuild/lib/llvm/Support/CMakeLists.txt |
88 |
| - perl -pi -e 's/ STREQUAL Android\)/ STREQUAL AndroidDISABLED\)/g' swift-corelibs-foundation/Sources/Foundation/CMakeLists.txt |
89 |
| -popd |
| 84 | + # need to un-apply libandroid-spawn since we don't need it for API28+ |
| 85 | + perl -pi -e 's/MATCHES "Android"/MATCHES "AndroidDISABLED"/g' llbuild/lib/llvm/Support/CMakeLists.txt |
| 86 | + perl -pi -e 's/ STREQUAL Android\)/ STREQUAL AndroidDISABLED\)/g' swift-corelibs-foundation/Sources/Foundation/CMakeLists.txt |
| 87 | + popd |
| 88 | +fi |
90 | 89 |
|
91 | 90 | ./scripts/build.sh --products-dir ${SDKROOT}/products --source-dir ${SDKROOT}/src --build-dir ${SDKROOT}/build --ndk-home ${ANDROID_NDK_HOME} --android-api ${ANDROID_API} --host-toolchain ${HOST_TOOLCHAIN} --archs ${TARGET_ARCHS}
|
92 | 91 |
|
0 commit comments