logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git
commit: b841dc1ccdcb00d235bc0c74bb02baf45ef4895b
parent adf5c6408b580082807cd7c9d3deab78c9cbb0a2
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sat, 25 May 2024 00:21:03 +0200

sys-devel/gettext: Drop M4 patch, add serial + install -D patches

Diffstat:

Asys-devel/gettext/files/gettext-0.3.2-autopoint_mkdir.patch41+++++++++++++++++++++++++++++++++++++++++
Asys-devel/gettext/files/gettext-0.3.2-autopoint_serial.patch40++++++++++++++++++++++++++++++++++++++++
Dsys-devel/gettext/gettext-0.3.2-r4.ebuild60------------------------------------------------------------
Asys-devel/gettext/gettext-0.3.2-r5.ebuild61+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 142 insertions(+), 60 deletions(-)

diff --git a/sys-devel/gettext/files/gettext-0.3.2-autopoint_mkdir.patch b/sys-devel/gettext/files/gettext-0.3.2-autopoint_mkdir.patch @@ -0,0 +1,41 @@ +From b756522f75009e01f79804bba1d1866434446faf Mon Sep 17 00:00:00 2001 +From: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me> +Date: Fri, 24 May 2024 23:45:19 +0200 +Subject: [PATCH 2/2] autopoint.in: Use `mkdir -p` instead of `install -D` + +Unlike BusyBox, coreutils, and OpenBSD where `install -D` takes no argument, +in NetBSD and FreeBSD `install -D` takes a `destdir` argument. + +I picked `mkdir -p` in preference of `install -d` simply because mkdir is a defined standard. +--- + src/autopoint.in | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/src/autopoint.in b/src/autopoint.in +index c88e1c9..ef44810 100755 +--- a/src/autopoint.in ++++ b/src/autopoint.in +@@ -35,15 +35,17 @@ do + if [ "${line##*po/Makefile.in}" != "$line" ]; then + poprefix="${line##*'['}" + poprefix="${poprefix%%po/Makefile.in*}" +- install -D -m 644 @datadir@/data/autopoint_Makefile.in "./${poprefix}/po/Makefile.in.in" ++ mkdir -p "./${poprefix}/po" ++ install -m 644 @datadir@/data/autopoint_Makefile.in "./${poprefix}/po/Makefile.in.in" + fi + done < "configure.ac" + + touch "./${dirprefix}/config.rpath" ABOUT-NLS + ++mkdir -p intl po + for i in intl/Makefile.in po/Makefile.in.in ; do +- install -D -m 644 @datadir@/data/autopoint_Makefile.in "$i" ++ install -m 644 @datadir@/data/autopoint_Makefile.in "$i" + done + +-install -D -m 644 @datadir@/data/Makevars.template po/Makevars.template ++install -m 644 @datadir@/data/Makevars.template po/Makevars.template + true +-- +2.44.1 + diff --git a/sys-devel/gettext/files/gettext-0.3.2-autopoint_serial.patch b/sys-devel/gettext/files/gettext-0.3.2-autopoint_serial.patch @@ -0,0 +1,40 @@ +From 3407c90cacb976838b174b661f49f7565f77c5e5 Mon Sep 17 00:00:00 2001 +From: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me> +Date: Fri, 24 May 2024 23:41:10 +0200 +Subject: [PATCH] autopoint.in: Skip overwriting on >= serial at destination + +Closes: https://github.com/sabotage-linux/gettext-tiny/issues/63 +--- + src/autopoint.in | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/src/autopoint.in b/src/autopoint.in +index fd00afd..c88e1c9 100755 +--- a/src/autopoint.in ++++ b/src/autopoint.in +@@ -1,6 +1,10 @@ + #!/bin/sh + m4src=@datadir@/m4 + ++get_m4_serial() { ++ sed -n -e '/^#.* serial /s;^#.* serial \([^ ]*\).*;\1;p' "$@" ++} ++ + if ! test -e configure.ac ; then + echo "$0: error: configure.ac not found" >&2 + exit 1 +@@ -8,6 +12,14 @@ fi + + mkdir -p m4 intl po + for i in $m4src/*.m4 ; do ++ dest="m4/$(basename "$i")" ++ if test -f "$dest"; then ++ serial_dest="$(get_m4_serial "$dest")" ++ serial_gettext="$(get_m4_serial "$i")" ++ ++ test "$serial_dest" -ge "$serial_gettext" && continue ++ fi ++ + cp -f $i m4/ + done + diff --git a/sys-devel/gettext/gettext-0.3.2-r4.ebuild b/sys-devel/gettext/gettext-0.3.2-r4.ebuild @@ -1,60 +0,0 @@ -# Copyright 2022-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -inherit toolchain-funcs multilib-minimal - -DESCRIPTION="Stub and/or lightweight replacements of the GNU gettext suite" -HOMEPAGE="https://github.com/sabotage-linux/gettext-tiny" -SRC_URI="https://github.com/sabotage-linux/gettext-tiny/archive/refs/tags/v${PV}.tar.gz -> gettext-tiny-${PV}.tar.gz" -S="${WORKDIR}/gettext-tiny-${PV}/" - -LICENSE="MIT" -SLOT="tiny" -KEYWORDS="~amd64" -IUSE="shim" - -RDEPEND="!sys-devel/gettext:0" - -PATCHES=( - "${FILESDIR}"/gettext-0.3.2-respect-CFLAGS.patch - "${FILESDIR}"/gettext-0.3.2-xgettext-version-output.patch - "${FILESDIR}"/gettext-0.3.2-autopoint-parenthesis.patch - "${FILESDIR}"/gettext-0.3.2-m4_cleanup.patch -) - -DOCS=( README.md docs ) - -src_prepare() { - default - - # Needs to be set early, otherwise scripts like autopoint have a wrong prefix value - sed -i "s;^prefix=.*;prefix=${EPREFIX}/usr;" Makefile || die - - multilib_copy_sources -} - -multilib_src_compile() { - tc-export AR RANLIB CC - - emake -} - -multilib_src_install() { - local libintl_type - - if use shim ; then - if use elibc_musl ; then - libintl_type=MUSL - else - libintl_type=NOOP - fi - else - # If they don't want the shim (e.g. glibc users who have their own libintl), - # don't install a libintl and just install the binaries. - libintl_type=NONE - fi - - emake LIBINTL="${libintl_type}" DESTDIR="${D}" libdir="${EPREFIX}/usr/$(get_libdir)" install -} diff --git a/sys-devel/gettext/gettext-0.3.2-r5.ebuild b/sys-devel/gettext/gettext-0.3.2-r5.ebuild @@ -0,0 +1,61 @@ +# Copyright 2022-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit toolchain-funcs multilib-minimal + +DESCRIPTION="Stub and/or lightweight replacements of the GNU gettext suite" +HOMEPAGE="https://github.com/sabotage-linux/gettext-tiny" +SRC_URI="https://github.com/sabotage-linux/gettext-tiny/archive/refs/tags/v${PV}.tar.gz -> gettext-tiny-${PV}.tar.gz" +S="${WORKDIR}/gettext-tiny-${PV}/" + +LICENSE="MIT" +SLOT="tiny" +KEYWORDS="~amd64" +IUSE="shim" + +RDEPEND="!sys-devel/gettext:0" + +PATCHES=( + "${FILESDIR}"/gettext-0.3.2-respect-CFLAGS.patch + "${FILESDIR}"/gettext-0.3.2-xgettext-version-output.patch + "${FILESDIR}"/gettext-0.3.2-autopoint-parenthesis.patch + "${FILESDIR}"/gettext-0.3.2-autopoint_serial.patch + "${FILESDIR}"/gettext-0.3.2-autopoint_mkdir.patch +) + +DOCS=( README.md docs ) + +src_prepare() { + default + + # Needs to be set early, otherwise scripts like autopoint have a wrong prefix value + sed -i "s;^prefix=.*;prefix=${EPREFIX}/usr;" Makefile || die + + multilib_copy_sources +} + +multilib_src_compile() { + tc-export AR RANLIB CC + + emake +} + +multilib_src_install() { + local libintl_type + + if use shim ; then + if use elibc_musl ; then + libintl_type=MUSL + else + libintl_type=NOOP + fi + else + # If they don't want the shim (e.g. glibc users who have their own libintl), + # don't install a libintl and just install the binaries. + libintl_type=NONE + fi + + emake LIBINTL="${libintl_type}" DESTDIR="${D}" libdir="${EPREFIX}/usr/$(get_libdir)" install +}