Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] python3-pybind11: add symlinks to include, cmake, pkg-config dirs
@ 2023-05-21  1:21 chrysos349
  2023-05-21  1:26 ` classabbyamp
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: chrysos349 @ 2023-05-21  1:21 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 703 bytes --]

There is a new pull request by chrysos349 against master on the void-packages repository

https://github.com/chrysos349/void-packages python3-pybind11
https://github.com/void-linux/void-packages/pull/43981

python3-pybind11: add symlinks to include, cmake, pkg-config dirs
#### Testing the changes
- I tested the changes in this PR: **YES**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-LIBC)

#### Note
Before this change, cmake and pkg-config couldn't find the library.
P.S. I could've moved the dirs, but decided to play it safe, and create symlinks instead.

A patch file from https://github.com/void-linux/void-packages/pull/43981.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-python3-pybind11-43981.patch --]
[-- Type: text/x-diff, Size: 1326 bytes --]

From 917c7325ddb003fdccd06b35615d8d95c06bf04a Mon Sep 17 00:00:00 2001
From: chrysos349 <chrysostom349@gmail.com>
Date: Sun, 21 May 2023 04:12:33 +0300
Subject: [PATCH] python3-pybind11: add symlinks to include, cmake, pkg-config
 dirs

---
 srcpkgs/python3-pybind11/template | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/python3-pybind11/template b/srcpkgs/python3-pybind11/template
index 3aab06ec04a2..b1e4fcfe3df9 100644
--- a/srcpkgs/python3-pybind11/template
+++ b/srcpkgs/python3-pybind11/template
@@ -1,7 +1,7 @@
 # Template file for 'python3-pybind11'
 pkgname=python3-pybind11
 version=2.10.4
-revision=1
+revision=2
 build_style=python3-module
 hostmakedepends="cmake python3-setuptools
  python3-pytest python3-sphinx_rtd_theme python3-breathe"
@@ -48,4 +48,15 @@ post_install() {
 	_manpage=docs/.build/man/pybind11.1
 	vsed -i ${_manpage} -e '/^\.TH/ s/"1"/"7"/'
 	vman ${_manpage} pybind11.7
+
+	vmkdir /usr/include
+	vmkdir /usr/share/pkgconfig
+	vmkdir /usr/share/cmake
+
+	ln -s /${py3_sitelib}/pybind11/include/pybind11 \
+		${DESTDIR}/usr/include/pybind11
+	ln -s /${py3_sitelib}/pybind11/share/cmake/pybind11 \
+		${DESTDIR}/usr/share/cmake/pybind11
+	ln -s /${py3_sitelib}/pybind11/share/pkgconfig/pybind11.pc \
+		${DESTDIR}/usr/share/pkgconfig/pybind11.pc
 }

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: python3-pybind11: add symlinks to include, cmake, pkg-config dirs
  2023-05-21  1:21 [PR PATCH] python3-pybind11: add symlinks to include, cmake, pkg-config dirs chrysos349
@ 2023-05-21  1:26 ` classabbyamp
  2023-05-21  1:54 ` chrysos349
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: classabbyamp @ 2023-05-21  1:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 336 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/43981#issuecomment-1556058510

Comment:
> Before this change, cmake and pkg-config couldn't find the library.

generally you can do something like `-Dpybind11_DIR=${XBPS_CROSS_BASE}/${py3_sitelib}/pybind11/share/cmake/pybind11`

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: python3-pybind11: add symlinks to include, cmake, pkg-config dirs
  2023-05-21  1:21 [PR PATCH] python3-pybind11: add symlinks to include, cmake, pkg-config dirs chrysos349
  2023-05-21  1:26 ` classabbyamp
@ 2023-05-21  1:54 ` chrysos349
  2023-05-25 18:30 ` ahesford
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: chrysos349 @ 2023-05-21  1:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 248 bytes --]

New comment by chrysos349 on void-packages repository

https://github.com/void-linux/void-packages/pull/43981#issuecomment-1556061524

Comment:
@classabbyamp thanks for the piece of advice! I'm still learning the ins and outs of creating packages.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: python3-pybind11: add symlinks to include, cmake, pkg-config dirs
  2023-05-21  1:21 [PR PATCH] python3-pybind11: add symlinks to include, cmake, pkg-config dirs chrysos349
  2023-05-21  1:26 ` classabbyamp
  2023-05-21  1:54 ` chrysos349
@ 2023-05-25 18:30 ` ahesford
  2023-05-26 14:34 ` chrysos349
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ahesford @ 2023-05-25 18:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 711 bytes --]

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/43981#issuecomment-1563333481

Comment:
When you touch packages that are actively maintained, please tag the maintainer, especially if you are proposing structural changes to the package.

I'm on the fence about this change. On the one hand, it emulates the behavior of the `pybind11-global` package that upstream distributes. On the other, it should generally be unnecessary if you properly configure the build environment to look for the CMake and pkg-config files where they are actually installed.

Moving the directories would have been the wrong choice, because that would break the Python package.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: python3-pybind11: add symlinks to include, cmake, pkg-config dirs
  2023-05-21  1:21 [PR PATCH] python3-pybind11: add symlinks to include, cmake, pkg-config dirs chrysos349
                   ` (2 preceding siblings ...)
  2023-05-25 18:30 ` ahesford
@ 2023-05-26 14:34 ` chrysos349
  2023-05-26 15:28 ` ahesford
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: chrysos349 @ 2023-05-26 14:34 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 653 bytes --]

New comment by chrysos349 on void-packages repository

https://github.com/void-linux/void-packages/pull/43981#issuecomment-1564489928

Comment:
> When you touch packages that are actively maintained, please tag the maintainer, especially if you are proposing structural changes to the package.

@ahesford Will do next time.

> it should generally be unnecessary if you properly configure the build environment to look for the CMake and pkg-config files where they are actually installed.

I'd rather not do any extra steps like adding `-Dpybind11_DIR=${XBPS_CROSS_BASE}/${py3_sitelib}/pybind11/share/cmake/pybind11`. This seems like a workaround.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: python3-pybind11: add symlinks to include, cmake, pkg-config dirs
  2023-05-21  1:21 [PR PATCH] python3-pybind11: add symlinks to include, cmake, pkg-config dirs chrysos349
                   ` (3 preceding siblings ...)
  2023-05-26 14:34 ` chrysos349
@ 2023-05-26 15:28 ` ahesford
  2023-05-26 16:03 ` chrysos349
  2023-05-26 16:03 ` [PR PATCH] [Closed]: " chrysos349
  6 siblings, 0 replies; 8+ messages in thread
From: ahesford @ 2023-05-26 15:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 690 bytes --]

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/43981#issuecomment-1564561865

Comment:
Why are you using `xbps-src` variables like `${XBPS_CROSS_BASE}` and `${py3_sitelib}`? Is there some Void template that is not building properly?

"I'd rather not do any extra steps" isn't a sufficient reason for moving the complexity into the Void package; if upstream decides to move things around in the future, the symlinks we create could easily be broken without going noticed. The `pybind11-global` package is a bit different because they provide a proper setup script to copy files from a location they know exists into the system paths.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: python3-pybind11: add symlinks to include, cmake, pkg-config dirs
  2023-05-21  1:21 [PR PATCH] python3-pybind11: add symlinks to include, cmake, pkg-config dirs chrysos349
                   ` (4 preceding siblings ...)
  2023-05-26 15:28 ` ahesford
@ 2023-05-26 16:03 ` chrysos349
  2023-05-26 16:03 ` [PR PATCH] [Closed]: " chrysos349
  6 siblings, 0 replies; 8+ messages in thread
From: chrysos349 @ 2023-05-26 16:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1382 bytes --]

New comment by chrysos349 on void-packages repository

https://github.com/void-linux/void-packages/pull/43981#issuecomment-1564609864

Comment:
> Why are you using `xbps-src` variables like `${XBPS_CROSS_BASE}` and `${py3_sitelib}`?

That's what @classabbyamp suggested above (https://github.com/void-linux/void-packages/pull/43981#issuecomment-1556058510).

`-Dpybind11_DIR=${XBPS_CROSS_BASE}/${py3_sitelib}/pybind11/share/cmake/pybind11` is used in `gnuradio` templates.

>  Is there some Void template that is not building properly?

No, there's not. I created a template for `audiotube`. cmake couldn't find `pybind11Config.cmake`. So I modified `python3-pybind11`'s template, and recompiled it. I didn't know I could've defined `-Dpybind11_DIR`.

BTW, it turns out there's already a pr for `audiotube` - #37569. At least I learnt something while building it.

> "I'd rather not do any extra steps" isn't a sufficient reason for moving the complexity into the Void package; if upstream decides to move things around in the future, the symlinks we create could easily be broken without going noticed. The `pybind11-global` package is a bit different because they provide a proper setup script to copy files from a location they know exists into the system paths.

Well then, I'm not gonna complicate things any longer. PR closed. Thanks for your valuable feedback.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PR PATCH] [Closed]: python3-pybind11: add symlinks to include, cmake, pkg-config dirs
  2023-05-21  1:21 [PR PATCH] python3-pybind11: add symlinks to include, cmake, pkg-config dirs chrysos349
                   ` (5 preceding siblings ...)
  2023-05-26 16:03 ` chrysos349
@ 2023-05-26 16:03 ` chrysos349
  6 siblings, 0 replies; 8+ messages in thread
From: chrysos349 @ 2023-05-26 16:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 537 bytes --]

There's a closed pull request on the void-packages repository

python3-pybind11: add symlinks to include, cmake, pkg-config dirs
https://github.com/void-linux/void-packages/pull/43981

Description:
#### Testing the changes
- I tested the changes in this PR: **YES**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-LIBC)

#### Note
Before this change, cmake and pkg-config couldn't find the library.
P.S. I could've moved the dirs, but decided to play it safe, and create symlinks instead.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-05-26 16:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-21  1:21 [PR PATCH] python3-pybind11: add symlinks to include, cmake, pkg-config dirs chrysos349
2023-05-21  1:26 ` classabbyamp
2023-05-21  1:54 ` chrysos349
2023-05-25 18:30 ` ahesford
2023-05-26 14:34 ` chrysos349
2023-05-26 15:28 ` ahesford
2023-05-26 16:03 ` chrysos349
2023-05-26 16:03 ` [PR PATCH] [Closed]: " chrysos349

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).