Skip to content

Commit 32d48a8

Browse files
chapterjasonclaude
andcommitted
Install upstream ICU for current CLDR/emoji data
JetBrains' bundled JBR fails to load without a modern libicu; Debian trixie ships libicu76, while upstream is at 78.3 with newer CLDR, IANA tz, and Unicode/emoji data. The new scripts/icu/install.sh extracts upstream's Ubuntu22.04 prebuilt into /usr/local, which shadows the distro libicu via ld.so. Also adds pkg-config to the baseline. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 386b99e commit 32d48a8

2 files changed

Lines changed: 45 additions & 1 deletion

File tree

scripts/icu/install.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/usr/bin/env bash
2+
# ICU installer. Extracts upstream's Ubuntu22.04 prebuilt into /usr/local so
3+
# JetBrains' bundled JBR, .NET, Node intl, etc. pick up a current libicu
4+
# with fresh CLDR + IANA tz + Unicode/emoji data.
5+
#
6+
# Ubuntu22.04 binaries run on Debian trixie: glibc and libstdc++ are
7+
# forward-compatible, and trixie's toolchain is newer than Ubuntu 22.04's.
8+
# x86_64 only — upstream ships no arm64 prebuilt.
9+
# https://github.com/unicode-org/icu
10+
set -euo pipefail
11+
12+
ICU_VERSION="${VERSION:-latest}"
13+
14+
if [ "$ICU_VERSION" = "latest" ]; then
15+
TAG="$(curl -fsSL https://api.github.com/repos/unicode-org/icu/releases/latest \
16+
| sed -n 's/^.*"tag_name": *"\([^"]*\)".*$/\1/p')"
17+
ICU_VERSION="${TAG#release-}"
18+
fi
19+
20+
ARCH="$(uname -m)"
21+
if [ "$ARCH" != "x86_64" ]; then
22+
echo "icu: no upstream prebuilt for $ARCH (only x86_64). Install from source or use Debian's libicu." >&2
23+
exit 1
24+
fi
25+
26+
TAG="release-${ICU_VERSION}"
27+
FILE="icu4c-${ICU_VERSION}-Ubuntu22.04-x64.tgz"
28+
29+
TMPDIR="$(mktemp -d)"
30+
trap 'rm -rf "$TMPDIR"' EXIT
31+
32+
curl -fsSL -o "$TMPDIR/icu.tgz" \
33+
"https://github.com/unicode-org/icu/releases/download/${TAG}/${FILE}"
34+
35+
# Tarball layout: icu/usr/local/{bin,lib,include,share}/... — strip the
36+
# leading `icu/` and drop the rest onto the root filesystem.
37+
tar -xzf "$TMPDIR/icu.tgz" -C / --strip-components=1
38+
39+
# /usr/local/lib isn't on Debian's default ld.so search path — drop a conf
40+
# snippet so the dynamic linker finds the new libicu*.so.
41+
echo "/usr/local/lib" > /etc/ld.so.conf.d/usr-local.conf
42+
ldconfig

src/base/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ RUN apt-get update && \
3131
bash build-essential ca-certificates containerd.io curl docker-ce docker-ce-cli \
3232
docker-buildx-plugin docker-compose-plugin dtach file git gnupg \
3333
htop iproute2 iputils-ping jq less locales lsb-release lsof \
34-
man-db openssh-client pipx procps python3 python3-pip rsync strace \
34+
man-db openssh-client pipx pkg-config procps python3 python3-pip rsync strace \
3535
sudo systemd systemd-sysv tar tree unzip vim wget && \
3636
rm -rf /var/lib/apt/lists/*
3737

@@ -85,6 +85,8 @@ RUN --mount=type=bind,source=scripts/context-mode,target=/scripts/context-mode \
8585
bash /scripts/context-mode/install.sh
8686
RUN --mount=type=bind,source=scripts/home-persist,target=/scripts/home-persist \
8787
bash /scripts/home-persist/install.sh
88+
RUN --mount=type=bind,source=scripts/icu,target=/scripts/icu \
89+
bash /scripts/icu/install.sh
8890
RUN --mount=type=bind,source=scripts/jetbrains,target=/scripts/jetbrains \
8991
bash /scripts/jetbrains/install.sh
9092

0 commit comments

Comments
 (0)