tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: un-self-conficting python packages for non-default python



Am Tue, 19 Dec 2023 14:16:40 +0100
schrieb Thomas Klausner <wiz%gatalith.at@localhost>:

> > It's simply $PREFIX/bin/pybind11-config here. It can do this:
> > 
> > usage: pybind11-config [-h] [--includes] [--cmakedir]
> > 
> > optional arguments:
> >   -h, --help  show this help message and exit
> >   --includes  Include flags for both pybind11 and Python headers.
> >   --cmakedir  Print the CMake module directory, ideal for setting -Dpybind11_ROOT in CMake.
> > 
> > I'd assume matplotlib doesn't care about using this, as some
> > Python+CMake magic takes care of this (just deducing the paths). Who
> > would even miss this script?  
> 
> Only one way to find out :) Rename it, build all packages depending on
> it and fix what breaks.

Would the attached patch be fine to include during freeze to resolve
the self-conflict of py-pybind11?

I checked the dependencies that don't pull in rust. Everything python
has no issue, but graphics/py-contourpy uses meson which falls back to
the config script, hence I have the buildlink3.mk provide the symlink
to it. With that it builds just fine. The name of the config script is
not that easily changeable, as it is hardcoded in meson (in its
site-packages).

Is the patch OK like that? 


Alrighty then,

Thomas

-- 
Dr. Thomas Orgis
HPC @ Universität Hamburg
Index: ALTERNATIVES
===================================================================
RCS file: ALTERNATIVES
diff -N ALTERNATIVES
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ALTERNATIVES	26 Dec 2023 17:21:29 -0000
@@ -0,0 +1 @@
+bin/pybind11-config @PREFIX@/bin/pybind11-config-@PYVERSSUFFIX@
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/devel/py-pybind11/Makefile,v
retrieving revision 1.17
diff -u -r1.17 Makefile
--- Makefile	17 Jul 2023 19:08:10 -0000	1.17
+++ Makefile	26 Dec 2023 17:21:29 -0000
@@ -1,6 +1,7 @@
 # $NetBSD: Makefile,v 1.17 2023/07/17 19:08:10 adam Exp $
 
 DISTNAME=	pybind11-2.11.1
+PATCHLEVEL=	1
 PKGNAME=	${PYPKGPREFIX}-${DISTNAME}
 CATEGORIES=	devel python
 MASTER_SITES=	${MASTER_SITE_PYPI:=p/pybind11/}
@@ -12,7 +13,11 @@
 
 USE_LANGUAGES=	# none
 
-PYTHON_SELF_CONFLICT=	yes
+.include "../../lang/python/pyversion.mk"
+
+post-install:
+	cd ${DESTDIR}${PREFIX}/bin && \
+	${MV} pybind11-config pybind11-config-${PYVERSSUFFIX} || ${TRUE}
 
 USE_PKG_RESOURCES=	yes
 
Index: PLIST
===================================================================
RCS file: /cvsroot/pkgsrc/devel/py-pybind11/PLIST,v
retrieving revision 1.7
diff -u -r1.7 PLIST
--- PLIST	17 Jul 2023 19:08:10 -0000	1.7
+++ PLIST	26 Dec 2023 17:21:29 -0000
@@ -1,5 +1,5 @@
 @comment $NetBSD: PLIST,v 1.7 2023/07/17 19:08:10 adam Exp $
-bin/pybind11-config
+bin/pybind11-config-${PYVERSSUFFIX}
 ${PYSITELIB}/${EGG_INFODIR}/PKG-INFO
 ${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt
 ${PYSITELIB}/${EGG_INFODIR}/dependency_links.txt
Index: buildlink3.mk
===================================================================
RCS file: /cvsroot/pkgsrc/devel/py-pybind11/buildlink3.mk,v
retrieving revision 1.3
diff -u -r1.3 buildlink3.mk
--- buildlink3.mk	29 Nov 2023 10:53:11 -0000	1.3
+++ buildlink3.mk	26 Dec 2023 17:21:29 -0000
@@ -10,6 +10,9 @@
 PYTHON_FOR_BUILD_ONLY?=		yes
 .include "../../lang/python/pyversion.mk"
 
+pre-configure:
+	${LN} -sf ${PREFIX}/bin/pybind11-config-${PYVERSSUFFIX} ${BUILDLINK_DIR}/bin/pybind11-config
+
 BUILDLINK_API_DEPENDS.py-pybind11+=	${PYPKGPREFIX}-pybind11>=2.5.0
 BUILDLINK_PKGSRCDIR.py-pybind11?=	../../devel/py-pybind11
 BUILDLINK_DEPMETHOD.py-pybind11?=	build


Home | Main Index | Thread Index | Old Index