Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] glibc: clean up install, add C.UTF-8 by default
@ 2024-03-06 13:55 ahesford
  2024-03-06 15:44 ` [PR PATCH] [Updated] " ahesford
                   ` (24 more replies)
  0 siblings, 25 replies; 26+ messages in thread
From: ahesford @ 2024-03-06 13:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1438 bytes --]

There is a new pull request by ahesford against master on the void-packages repository

https://github.com/ahesford/void-packages library-policeman
https://github.com/void-linux/void-packages/pull/49146

glibc: clean up install, add C.UTF-8 by default
We should really provide the `C.UTF-8` locale by default. I believe that the best way to do so is by removing it entirely from `/etc/default/libc-locales` processing and install it, as part of the main `glibc` package, in `/usr/lib/locales` like Arch does.

This currently trips the package linter, so either
- We can make an exception for glibc in the linter, or
- Rather than include the locale files in the package, we can add an `INSTALL` script to the base package to write the `C.utf-8` locale outside of an archive, where it will always be reachable.

I favor the first because it is less wasteful; why should everybody have to generate a locale that we expect everybody to have available by default?

A third option is to modify the `glibc-locales` `INSTALL` script to either add a separate, non-archived `C.utf-8` locale directory, or just ensure that `C.UTF-8` is always included in the locale processing. Both seem even more kludgey than doing the right thing by default.

Thoughts? @void-linux/pkg-committers 

While I was at it, I cleaned up the install function a bit.

A patch file from https://github.com/void-linux/void-packages/pull/49146.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-library-policeman-49146.patch --]
[-- Type: text/x-diff, Size: 2473 bytes --]

From 09993187b3538ce8cfc97bf416b5e0a4774713b4 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Wed, 6 Mar 2024 08:46:43 -0500
Subject: [PATCH] glibc: clean up install, add C.UTF-8 by default

---
 srcpkgs/glibc/template | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index abd2ad846c9de1..6dd21a2837c428 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,7 +1,7 @@
 # Template file for 'glibc'
 pkgname=glibc
 version=2.38
-revision=5
+revision=6
 bootstrap=yes
 short_desc="GNU C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -123,23 +123,27 @@ do_build() {
 	env LDFLAGS.so="-Wl,--hash-style=both" LDFLAGS-rtld="-Wl,--hash-style=both" \
 		make ${makejobs}
 }
+
 do_install() {
 	vlicense LICENSES
 	# Create DESTDIR/etc/ld.so.conf
 	mkdir -p ${DESTDIR}/etc
 	echo "include /etc/ld.so.conf.d/*.conf" > ${DESTDIR}/etc/ld.so.conf
 
-	cd build
-	make install_root=${DESTDIR} install
+	( cd build && make install_root=${DESTDIR} install )
+
+	# The C.UTF-8 locale should always be available
+	make -C localedata objdir="../build" \
+		DESTDIR="${DESTDIR}" install-files-C.UTF-8/UTF-8
 
 	# create /etc/default/libc-locales
 	vinstall ${FILESDIR}/libc-locales 644 etc/default
-	cp ${wrksrc}/localedata/SUPPORTED ${wrksrc}/build
-	sed -i	-e "s|/| |g" \
+	sed -e "s|/| |g" \
 		-e 's|\\| |g' \
 		-e "s|SUPPORTED-LOCALES=||" \
-		-e "s|^|#|g" ${wrksrc}/build/SUPPORTED
-	cat ${wrksrc}/build/SUPPORTED >> ${DESTDIR}/etc/default/libc-locales
+		-e "s|^|#|g" \
+		-e "/#C\.UTF-8 /d" localedata/SUPPORTED \
+			>> "${DESTDIR}/etc/default/libc-locales"
 
 	# ldd is a bash script, so make it run as such.
 	replace_interpreter bash ${DESTDIR}/usr/bin/ldd
@@ -162,7 +166,7 @@ do_install() {
 		armv?l) ln -sfr ${DESTDIR}/usr/lib/ld-linux-armhf.so.3 ${DESTDIR}/usr/lib/ld-linux.so.3;;
 	esac
 
-	vinstall ${wrksrc}/posix/gai.conf 644 etc
+	vinstall posix/gai.conf 644 etc
 	rm -rf ${DESTDIR}/var/db
 	# Remove tzselect and z{dump,ic}, provided by tzutils.
 	rm -f ${DESTDIR}/usr/bin/tzselect
@@ -185,6 +189,7 @@ glibc-devel_package() {
 		fi
 	}
 }
+
 glibc-locales_package() {
 	conf_files="/etc/default/libc-locales"
 	short_desc+=" - locale data files"
@@ -194,6 +199,7 @@ glibc-locales_package() {
 		vmove usr/share/locale
 	}
 }
+
 nscd_package() {
 	conf_files="/etc/nscd.conf"
 	short_desc+=" - Name Service Cache Daemon"

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2024-03-13 10:46 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-06 13:55 [PR PATCH] glibc: clean up install, add C.UTF-8 by default ahesford
2024-03-06 15:44 ` [PR PATCH] [Updated] " ahesford
2024-03-06 15:45 ` ahesford
2024-03-06 16:04 ` [PR PATCH] [Updated] " ahesford
2024-03-06 20:10 ` oreo639
2024-03-06 20:10 ` oreo639
2024-03-06 20:11 ` oreo639
2024-03-06 20:20 ` oreo639
2024-03-06 20:45 ` oreo639
2024-03-06 20:46 ` oreo639
2024-03-06 20:46 ` oreo639
2024-03-06 23:24 ` oreo639
2024-03-06 23:27 ` [PR REVIEW] " oreo639
2024-03-06 23:37 ` oreo639
2024-03-06 23:37 ` oreo639
2024-03-06 23:37 ` oreo639
2024-03-06 23:37 ` oreo639
2024-03-06 23:38 ` oreo639
2024-03-07  0:49 ` [PR PATCH] [Updated] " ahesford
2024-03-07  0:50 ` ahesford
2024-03-07 21:56 ` oreo639
2024-03-07 21:57 ` oreo639
2024-03-07 21:58 ` oreo639
2024-03-07 21:59 ` ahesford
2024-03-07 21:59 ` oreo639
2024-03-13 10:46 ` [PR PATCH] [Merged]: " ahesford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).