Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 May 2024 19:05:36 +0200
From:      Daniel Engberg <daniel.engberg.lists@pyret.net>
To:        "Jason E. Hale" <jhale@FreeBSD.org>
Cc:        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:  <5901f7b88216d18c25dd00e3bf4646c4@mail.infomaniak.com>
In-Reply-To: <202405170851.44H8pB4I015635@gitrepo.freebsd.org>
References:  <202405170851.44H8pB4I015635@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2024-05-17T10:51:11.000+02:00, Jason E. Hale <jhale@FreeBSD.org> wrote:
>  The branch main has been updated by jhale:
>=20
> URL: https://cgit.FreeBSD.org/ports/commit/?id=3Dbb5ef640ea2f1756105b9f2a=
ea44d85df600dd5e
>=20
> 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
>=20
>     py-libxml2: Byte compile
>    =20
>     This eliminates annoying fs-violation errors, notably from
>     textproc/itstool and textproc/gtk-doc where the byte code is generate=
d
>     at build time instead of already having been generated by py-libxml2.
>    =20
>     It is still peculiar to me that these files are dumped directly into
>     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(-)
>=20
> 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)
>  =09${STRIP_CMD} ${STAGEDIR}${PYTHON_LIBDIR}/site-packages/libxml2mod.so
> +=09${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py \
> +=09=09-f -d ${PYTHONPREFIX_SITELIBDIR} \
> +=09=09${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
> +=09${PYTHON_CMD} -O ${PYTHON_LIBDIR}/compileall.py \
> +=09=09-f -d ${PYTHONPREFIX_SITELIBDIR} \
> +=09=09${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
>  .endif
> =20
>  .include <bsd.port.mk>;
> diff --git a/textproc/py-libxml2/Makefile b/textproc/py-libxml2/Makefile
> index 33a8d506f52f..84796bac21b3 100644
> --- a/textproc/py-libxml2/Makefile
> +++ b/textproc/py-libxml2/Makefile
> @@ -1,9 +1,8 @@
> -PORTREVISION=3D=090
> +PORTREVISION=3D=091
>  CATEGORIES=3D=09textproc gnome python
>  PKGNAMEPREFIX=3D=09${PYTHON_PKGNAMEPREFIX}
> =20
>  COMMENT=3D=09Python interface for XML parser library for GNOME
> -MASTERDIR=3D=09${.CURDIR}/../libxml2
> =20
>  USES+=3D=09=09gnome python shebangfix
>  USE_GNOME=3D=09libxml2
> @@ -14,19 +13,15 @@ SHEBANG_FILES=3D=09*.py doc/*.py python/*.py python/t=
ests/*.py
>  # multiple versions are installed
>  CMAKE_ARGS=3D=09-DPython_EXECUTABLE=3D${PYTHON_CMD}
> =20
> -OPTIONS_EXCLUDE=3D=09${OPTIONS_DEFINE}
> +MASTERDIR=3D=09${.CURDIR}/../libxml2
> =20
> -# Tell master port we're a slave port
> -LIBXML2_SLAVE=3D=09python
> -# Grab pkg-descr from slave port
>  DESCR=3D=09=09${.CURDIR}/pkg-descr
> +PLIST=3D=09=09${.CURDIR}/pkg-plist
> =20
> -# Don't append pkg-plist from master port
> -PLIST=3D
> +OPTIONS_EXCLUDE=3D=09${OPTIONS_DEFINE}
> =20
> -PLIST_FILES=3D=09${PYTHON_SITELIBDIR}/drv_libxml2.py \
> -=09=09${PYTHON_SITELIBDIR}/libxml2.py \
> -=09=09${PYTHON_SITELIBDIR}/libxml2mod.so
> +# Tell master port we're a slave port
> +LIBXML2_SLAVE=3D=09python
> =20
>  do-install:
>  =09=09${MKDIR} ${STAGEDIR}${PYTHON_SITELIBDIR}
> diff --git a/textproc/py-libxml2/pkg-plist b/textproc/py-libxml2/pkg-plis=
t
> 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.pyc
> +%%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 environmen=
t variable instead of packaging bytecode files which seems rather fragile?

Best regards,
Daniel



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5901f7b88216d18c25dd00e3bf4646c4>