From: Peter Seiderer <ps.report@gmx.net>
To: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
Cc: Asaf Kahlon <asafka7@gmail.com>,
Lionel Flandrin <lionel@svkt.org>,
"Yann E. MORIN" <yann.morin.1998@free.fr>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [Buildroot] [RFC v1] package/python-babel: add purge locale data support
Date: Tue, 1 Aug 2023 09:59:54 +0200 [thread overview]
Message-ID: <20230801095954.1f25440f@gmx.net> (raw)
In-Reply-To: <20230801000735.4f6608d2@windsurf>
Hello Thomas, *,
On Tue, 1 Aug 2023 00:07:35 +0200, Thomas Petazzoni via buildroot <buildroot@buildroot.org> wrote:
> On Tue, 18 Apr 2023 23:32:41 +0200
> Peter Seiderer <ps.report@gmx.net> wrote:
>
> > Add purge loacle data support (inspired by BR2_ENABLE_LOCALE_PURGE
> > handling in Makefile) to reduce target space allocation by the
> > python-babel package, e.g. from 32MB to 24K for
> > target/usr/lib/python3.11/site-packages/babel/locale-data with
> > BR2_ENABLE_LOCALE_WHITELIST="C en_US de_DE".
>
> I updated the commit log to add the explanation about en_US_POSIX, as
> requested by Yann.
>
> >
> > Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> > ---
> > package/python-babel/python-babel.mk | 12 ++++++++++++
> > 1 file changed, 12 insertions(+)
> >
> > diff --git a/package/python-babel/python-babel.mk b/package/python-babel/python-babel.mk
> > index 890a8b02b9..ea383e9c05 100644
> > --- a/package/python-babel/python-babel.mk
> > +++ b/package/python-babel/python-babel.mk
> > @@ -12,5 +12,17 @@ PYTHON_BABEL_LICENSE = BSD-3-Clause
> > PYTHON_BABEL_LICENSE_FILES = LICENSE
> > HOST_PYTHON_BABEL_DEPENDENCIES = host-python-pytz
> >
> > +# purge locale data (if enabled), keep special en_US_POSIX data by default
> > +ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
> > +define PYTHON_BABEL_CLEANUP_LOCALE
> > + for i in `ls $(TARGET_DIR)/usr/lib/python3.11/site-packages/babel/locale-data/*.dat`; \
>
> The hardcoded 3.11 was not good, it would break at the next major bump
> of Python, replace with $(PYTHON3_VERSION_MAJOR).
>
> > + do \
> > + i_base=`basename "$$i" .dat`; \
> > + echo "$(BR2_ENABLE_LOCALE_WHITELIST) en_US_POSIX" | grep -qw "$$i_base" || rm "$$i"; \
> > + done
> > +endef
> > +endif
> > +PYTHON_BABEL_POST_INSTALL_TARGET_HOOKS += PYTHON_BABEL_CLEANUP_LOCALE
>
> Changed to PYTHON_LABEL_TARGET_FINALIZE_HOOKS, as suggested by Yann,
> and moved inside the ifeq ... endif block.
>
> Applied with those changes.
>
> Thanks a lot!
Seems I missed to send an updated (non RFC) version, many thanks for
fixing and applying....
Regards,
Peter
>
> Thomas
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
prev parent reply other threads:[~2023-08-01 8:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-18 21:32 [Buildroot] [RFC v1] package/python-babel: add purge locale data support Peter Seiderer
2023-05-15 19:57 ` Yann E. MORIN
2023-05-15 20:49 ` Peter Seiderer
2023-05-15 20:57 ` Yann E. MORIN
2023-07-31 22:07 ` Thomas Petazzoni via buildroot
2023-08-01 7:59 ` Peter Seiderer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230801095954.1f25440f@gmx.net \
--to=ps.report@gmx.net \
--cc=asafka7@gmail.com \
--cc=buildroot@buildroot.org \
--cc=lionel@svkt.org \
--cc=thomas.petazzoni@bootlin.com \
--cc=yann.morin.1998@free.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox