Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 May 2024 19:19:09 +0200
From:      Antoine Brodin <antoine@freebsd.org>
To:        Daniel Engberg <daniel.engberg.lists@pyret.net>
Cc:        "Jason E. Hale" <jhale@freebsd.org>, ports-committers@freebsd.org,  dev-commits-ports-all@freebsd.org, dev-commits-ports-main@freebsd.org
Subject:   Re: git: bb5ef640ea2f - main - py-libxml2: Byte compile
Message-ID:  <CAALwa8ne-T%2Byf9KZOQC29p%2B1mGbnM7uEaUTvdacyCmmzevnkmg@mail.gmail.com>
In-Reply-To: <5901f7b88216d18c25dd00e3bf4646c4@mail.infomaniak.com>
References:  <202405170851.44H8pB4I015635@gitrepo.freebsd.org> <5901f7b88216d18c25dd00e3bf4646c4@mail.infomaniak.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, May 17, 2024 at 7:05=E2=80=AFPM Daniel Engberg
<daniel.engberg.lists@pyret.net> wrote:
> On 2024-05-17T10:51:11.000+02:00, Jason E. Hale <jhale@FreeBSD.org> wrote=
:
> >  The branch main has been updated by jhale:
> >
> > URL: https://cgit.FreeBSD.org/ports/commit/?id=3Dbb5ef640ea2f1756105b9f=
2aea44d85df600dd5e
> >
> > commit bb5ef640ea2f1756105b9f2aea44d85df600dd5e
> > Author:     Jason E. Hale <jhale@FreeBSD.org>
> > AuthorDate: 2024-05-17 07:51:35 +0000
> > Commit:     Jason E. Hale <jhale@FreeBSD.org>
> > CommitDate: 2024-05-17 08:51:04 +0000
> >
> >     py-libxml2: Byte compile
> >
> >     This eliminates annoying fs-violation errors, notably from
> >     textproc/itstool and textproc/gtk-doc where the byte code is genera=
ted
> >     at build time instead of already having been generated by py-libxml=
2.
> >
> >     It is still peculiar to me that these files are dumped directly int=
o
> >     PYTHON_SITELIBDIR and don't have a subdirectory of their own.
> >     Worth investigating, but hierachical changes are obviously more
> >     intrusive and beyond this scope.
> > ---
> >  textproc/libxml2/Makefile     |  6 ++++++
> >  textproc/py-libxml2/Makefile  | 17 ++++++-----------
> >  textproc/py-libxml2/pkg-plist |  7 +++++++
> >  3 files changed, 19 insertions(+), 11 deletions(-)
> >
> > diff --git a/textproc/libxml2/Makefile b/textproc/libxml2/Makefile
> > index e69bb22381d7..386af00928be 100644
> > --- a/textproc/libxml2/Makefile
> > +++ b/textproc/libxml2/Makefile
> > @@ -55,6 +55,12 @@ post-patch:
> >  post-install:
> >  .if defined(LIBXML2_SLAVE)
> >       ${STRIP_CMD} ${STAGEDIR}${PYTHON_LIBDIR}/site-packages/libxml2mod=
.so
> > +     ${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py \
> > +             -f -d ${PYTHONPREFIX_SITELIBDIR} \
> > +             ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
> > +     ${PYTHON_CMD} -O ${PYTHON_LIBDIR}/compileall.py \
> > +             -f -d ${PYTHONPREFIX_SITELIBDIR} \
> > +             ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
> >  .endif
> >
> >  .include <bsd.port.mk>;
> > diff --git a/textproc/py-libxml2/Makefile b/textproc/py-libxml2/Makefil=
e
> > index 33a8d506f52f..84796bac21b3 100644
> > --- a/textproc/py-libxml2/Makefile
> > +++ b/textproc/py-libxml2/Makefile
> > @@ -1,9 +1,8 @@
> > -PORTREVISION=3D        0
> > +PORTREVISION=3D        1
> >  CATEGORIES=3D  textproc gnome python
> >  PKGNAMEPREFIX=3D       ${PYTHON_PKGNAMEPREFIX}
> >
> >  COMMENT=3D     Python interface for XML parser library for GNOME
> > -MASTERDIR=3D   ${.CURDIR}/../libxml2
> >
> >  USES+=3D               gnome python shebangfix
> >  USE_GNOME=3D   libxml2
> > @@ -14,19 +13,15 @@ SHEBANG_FILES=3D    *.py doc/*.py python/*.py pytho=
n/tests/*.py
> >  # multiple versions are installed
> >  CMAKE_ARGS=3D  -DPython_EXECUTABLE=3D${PYTHON_CMD}
> >
> > -OPTIONS_EXCLUDE=3D     ${OPTIONS_DEFINE}
> > +MASTERDIR=3D   ${.CURDIR}/../libxml2
> >
> > -# Tell master port we're a slave port
> > -LIBXML2_SLAVE=3D       python
> > -# Grab pkg-descr from slave port
> >  DESCR=3D               ${.CURDIR}/pkg-descr
> > +PLIST=3D               ${.CURDIR}/pkg-plist
> >
> > -# Don't append pkg-plist from master port
> > -PLIST=3D
> > +OPTIONS_EXCLUDE=3D     ${OPTIONS_DEFINE}
> >
> > -PLIST_FILES=3D ${PYTHON_SITELIBDIR}/drv_libxml2.py \
> > -             ${PYTHON_SITELIBDIR}/libxml2.py \
> > -             ${PYTHON_SITELIBDIR}/libxml2mod.so
> > +# Tell master port we're a slave port
> > +LIBXML2_SLAVE=3D       python
> >
> >  do-install:
> >               ${MKDIR} ${STAGEDIR}${PYTHON_SITELIBDIR}
> > diff --git a/textproc/py-libxml2/pkg-plist b/textproc/py-libxml2/pkg-pl=
ist
> > new file mode 100644
> > index 000000000000..9cd0595dabe2
> > --- /dev/null
> > +++ b/textproc/py-libxml2/pkg-plist
> > @@ -0,0 +1,7 @@
> > +%%PYTHON_SITELIBDIR%%/__pycache__/drv_libxml2%%PYTHON_EXT_SUFFIX%%.opt=
-1.pyc
> > +%%PYTHON_SITELIBDIR%%/__pycache__/drv_libxml2%%PYTHON_EXT_SUFFIX%%.pyc
> > +%%PYTHON_SITELIBDIR%%/__pycache__/libxml2%%PYTHON_EXT_SUFFIX%%.opt-1.p=
yc
> > +%%PYTHON_SITELIBDIR%%/__pycache__/libxml2%%PYTHON_EXT_SUFFIX%%.pyc
> > +%%PYTHON_SITELIBDIR%%/drv_libxml2.py
> > +%%PYTHON_SITELIBDIR%%/libxml2.py
> > +%%PYTHON_SITELIBDIR%%/libxml2mod.so
>
> Hi,
>
> Wouldn't the correct solution to use the PYTHONDONTWRITEBYTECODE environm=
ent variable instead of packaging bytecode files which seems rather fragile=
?

This has been already discussed a lot and no.

Antoine



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAALwa8ne-T%2Byf9KZOQC29p%2B1mGbnM7uEaUTvdacyCmmzevnkmg>