You are not logged in.

#1 2025-12-11 03:34:17

Samueru
Member
Registered: 2023-07-03
Posts: 44

[SOLVED] Trying to make a smaller icu package

https://github.com/unicode-org/icu/blob … ation-file

Apparently I need to set `ICU_DATA_FILTER_FILE` to a json file that contains what to filter.

So using the archlinux PKGBUILD: https://gitlab.archlinux.org/archlinux/ … ckages/icu

I made this change to it

diff --git a/PKGBUILD b/PKGBUILD
index 094a1ae..f9fa505 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -31,6 +31,8 @@ prepare() {
 }

 build() {
+  export ICU_DATA_FILTER_FILE="$(readlink -f ../../filter.json)"
+  cat "$ICU_DATA_FILTER_FILE"
   cd icu/source
   ./configure --prefix=/usr \
        --sysconfdir=/etc \

And added the following filter.json:

{
  "localeFilter":  {
    "filterType": "language",
    "includelist": [
      "en"
    ]
  }
}

However after building the package libicudata.so is still +30 MiB so I don't know what I'm doing wrong, I also noticed someone else ran into this issue already: https://stackoverflow.com/questions/763 … udata-size

Last edited by Samueru (2025-12-12 04:28:40)

Offline

#2 2025-12-11 20:27:29

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 71,519

Re: [SOLVED] Trying to make a smaller icu package

-  cat "$ICU_DATA_FILTER_FILE"
+ stat "$ICU_DATA_FILTER_FILE"
+ sleep 10

Does your file resolution actually yield the correct path?

Offline

#3 2025-12-12 02:04:59

Samueru
Member
Registered: 2023-07-03
Posts: 44

Re: [SOLVED] Trying to make a smaller icu package

seth wrote:
-  cat "$ICU_DATA_FILTER_FILE"
+ stat "$ICU_DATA_FILTER_FILE"
+ sleep 10

Does your file resolution actually yield the correct path?

Yes, and I originally added a sleep 5 to make sure as well.

If the file didn't exist cat would fail and stop the build.

EDIT: I just noticed the original path I added was a bit wrong, because what I was doing was cloning the repo and then copying the `filter.json` that I had ready into the icu directory.

but anyways it is still a valid path.

Last edited by Samueru (2025-12-12 02:10:32)

Offline

#4 2025-12-12 04:27:42

Samueru
Member
Registered: 2023-07-03
Posts: 44

Re: [SOLVED] Trying to make a smaller icu package

Alright found the solution. Turns out alpine linux does this already: https://gitlab.alpinelinux.org/alpine/a … KBUILD#L59

I need to remove the `icu/source/data` directory and replace it with a separate zip they release for the variable to take effect. xd

They also have their own filter which is nice, the resulting libicudata is now less than 3 MiB in size.

Last edited by Samueru (2025-12-12 04:28:02)

Offline

#5 2025-12-12 08:30:12

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 71,519

Re: [SOLVED] Trying to make a smaller icu package

You might want to raise this at https://gitlab.archlinux.org/archlinux/ … u/-/issues since the size difference is actually ridiculous (afaiu the small data archive contains the 23 most relevant languages and probably covers 95% of the world and 99.9% of archlinux users)

Offline

Board footer

Powered by FluxBB