Skip to content

Commit

Permalink
swift: update from 5.10.1 to 6.0 Nov 5 snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
finagolfin committed Nov 11, 2024
1 parent dcf6f53 commit f8d1715
Show file tree
Hide file tree
Showing 29 changed files with 2,148 additions and 6,947 deletions.
8 changes: 4 additions & 4 deletions packages/libdispatch/build.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
TERMUX_PKG_HOMEPAGE=https://github.com/apple/swift-corelibs-libdispatch
TERMUX_PKG_HOMEPAGE=https://github.com/swiftlang/swift-corelibs-libdispatch
TERMUX_PKG_DESCRIPTION="The libdispatch project, for concurrency on multicore hardware"
TERMUX_PKG_LICENSE="Apache-2.0"
TERMUX_PKG_MAINTAINER="@finagolfin"
TERMUX_PKG_VERSION="1:5.10"
TERMUX_PKG_SRCURL=https://github.com/apple/swift-corelibs-libdispatch/archive/swift-${TERMUX_PKG_VERSION:2}-RELEASE.tar.gz
TERMUX_PKG_SHA256=16e088cf12654d22658879710b9694a6fad1c94d5e5d0c597741b71fbcb3e034
TERMUX_PKG_VERSION="1:6.0"
TERMUX_PKG_SRCURL=https://github.com/swiftlang/swift-corelibs-libdispatch/archive/swift-${TERMUX_PKG_VERSION:2}-DEVELOPMENT-SNAPSHOT-2024-11-05-a.tar.gz
TERMUX_PKG_SHA256=0b68c9dfb3f5a95467de9f9a057566d979728cfed54cffc39df5011bc0a0574d
TERMUX_PKG_AUTO_UPDATE=false
TERMUX_PKG_DEPENDS="libc++, libblocksruntime"
8 changes: 4 additions & 4 deletions packages/llbuild/build.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
TERMUX_PKG_HOMEPAGE=https://github.com/apple/swift-llbuild
TERMUX_PKG_HOMEPAGE=https://github.com/swiftlang/swift-llbuild
TERMUX_PKG_DESCRIPTION="A low-level build system, used by the Swift Package Manager"
TERMUX_PKG_LICENSE="Apache-2.0, NCSA"
TERMUX_PKG_MAINTAINER="@finagolfin"
TERMUX_PKG_VERSION=5.10
TERMUX_PKG_SRCURL=https://github.com/apple/swift-llbuild/archive/swift-${TERMUX_PKG_VERSION}-RELEASE.tar.gz
TERMUX_PKG_SHA256=ae8962d59244abac157c02813d05e1c077915bbd6022fe9fb62040806ac8dc55
TERMUX_PKG_VERSION=6.0
TERMUX_PKG_SRCURL=https://github.com/swiftlang/swift-llbuild/archive/swift-${TERMUX_PKG_VERSION}-DEVELOPMENT-SNAPSHOT-2024-11-05-a.tar.gz
TERMUX_PKG_SHA256=841f52f831a630af2fbaa958b3404ab11fe9858e51d6bc441f7936aa6bf2699e
TERMUX_PKG_DEPENDS="libc++, libandroid-spawn, libsqlite"
TERMUX_PKG_NO_STATICSPLIT=true
69 changes: 41 additions & 28 deletions packages/swift/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@ TERMUX_PKG_HOMEPAGE=https://swift.org/
TERMUX_PKG_DESCRIPTION="Swift is a high-performance system programming language"
TERMUX_PKG_LICENSE="Apache-2.0, NCSA"
TERMUX_PKG_MAINTAINER="@finagolfin"
TERMUX_PKG_VERSION=5.10.1
TERMUX_PKG_REVISION=1
SWIFT_RELEASE="RELEASE"
TERMUX_PKG_SRCURL=https://github.com/apple/swift/archive/swift-$TERMUX_PKG_VERSION-$SWIFT_RELEASE.tar.gz
TERMUX_PKG_SHA256=087c59a1b79c46dd23f8e6cb4fe12a27935a5b6581282f48db952827bb3fdf57
TERMUX_PKG_VERSION=6.0
SWIFT_RELEASE="DEVELOPMENT-SNAPSHOT-2024-11-05-a"
TERMUX_PKG_SRCURL=https://github.com/swiftlang/swift/archive/swift-$TERMUX_PKG_VERSION-$SWIFT_RELEASE.tar.gz
TERMUX_PKG_SHA256=cb513ab7170d0374e195fd468704d72a8651017f5c2cb4dc25c6c075d036a081
TERMUX_PKG_AUTO_UPDATE=false
TERMUX_PKG_HOSTBUILD=true
TERMUX_PKG_DEPENDS="clang, libandroid-glob, libandroid-posix-semaphore, libandroid-spawn, libcurl, libicu, libicu-static, libsqlite, libuuid, libxml2, libdispatch, llbuild, pkg-config, swift-sdk-${TERMUX_ARCH/_/-}"
TERMUX_PKG_DEPENDS="clang, libandroid-execinfo, libandroid-glob, libandroid-posix-semaphore, libandroid-shmem, libandroid-spawn, libandroid-spawn-static, libandroid-sysv-semaphore, libcurl, libsqlite, libuuid, libxml2, libdispatch, llbuild, pkg-config, swift-sdk-${TERMUX_ARCH/_/-}"
TERMUX_PKG_BUILD_DEPENDS="rsync"
TERMUX_PKG_BLACKLISTED_ARCHES="i686"
TERMUX_PKG_NO_STATICSPLIT=true
# Temporary hack only needed for x86_64
TERMUX_PKG_UNDEF_SYMBOLS_FILES="
./opt/ndk-multilib/x86_64-linux-android/lib/libFoundation.so
./opt/ndk-multilib/x86_64-linux-android/lib/libFoundationNetworking.so
"
# Building swift uses CMake, but the standard
# termux_step_configure_cmake function is not used. Instead, we set
# TERMUX_PKG_FORCE_CMAKE to make the build system aware that CMake is
Expand All @@ -36,26 +40,28 @@ termux_step_post_get_source() {
mv .temp swift

declare -A library_checksums
library_checksums[swift-cmark]=6d209b8bf81fe0d67ae6d55913e7750ec752bc7fc29fc0ef5da2fdf8a6057406
library_checksums[llvm-project]=fad2de34c6c005b7bc63ce7b4f20d6cdf0e1d60109a7a589ffd782180c23102b
library_checksums[swift-experimental-string-processing]=7e6ea60653b580abaf0801d697971610e7e22b4eb427edcee486b741b14d2724
library_checksums[swift-syntax]=500ff2c6d9435311fa42ad2e87927a3025b6c3682c18ecb9710c522c0be52a53
library_checksums[swift-corelibs-libdispatch]=affa3544b0fdb60f8f175bc0d2846177436d5848ef8ca73e3e560d23986f38b3
library_checksums[swift-corelibs-foundation]=94dadc18f527f25cf1ce486d0ddce7de00f725063bc43526bdb73e534c8d97c3
library_checksums[swift-corelibs-xctest]=cec269b435a9f32edcf90958abec16fcf50febcb99e389ed56e9e692c3270e27
library_checksums[swift-llbuild]=64d135c1aaf96636b0ff6a2682e605474fe9e33f740a8ba2a3c469e2c8ae9f38
library_checksums[sourcekit-lsp]=4173ec5da3fe437d5ea43bf0e3190f8b12d522001555eba071ab04e38ebc04af
library_checksums[swift-corelibs-xctest]=8b97705d79e03e6c08785e2dfa455af50a289c16c3dd497b25e51950aba66ce4
library_checksums[swift-corelibs-foundation]=fa53331287cb7042024455c1e2204c4a11ea7ffa887bf8713ff600ffe7d48f61
library_checksums[swift-collections]=cd30d2f93c72424df48d182006417abdeebe74d250cb99d1cda78daf40aca569
library_checksums[swift-driver]=16ee97b848fddcdab0baeb8721945066b4843885a9dc4a6e288a83b5a80051fb
library_checksums[swift-foundation]=79c87b27a1a306ad9fd347ae7fbe9ab596f57a0a56391fbb92f5b468be8e57ab
library_checksums[swift-argument-parser]=4a10bbef290a2167c5cc340b39f1f7ff6a8cf4e1b5433b68548bf5f1e542e908
library_checksums[Yams]=ec1ad699c30f0db45520006c63a88cc1c946a7d7b36dff32a96460388c0a4af2
library_checksums[swift-collections]=d0f584b197860db26fd939175c9d1a7badfe7b89949b4bd52d4f626089776e0a
library_checksums[swift-crypto]=5c860c0306d0393ff06268f361aaf958656e1288353a0e23c3ad20de04319154
library_checksums[swift-system]=865b8c380455eef27e73109835142920c60ae4c4f4178a3d12ad04acc83f1371
library_checksums[swift-syntax]=db13b18e2fbc3806c260f201b4cd24afaa91a7c8c484e1f0c55ae01afd6d4671
library_checksums[swift-llbuild]=841f52f831a630af2fbaa958b3404ab11fe9858e51d6bc441f7936aa6bf2699e
library_checksums[swift-corelibs-libdispatch]=0b68c9dfb3f5a95467de9f9a057566d979728cfed54cffc39df5011bc0a0574d
library_checksums[swift-foundation-icu]=5c3d23180c484b61c9165c314c35a16b884c88b670558e160350c3b4ed34cde9
library_checksums[swift-system]=02e13a7f77887c387f5aa1de05f4d4b8b158c35145450e1d9557d6c42b06cd1f
library_checksums[swift-asn1]=e0da995ae53e6fcf8251887f44d4030f6600e2f8f8451d9c92fcaf52b41b6c35
library_checksums[swift-tools-support-core]=ffb652619b26b324aff52db5bfe0e5ee209fa145675847a83deed68d13315cb3
library_checksums[swift-package-manager]=f235bb1eb5b93dce0be3f2a660d79e85afedabf12d2b81e37ac925dfe5c88cc5
library_checksums[swift-cmark]=5707277a1fabfdf9001b08b6a4e606409748a336d688124b8e79ffc980a1e9bd
library_checksums[indexstore-db]=6b02cc1d6296bbfb763d23706144d83dd924daa855253156973555c8bbfa07ce
library_checksums[swift-certificates]=fcaca458aab45ee69b0f678b72c2194b15664cc5f6f5e48d0e3f62bc5d1202ca
library_checksums[swift-driver]=75530eab66f4dffb9cecf422d0c5e582f08f84c8289ce245d48010e73ad1fc71
library_checksums[swift-tools-support-core]=fbc2d5dcf4eb27e7e786a19559e4ab5af6469238e3e89b910511145874bdfc52
library_checksums[swift-package-manager]=3d35e35b6e7a061042d3cd4913030525462faa357901a91a2d2f037d12e5987c
library_checksums[indexstore-db]=8be52307236e21e942972417fd3c8182a7865757f7890eec167851c75d156996
library_checksums[sourcekit-lsp]=f83aabe6e66adc2d3ffb7e948ddfd805f7f58fd43c6b33d48bb4a50186ce0abb
library_checksums[swift-crypto]=5c860c0306d0393ff06268f361aaf958656e1288353a0e23c3ad20de04319154
library_checksums[llvm-project]=a5751839fbfda6b91c1e7b404e9f6b2d9c0341b59ccd07ac764f9e8a4e48ca33
library_checksums[swift-experimental-string-processing]=69f07d510b0eb51bacb6ba828b6e54d40f0b9aa876dcfb21ea48164df3d4987d
library_checksums[Yams]=a81c6b93f5d26bae1b619b7f8babbfe7c8abacf95b85916961d488888df886fb

for library in "${!library_checksums[@]}"; do \
GH_ORG="apple"
Expand All @@ -69,19 +75,20 @@ termux_step_post_get_source() {
SRC_VERSION="1.0.1"
TAR_NAME=$SRC_VERSION
elif [ "$library" = "swift-collections" ]; then
SRC_VERSION="1.0.5"
SRC_VERSION="1.1.2"
TAR_NAME=$SRC_VERSION
elif [ "$library" = "swift-crypto" ]; then
SRC_VERSION="3.0.0"
TAR_NAME=$SRC_VERSION
elif [ "$library" = "swift-system" ]; then
SRC_VERSION="1.1.1"
SRC_VERSION="1.3.0"
TAR_NAME=$SRC_VERSION
elif [ "$library" = "Yams" ]; then
GH_ORG="jpsim"
SRC_VERSION="5.0.1"
SRC_VERSION="5.0.6"
TAR_NAME=$SRC_VERSION
else
GH_ORG="swiftlang"
SRC_VERSION=$SWIFT_RELEASE
TAR_NAME=swift-$TERMUX_PKG_VERSION-$SWIFT_RELEASE
fi
Expand Down Expand Up @@ -127,6 +134,9 @@ termux_step_make() {
if [ "$TERMUX_ON_DEVICE_BUILD" = "false" ]; then
termux_setup_swift
ln -sf $TERMUX_PKG_HOSTBUILD_DIR/llvm-linux-x86_64 $TERMUX_PKG_BUILDDIR/llvm-linux-x86_64
for header in execinfo.h glob.h iconv.h spawn.h sys/sem.h sys/shm.h; do
ln -sf $TERMUX_PREFIX/include/$header $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/include/$header
done

SWIFT_BUILD_FLAGS="$SWIFT_BUILD_FLAGS --android
--android-ndk $TERMUX_STANDALONE_TOOLCHAIN --android-arch $SWIFT_ARCH
Expand All @@ -144,17 +154,20 @@ termux_step_make() {
--swift-install-components=$SWIFT_COMPONENTS --llvm-install-components=IndexStore \
--install-llvm --install-swift --install-libdispatch --install-foundation \
--install-xctest --install-llbuild --install-swiftpm --install-swift-driver --install-sourcekit-lsp

rm $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/include/{execinfo.h,glob.h,iconv.h,spawn.h,sys/sem.h,sys/shm.h}
}

termux_step_make_install() {
rm -rf $TERMUX_PREFIX/lib/swift{,_static}/{Block,os}
rm $TERMUX_PREFIX/lib/swift{,_static}/dispatch/*.h
rm $TERMUX_PREFIX/lib/swift/android/lib{dispatch,BlocksRuntime}.so
mv $TERMUX_PREFIX/lib/swift/android/lib[^_]*.so $TERMUX_PREFIX/opt/ndk-multilib/$TERMUX_ARCH-linux-android*/lib
mv $TERMUX_PREFIX/lib/swift/android/lib_FoundationICU.so $TERMUX_PREFIX/opt/ndk-multilib/$TERMUX_ARCH-linux-android*/lib
mv $TERMUX_PREFIX/lib/swift/android/lib*.a $TERMUX_PREFIX/lib/swift/android/$SWIFT_ARCH
mv $TERMUX_PREFIX/lib/swift_static/android/lib*.a $TERMUX_PREFIX/lib/swift_static/android/$SWIFT_ARCH

if [ "$TERMUX_ON_DEVICE_BUILD" = "false" ]; then
rm $TERMUX_PREFIX/swiftpm-android-$SWIFT_ARCH.json
mv $TERMUX_PREFIX/glibc-native.modulemap \
$TERMUX_PREFIX/lib/swift/android/$SWIFT_ARCH/glibc.modulemap
fi
}
Loading

0 comments on commit f8d1715

Please sign in to comment.