Skip to content

Commit

Permalink
[Static SDK for Linux] Remove ICU from the build. (#422)
Browse files Browse the repository at this point in the history
  • Loading branch information
al45tair authored Oct 4, 2024
1 parent 38e4244 commit 1c187af
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 61 deletions.
2 changes: 2 additions & 0 deletions swift-ci/sdks/static-linux/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
products
source
47 changes: 1 addition & 46 deletions swift-ci/sdks/static-linux/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,6 @@ declare_package libxml2 "libxml2" "MIT" \
declare_package curl "curl" "MIT" "https://curl.se"
declare_package boringssl "boringssl" "OpenSSL AND ISC AND MIT" \
"https://boringssl.googlesource.com/boringssl/"
declare_package icu "icu" \
"Unicode-3.0 AND ICU AND BSD-3-Clause AND NAIST-2003 AND MIT" \
"https://icu.unicode.org"
declare_package zlib "zlib" "Zlib" "https://zlib.net"

# Parse command line arguments
Expand Down Expand Up @@ -209,8 +206,6 @@ curl_version=${curl_desc#curl-}

boringssl_version=$(describe ${source_dir}/boringssl)

icu_version=$(describe ${source_dir}/icu)

zlib_version=$(versionFromTag ${source_dir}/zlib)

function quiet_pushd {
Expand All @@ -237,7 +232,6 @@ echo " - Musl FTS ${musl_fts_version}"
echo " - libxml2 ${libxml2_version}"
echo " - curl ${curl_version}"
echo " - BoringSSL ${boringssl_version}"
echo " - ICU ${icu_version}"
echo " - zlib ${zlib_version}"

function run() {
Expand Down Expand Up @@ -274,14 +268,6 @@ else
exit 1
fi

header "Building ICU for host system"

mkdir -p ${build_dir}/icu
quiet_pushd ${build_dir}/icu
run "${source_dir}/icu/icu4c/source/configure"
run make -j$parallel_jobs
quiet_popd

for arch in $archs; do

# Fix architecture names
Expand Down Expand Up @@ -537,37 +523,6 @@ EOF

# -----------------------------------------------------------------------

header "Building ICU for $arch"

mkdir -p ${build_dir}/$arch/icu
quiet_pushd ${build_dir}/$arch/icu
run "${source_dir}/icu/icu4c/source/configure" \
--host=$triple \
--prefix=$sdk_root/usr \
--libdir=$sdk_root/usr/lib \
--with-cross-build=${build_dir}/icu \
--disable-shared --enable-static \
--enable-strict --disable-icuio \
--disable-plugins --disable-dyload --disable-extras \
--disable-samples --disable-layoutex --with-data-packaging=auto \
LDFLAGS="$cxxldflags" \
CC="$cc" \
CXX="$cxx" \
AS="$as" \
AR="ar" RANLIB="ranlib"
make -j$parallel_jobs install
quiet_popd

# Install symlinks for the "swift" version
mkdir -p ${sdk_root}/usr/lib/swift_static/linux-static
quiet_pushd ${sdk_root}/usr/lib/swift_static/linux-static
for library in data i18n test tu uc; do
ln -sf ../../libicu${library}.a libicu${library}swift.a
done
quiet_popd

# -----------------------------------------------------------------------

header "Building libxml2 for $arch"

run cmake -G Ninja -S ${source_dir}/libxml2 -B ${build_dir}/$arch/libxml2 \
Expand All @@ -577,7 +532,7 @@ EOF
-DCMAKE_INSTALL_PREFIX=$sdk_root/usr \
-DBUILD_SHARED_LIBS=NO \
-DLIBXML2_WITH_PYTHON=NO \
-DLIBXML2_WITH_ICU=YES \
-DLIBXML2_WITH_ICU=NO \
-DLIBXML2_WITH_LZMA=NO

quiet_pushd ${build_dir}/$arch/libxml2
Expand Down
16 changes: 1 addition & 15 deletions swift-ci/sdks/static-linux/scripts/fetch-source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ usage: fetch-source.sh [--swift-scheme <scheme>|--swift-tag <tag>
[--musl-version <version>] [--libxml2-version <version>]
[--curl-version <version>]
[--boringssl-version <version>]
[--icu-version <version>] [--zlib-version <version>]
[--zlib-version <version>]
[--clone-with-ssh]
[--source-dir <path>]
Expand All @@ -76,7 +76,6 @@ SDK for Swift. Options are:
--libxml2-version <version>
--curl-version <version>
--boringssl-version <version>
--icu-version <version>
--zlib-version <version>
Select the versions of other dependencies.
EOF
Expand All @@ -98,9 +97,6 @@ fi
if [[ -z "${BORINGSSL_VERSION}" ]]; then
BORINGSSL_VERSION=fips-20220613
fi
if [[ -z "${ICU_VERSION}" ]]; then
ICU_VERSION=maint/maint-69
fi
if [[ -z "${ZLIB_VERSION}" ]]; then
ZLIB_VERSION=1.3.1
fi
Expand All @@ -122,8 +118,6 @@ while [ "$#" -gt 0 ]; do
CURL_VERSION="$2"; shift ;;
--boringssl-version)
BORINGSSL_VERSION="$2"; shift ;;
--icu-version)
ICU_VERSION="$2"; shift ;;
--zlib-version)
ZLIB_VERSION="$2"; shift ;;
--clone-with-ssh)
Expand Down Expand Up @@ -207,14 +201,6 @@ pushd boringssl >/dev/null 2>&1
git checkout ${BORINGSSL_VERSION}
popd >/dev/null 2>&1

# Fetch ICU
header "Fetching ICU"

[[ -d icu ]] || git clone ${github}unicode-org/icu.git
pushd icu >/dev/null 2>&1
git checkout ${ICU_VERSION}
popd >/dev/null 2>&1

# Fetch zlib
header "Fetching zlib"

Expand Down

0 comments on commit 1c187af

Please sign in to comment.