guix_mirror_bot pushed a commit to branch python-team
in repository guix.
commit c9fb00d55db9fc29e8e69cfb6fa039658de0231c
Author: Danny Milosavljevic <[email protected]>
AuthorDate: Sat Mar 7 14:40:34 2026 +0100
gnu: Add [email protected].
* gnu/packages/python-xyz.scm (pybind11-2.13): New variable.
(pybind11): New variable.
Change-Id: Ic9d627b51c3f8b0e5ff3b1b2cf5fd43a677435b1
---
gnu/packages/python-xyz.scm | 98 ++++++++++++++++++++++++---------------------
1 file changed, 53 insertions(+), 45 deletions(-)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index c0058f1394..08eae1c55c 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -26722,51 +26722,7 @@ commit, but it also includes some other useful
statistics.")
binding is created using the standard @code{ctypes} library.")
(license license:isc)))
-(define-public pybind11-2
- (package
- (name "pybind11")
- (version "3.0.1")
- (source
- (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/pybind/pybind11")
- (commit (string-append "v" version))))
- (file-name (git-file-name name version))
- (sha256
- (base32 "1gpax61ndhbr1r179bbgavh50j3aylkddzvbklhyj51mq4d0sb36"))))
- (build-system pyproject-build-system)
- (arguments
- (list
- #:tests? #f ; Tests require building C++ test modules
- #:phases
- #~(modify-phases %standard-phases
- (add-after 'install 'install-cmake-files
- ;; scikit-build-core installs cmake config files inside
- ;; site-packages/pybind11/share/cmake/, but cmake's find_package()
- ;; expects them under share/cmake/.
- (lambda _
- (let ((site (string-append #$output "/lib/python"
- #$(version-major+minor
- (package-version python))
- "/site-packages")))
- (with-directory-excursion (string-append site "/pybind11")
- (copy-recursively "include" (string-append #$output
"/include"))
- (copy-recursively "share" (string-append #$output
"/share")))))))))
- (native-inputs
- (list python-scikit-build-core-bootstrap
- python-wrapper))
- (home-page "https://github.com/pybind/pybind11/")
- (synopsis "Seamless operability between C++11 and Python")
- (description
- "@code{pybind11} is a lightweight header-only library that exposes C++
-types in Python and vice versa, mainly to create Python bindings of existing
-C++ code. Its goals and syntax are similar to the @code{Boost.Python}
-library: to minimize boilerplate code in traditional extension modules by
-inferring type information using compile-time introspection.")
- (license license:bsd-3)))
-
-(define-public pybind11
+(define-public pybind11-3
(package
(name "pybind11")
(version "3.0.2")
@@ -26818,6 +26774,58 @@ library: to minimize boilerplate code in traditional
extension modules by
inferring type information using compile-time introspection.")
(license license:bsd-3)))
+(define-public pybind11-2.13
+ (package
+ (inherit pybind11-3)
+ (name "pybind11")
+ (version "2.13.6")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/pybind/pybind11")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1dbnki0pnky39kr04afd9ks597bzjc530zbk33jjss53nfvdvlj8"))))
+ (arguments
+ (list
+ #:configure-flags
+ #~(list (string-append "-DCATCH_INCLUDE_DIR="
+ (assoc-ref %build-inputs "catch2")
+ "/include/catch"))
+ #:modules '((guix build cmake-build-system)
+ ((guix build gnu-build-system) #:prefix gnu:)
+ (guix build utils))
+ #:phases
+ #~(modify-phases %standard-phases
+ (replace 'check
+ (lambda args
+ (apply (assoc-ref gnu:%standard-phases 'check) args)))
+ (add-after 'install 'install-python
+ (lambda _
+ (with-directory-excursion "../source"
+ (setenv "PYBIND11_USE_CMAKE" "yes")
+ (invoke "python" "setup.py" "install"
+ "--single-version-externally-managed"
+ "--root=/"
+ (string-append "--prefix=" #$output))))))))
+ (inputs '())
+ (native-inputs
+ (list catch2-1
+ eigen
+ python-pytest
+ python-setuptools
+ python-wrapper))))
+
+;; Temporary compatibility alias for existing users of the 2.x package.
+(define-public pybind11-2
+ pybind11-2.13)
+
+;; Keep 2.13 as the default until more packages are compatible with 3.x.
+(define-public pybind11
+ pybind11-2.13)
+
(define-public python-pooch
(package
(name "python-pooch")