try to use glibc-locales instead of locale-gen

shaves at least 10 minutes off the build time while only costing about
20 mib when installed (even less when compressed)
This commit is contained in:
Harald Sitter
2025-04-15 15:01:27 +02:00
parent 65a4e7553a
commit b022c819d7
2 changed files with 1 additions and 21 deletions

View File

@@ -5,6 +5,7 @@
Packages=archlinux-keyring
base
btrfs-progs
glibc-locales # instead of running locale-gen as part of our build we install a package that has all locales pre-generated
kernel-modules-hook
kmod
linux

View File

@@ -1,21 +0,0 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
# SPDX-FileCopyrightText: 2025 Harald Sitter <sitter@kde.org>
set -ex
if [ "$1" = "final" ]; then
# Generate all locales. Because /usr/lib is not writable in the target system we need to ship all locales pre-generated.
# Sucks. But oh well.
# We can at least limit to UTF-8 variants because nobody uses the rest and Qt doesn't even work with them.
grep UTF-8 /usr/share/i18n/SUPPORTED > /etc/locale.gen
# Also allow overriding the list by setting a LOCALE_GEN environment variable
# in mkosi.local.conf or command line parameters for local builds
if [ -n "$LOCALE_GEN" ]; then
echo "$LOCALE_GEN" > /etc/locale.gen
fi
locale-gen
fi