glibc: added locale-gen

This commit is contained in:
Tim Biermann 2022-02-13 21:54:18 +01:00
parent c776c651ff
commit a8a1b7dd6f
Signed by: tb
GPG Key ID: 42F8B4E30B673606
7 changed files with 98 additions and 16 deletions

View File

@ -4,6 +4,7 @@ drwxr-xr-x root/root etc/
-rw-r--r-- root/root etc/ld.so.cache
-rw-r--r-- root/root etc/ld.so.conf
drwxr-xr-x root/root etc/ld.so.conf.d/
-rw-r--r-- root/root etc/locale.gen
lrwxrwxrwx root/root etc/localtime -> ../usr/share/zoneinfo/UTC
-rw-r--r-- root/root etc/nscd.conf
-rw-r--r-- root/root etc/nsswitch.conf
@ -1859,6 +1860,7 @@ drwxr-xr-x root/root usr/lib/locale/C.UTF-8/LC_MESSAGES/
-rw-r--r-- root/root usr/lib/rcrt1.o
drwxr-xr-x root/root usr/sbin/
-rwxr-xr-x root/root usr/sbin/iconvconfig
-rwxr-xr-x root/root usr/sbin/locale-gen
-rwxr-xr-x root/root usr/sbin/nscd
drwxr-xr-x root/root usr/share/
drwxr-xr-x root/root usr/share/i18n/
@ -2454,6 +2456,8 @@ drwxr-xr-x root/root usr/share/i18n/locales/
-rw-r--r-- root/root usr/share/i18n/locales/zh_SG
-rw-r--r-- root/root usr/share/i18n/locales/zh_TW
-rw-r--r-- root/root usr/share/i18n/locales/zu_ZA
drwxr-xr-x root/root usr/share/locale/
-rw-r--r-- root/root usr/share/locale/locale.alias
drwxr-xr-x root/root var/
drwxr-xr-x root/root var/db/
-rw-r--r-- root/root var/db/Makefile

View File

@ -1,13 +1,14 @@
untrusted comment: verify with /etc/ports/core.pub
RWRJc1FUaeVeqjWPPxeevGovQrup+VoVzcLxZu8gpON1iTlcSLSk3dNu81k2202jhGoVP+nim0/ZHFD9bES0b1nefzemKa/Jxgw=
SHA256 (Pkgfile) = 06da1bd76b96c3f3bda5c14d14d73dbe804c247f4a405de3fb949f4a2d7b8374
SHA256 (.footprint) = 54fefcfc674ddf4d99e1bb529dbd0fa860e73945976fad18b9482ba454daa173
RWRJc1FUaeVeqmNr+q4edjlASjzn77bAGynex2pdWLDzrghEQu/e4h+RxvyRDx4bizz0cd6+hP3ScpoQKUsBJCoocRa+X+KtZAM=
SHA256 (Pkgfile) = 64f6796c8468cd5cadbccd231d5eee13ca9080b9cd9d7d6f41c26c7ba116dee6
SHA256 (.footprint) = 18acf8b44f896a471a6aa3dbae84067f21e7cd650f5489ca26fa6026441d9aa2
SHA256 (glibc-2.35.tar.xz) = 5123732f6b67ccd319305efd399971d58592122bcc2a6518a1bd2510dd0cf52e
SHA256 (linux-5.15.21.tar.xz) = 294eeb6cd7dc9b144c3c3c8b8c7b3fca9c6b072b6ed9bf9d6c922f9deb70fbd1
SHA256 (glibc-2.35-1.patch) = f9041b36bd2194753d43da1053320d58d75acc76cfdcc2bd13e502b247d90b4e
SHA256 (C.UTF-8.tar.xz) = b5d44bd1d704b273914ec1281b612778d10bc9b5e779e886e50371a525df5753
SHA256 (hosts) = 5c02b256c105f1d4a12fb738d71c1bab9eb126533074d7a0c8a14b92670c9431
SHA256 (resolv.conf) = 72ccb58768a72a771ec37142bc361a18478a07ec9de6e925a20760794389bf51
SHA256 (nsswitch.conf) = 859b8984e5e90aff3cce8f9779996ae4033b280d2122840e9411e2f44a1c2e61
SHA256 (host.conf) = 1bffc6575eb6204458758c34656cd44d87e7d89f545055f8857dd8906b7fb277
SHA256 (ld.so.conf) = 441a37924864b5b063208922ea04a926cd9654e74ed3f160b9d455b56d23387f
SHA256 (locale-gen) = 463c4137bd9c1ac7c15d3e5460e67e3826a4fbaeaf4cc53728d443d01f629936
SHA256 (locale.gen.in) = 30bf19ffeab9e5e0661636eb42cadc27335711c9a95148f55a30be0039c4d74a

Binary file not shown.

View File

@ -4,14 +4,14 @@
name=glibc
version=2.35
release=1
release=2
_kernel_version=5.15.21
source=(https://ftp.gnu.org/gnu/glibc/glibc-$version.tar.xz
https://www.kernel.org/pub/linux/kernel/v5.x/linux-$_kernel_version.tar.xz
glibc-$version-1.patch
C.UTF-8.tar.xz
hosts resolv.conf nsswitch.conf host.conf ld.so.conf)
hosts resolv.conf nsswitch.conf host.conf ld.so.conf
locale-gen locale.gen.in)
build() {
# install kernel headers
@ -24,7 +24,7 @@ build() {
mkdir $SRC/build
cd $SRC/build
$SRC/$name-${version}/configure \
$SRC/$name-$version/configure \
--prefix=/usr \
--libexecdir=/usr/lib \
--with-headers=$PKG/usr/include \
@ -50,19 +50,22 @@ build() {
install -d $PKG/etc/ld.so.conf.d $PKG/usr/lib/locale
touch $PKG/etc/ld.so.cache
# this doesn't work for some reason the generated locale is broken
# for now we supply the locale with the port
#$PKG/usr/bin/localedef \
# --force --quiet \
# --inputfile=$PKG/usr/share/i18n/locales/C \
# --charmap=$PKG/usr/share/charmaps/UTF-8 \
# $PKG/usr/lib/locale/C.UTF-8
install -Dm755 $SRC/locale-gen $PKG/usr/sbin/locale-gen
install -Dm644 $SRC/locale.gen.in $PKG/etc/locale.gen
cp -r $SRC/C.UTF-8 $PKG/usr/lib/locale
$PKG/usr/bin/localedef \
--force --quiet \
--inputfile POSIX \
--charmap UTF-8 \
$PKG/usr/lib/locale/C.UTF-8 || true
rm -r $PKG/usr/share/locale \
$PKG/usr/bin/{tzselect,zdump} \
$PKG/usr/sbin/zic
install -Dm644 $SRC/$name-$version/intl/locale.alias \
$PKG/usr/share/locale/locale.alias
find $PKG -name "*install.cmd" -delete
find $PKG -name ".\install" -delete
}

50
glibc/locale-gen Executable file
View File

@ -0,0 +1,50 @@
#!/bin/sh
set -e
LOCALEGEN=/etc/locale.gen
LOCALES=/usr/share/i18n/locales
[ -f "$LOCALEGEN" ] && [ -s "$LOCALEGEN" ] || exit 0;
# remove old locale-archive
[ -f /usr/lib/locale/locale-archive ] && rm -f /usr/lib/locale/locale-archive
umask 022
is_entry_ok() {
if [ -n "$locale" ] && [ -n "$charset" ] ; then
true
else
printf '%s' "error: Bad entry '$locale $charset'"
false
fi
}
printf '%s\n' "Generating locales..."
while read -r locale charset; do \
case "$locale" in
\#*|"") continue;;
esac; \
is_entry_ok || continue
printf '%s' "$(echo "$locale" | sed 's/\([^.\@]*\).*/\1/')"
printf '%s' ".$charset"
printf '%s' "$(echo "$locale" | sed 's/\([^\@]*\)\(\@.*\)*/\2/')"
printf '%s' "..."
if [ -f "$LOCALES/$locale" ]; then
input=$locale
else
input=$(echo "$locale" | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/')
fi
localedef -i "$input" -c -f "$charset" \
-A /usr/share/locale/locale.alias "$locale"
printf '%s\n' "done"
done < $LOCALEGEN
printf '%s\n' "Generation complete."

23
glibc/locale.gen.in Normal file
View File

@ -0,0 +1,23 @@
# list of locales that are to be generated by the locale-gen command.
#
# Each line is of the form:
#
# <locale> <charset>
#
# where <locale> is one of the locales given in /usr/share/i18n/locales
# and <charset> is one of the character sets listed in /usr/share/i18n/charmaps
#
# Examples:
# en_US ISO-8859-1
# en_US.UTF-8 UTF-8
# de_DE ISO-8859-1
# de_DE@euro ISO-8859-15
#
# The locale-gen command will generate all the locales,
# placing them in /usr/lib/locale.
#
# A list of supported locales is included in this file.
# Remove the comment marker "#" off the start of the line
# for the ones you need.

View File

@ -1,3 +1,4 @@
#!/bin/sh
/sbin/telinit U
/usr/sbin/locale-gen