Skip to content

Commit

Permalink
version 73
Browse files Browse the repository at this point in the history
  • Loading branch information
apotocki committed Apr 16, 2023
1 parent 953094a commit a20b4c4
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "icu"]
path = icu
url = https://github.com/unicode-org/icu
branch = maint/maint-72
branch = maint/maint-73
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## ICU for iOS and Mac OS X (Intel & Apple Silicon M1) & Catalyst - arm64 / x86_64

Supported versions: 72.1, 71.1, 70.1, 69.1, 68.2, 62.2
Supported versions: 73.1

This repo provides a universal script for building static ICU libraries for use in iOS and Mac OS X applications. The repo contains "icu" submodule that is taken from https://github.com/unicode-org/icu . The repo branches correspond to the suitable branches of ICU repo. E.g. "72" branch corresponds to "maint/maint-72" branch.
This repo provides a universal script for building static ICU libraries for use in iOS and Mac OS X applications. The repo contains "icu" submodule that is taken from https://github.com/unicode-org/icu . The repo branches correspond to the suitable branches of ICU repo. E.g. "73" branch corresponds to "maint/maint-73" branch.

## Prerequisites
1) Xcode must be installed because xcodebuild is used to create xcframeworks
Expand All @@ -13,6 +13,7 @@ This repo provides a universal script for building static ICU libraries for use
- Manually
```
# clone the repo
git clone -b 73 --recursive https://github.com/apotocki/icu4c-iosx
git clone --recursive https://github.com/apotocki/icu4c-iosx
# build libraries
Expand All @@ -24,9 +25,9 @@ This repo provides a universal script for building static ICU libraries for use
- Use cocoapods. Add the following lines into your project's Podfile:
```
use_frameworks!
pod 'icu4c-iosx'
pod 'icu4c-iosx', '~> 73.1'
# or optionally more precisely
# pod 'icu4c-iosx', :git => 'https://github.com/apotocki/icu4c-iosx', :submodules => 'true'
# pod 'icu4c-iosx', :git => 'https://github.com/apotocki/icu4c-iosx', :tag => '73.1.0', :submodules => 'true'
```
install new dependency:
```
Expand Down
2 changes: 1 addition & 1 deletion icu
Submodule icu updated 6048 files
2 changes: 1 addition & 1 deletion icu4c-iosx.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "icu4c-iosx"
s.version = "72.1.1"
s.version = "73.1.0"
s.summary = "ICU XCFramework for macOS and iOS, including both arm64 and x86_64 builds for macOS, Mac Catalyst and Simulator."
s.homepage = "https://github.com/apotocki/icu4c-iosx"
s.license = "BSD"
Expand Down
28 changes: 23 additions & 5 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e
THREAD_COUNT=$(sysctl hw.ncpu | awk '{print $2}')
HOST_ARC=$( uname -m )
XCODE_ROOT=$( xcode-select -print-path )
ICU_VER=maint/maint-72
ICU_VER=maint/maint-73
################## SETUP END
DEVSYSROOT=$XCODE_ROOT/Platforms/iPhoneOS.platform/Developer
SIMSYSROOT=$XCODE_ROOT/Platforms/iPhoneSimulator.platform/Developer
Expand All @@ -25,12 +25,22 @@ else
FOREIGN_BUILD_ARC=arm
fi

#if [ -z "${WITH_DATA_PACKAGING}" ]; then
# WITH_DATA_PACKAGING="static"
#fi

#explicit 72.1

#explicit 73.1
pushd icu
git reset --hard ff3514f257ea10afe7e710e9f946f68d256704b1
git reset --hard 5861e1fd52f1d7673eee38bc3c965aa18b336062
popd

COMMON_CONFIGURE_ARGS="--enable-static --disable-shared prefix=$INSTALL_DIR"
if [[ ! -z "${WITH_DATA_PACKAGING}" ]]; then
echo "USING WITH_DATA_PACKAGING: $WITH_DATA_PACKAGING"
COMMON_CONFIGURE_ARGS="$COMMON_CONFIGURE_ARGS --with-data-packaging=$WITH_DATA_PACKAGING"
fi

# (type, arc, build-arc, cflags, ldflags)
generic_build()
{
Expand All @@ -44,9 +54,13 @@ generic_build()
pushd $ICU_VER_NAME-$1-$2-build/source

COMMON_CFLAGS="-arch $2 $4"
./configure --disable-tools --disable-extras --disable-tests --disable-samples --disable-dyload --enable-static --disable-shared prefix=$INSTALL_DIR --host=$BUILD_ARC-apple-darwin --build=$3-apple --with-cross-build=$BUILD_DIR/$ICU_BUILD_FOLDER/source CFLAGS="$COMMON_CFLAGS" CXXFLAGS="$COMMON_CFLAGS -c -stdlib=libc++ -Wall --std=c++17" LDFLAGS="-stdlib=libc++ $5 -Wl,-dead_strip -lstdc++"

./configure $COMMON_CONFIGURE_ARGS --disable-tools --disable-extras --disable-tests --disable-samples --disable-dyload --host=$BUILD_ARC-apple-darwin --build=$3-apple --with-cross-build=$BUILD_DIR/$ICU_BUILD_FOLDER/source CFLAGS="$COMMON_CFLAGS" CXXFLAGS="$COMMON_CFLAGS -c -stdlib=libc++ -Wall --std=c++17" LDFLAGS="-stdlib=libc++ $5 -Wl,-dead_strip -lstdc++"

make -j$THREAD_COUNT
if [ ! $WITH_DATA_PACKAGING = "static" ]; then
cp stubdata/libicudata.a lib/
fi
popd
touch $ICU_VER_NAME-$1-$2-build.success
fi
Expand Down Expand Up @@ -102,9 +116,12 @@ if [ ! -f $ICU_BUILD_FOLDER.success ]; then
mkdir -p $INSTALL_DIR
fi

./runConfigureICU MacOSX --enable-static --disable-shared prefix=$INSTALL_DIR CXXFLAGS="--std=c++17"
./runConfigureICU MacOSX $COMMON_CONFIGURE_ARGS CXXFLAGS="--std=c++17"
make -j$THREAD_COUNT
make install
if [ ! $WITH_DATA_PACKAGING = "static" ]; then
cp stubdata/libicudata.a $INSTALL_DIR/lib/
fi
popd
touch $ICU_BUILD_FOLDER.success
fi
Expand All @@ -114,6 +131,7 @@ if [ -d $ICU_VER_NAME-macos-build ]; then
rm -rf $ICU_VER_NAME-macos-build
fi
mkdir -p $ICU_VER_NAME-macos-build/source/lib

lipo -create $INSTALL_DIR/lib/libicudata.a $ICU_VER_NAME-macos-$FOREIGN_ARC-build/source/lib/libicudata.a -output $ICU_VER_NAME-macos-build/source/lib/libicudata.a
lipo -create $INSTALL_DIR/lib/libicui18n.a $ICU_VER_NAME-macos-$FOREIGN_ARC-build/source/lib/libicui18n.a -output $ICU_VER_NAME-macos-build/source/lib/libicui18n.a
lipo -create $INSTALL_DIR/lib/libicuio.a $ICU_VER_NAME-macos-$FOREIGN_ARC-build/source/lib/libicuio.a -output $ICU_VER_NAME-macos-build/source/lib/libicuio.a
Expand Down

0 comments on commit a20b4c4

Please sign in to comment.