From 15fd26619edfa264c029344b005ccbe03ed1cf88 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Tue, 16 Jul 2024 01:22:03 +0200 Subject: [PATCH] python312Packages.pybind11-abseil: init at 202402.0 --- .../pybind11-abseil/default.nix | 60 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 62 insertions(+) create mode 100644 pkgs/development/python-modules/pybind11-abseil/default.nix diff --git a/pkgs/development/python-modules/pybind11-abseil/default.nix b/pkgs/development/python-modules/pybind11-abseil/default.nix new file mode 100644 index 000000000000..de497d6eec18 --- /dev/null +++ b/pkgs/development/python-modules/pybind11-abseil/default.nix @@ -0,0 +1,60 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + fetchpatch, + cmake, + abseil-cpp, + pybind11, + python, +}: + +buildPythonPackage rec { + pname = "pybind11-abseil"; + version = "202402.0"; + pyproject = false; + + src = fetchFromGitHub { + owner = "pybind"; + repo = "pybind11_abseil"; + rev = "v${version}"; + hash = "sha256-hFVuGzEFqAEm2p2RmfhFtLB6qOqNuVNcwcLh8dIWi0k="; + }; + + patches = [ + (fetchpatch { + name = "pybind11_abseil.patch"; + url = "https://build.opensuse.org/public/source/openSUSE:Factory/pybind11-abseil/pybind11_abseil.patch?rev=2"; + hash = "sha256-zwxCIhYMvexdSUmKM22OMBMEo0NRDgMtSVMDySFCn6U="; + }) + (fetchpatch { + name = "use-system-packages-if-possible.patch"; + url = "https://build.opensuse.org/public/source/openSUSE:Factory/pybind11-abseil/use-system-packages-if-possible.patch?rev=2"; + hash = "sha256-CLHOSni2ej6ICtvMtBoCIpR9CNPPibwIS+hYbOCAwBE="; + }) + (fetchpatch { + name = "0001-Install-headers-and-CMake-development-files.patch"; + url = "https://build.opensuse.org/public/source/openSUSE:Factory/pybind11-abseil/0001-Install-headers-and-CMake-development-files.patch?rev=2"; + hash = "sha256-TU9AzvF83aROY4gwys2ITOcdtjEm4x2IbhX4cHNWp0M="; + }) + ]; + + nativeBuildInputs = [ cmake ]; + + buildInputs = [ + abseil-cpp + pybind11 + ]; + + cmakeFlags = [ + (lib.cmakeFeature "CMAKE_INSTALL_PYDIR" "${placeholder "out"}/${python.sitePackages}") + (lib.cmakeFeature "Python_EXECUTABLE" python.interpreter) + ]; + + meta = { + description = "Pybind11 bindings for the Abseil C++ Common Libraries"; + homepage = "https://github.com/pybind/pybind11_abseil"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ wegank ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 91c1643f8a60..2e21198bb84d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11750,6 +11750,8 @@ self: super: with self; { pybind11 = callPackage ../development/python-modules/pybind11 { }; + pybind11-abseil = callPackage ../development/python-modules/pybind11-abseil { }; + pybind11-stubgen = callPackage ../development/python-modules/pybind11-stubgen { }; pybindgen = callPackage ../development/python-modules/pybindgen { };