2024-07-16 01:22:15 +02:00
{
lib ,
2025-04-10 19:10:11 +02:00
stdenv ,
2024-07-16 01:22:15 +02:00
buildPythonPackage ,
fetchFromGitHub ,
cmake ,
2025-04-10 19:10:11 +02:00
abseil-cpp ,
2025-05-06 20:20:11 +02:00
protobuf_29 ,
2024-07-16 01:22:15 +02:00
pybind11 ,
2025-04-10 19:10:11 +02:00
zlib ,
2024-07-16 01:22:15 +02:00
} :
buildPythonPackage {
pname = " p y b i n d 1 1 - p r o t o b u f " ;
2025-04-10 19:10:11 +02:00
version = " 0 - u n s t a b l e - 2 0 2 5 - 0 2 - 1 0 " ;
2024-07-16 01:22:15 +02:00
pyproject = false ;
src = fetchFromGitHub {
owner = " p y b i n d " ;
repo = " p y b i n d 1 1 _ p r o t o b u f " ;
2025-04-10 19:10:11 +02:00
rev = " f 0 2 a 2 b 7 6 5 3 b c 5 0 e b 5 1 1 9 d 1 2 5 8 4 2 a 3 8 7 0 d b 9 5 d 2 5 1 " ;
hash = " s h a 2 5 6 - j l Z c x Q K Y Y Y v T O G h k + 0 S g t e k 4 o K y 6 R 1 w D G i B O f 2 t + K i U = " ;
2024-07-16 01:22:15 +02:00
} ;
patches = [
2025-04-10 19:10:11 +02:00
# Rebase of the OpenSUSE patch: https://build.opensuse.org/projects/openSUSE:Factory/packages/pybind11_protobuf/files/0006-Add-install-target-for-CMake-builds.patch?expand=1
# on top of: https://github.com/pybind/pybind11_protobuf/pull/188/commits/5f0ac3d8c10cbb8b3b81063467c71085cd39624f
./add-install-target-for-cmake-builds.patch
2024-07-16 01:22:15 +02:00
] ;
nativeBuildInputs = [ cmake ] ;
buildInputs = [
2025-04-10 19:10:11 +02:00
abseil-cpp
2025-05-06 20:20:11 +02:00
protobuf_29
2024-07-16 01:22:15 +02:00
pybind11
2025-04-10 19:10:11 +02:00
zlib
2024-07-16 01:22:15 +02:00
] ;
2025-04-10 19:10:11 +02:00
cmakeFlags =
[
( lib . cmakeBool " U S E _ S Y S T E M _ A B S E I L " true )
( lib . cmakeBool " U S E _ S Y S T E M _ P R O T O B U F " true )
( lib . cmakeBool " U S E _ S Y S T E M _ P Y B I N D " true )
# The find_package calls are local to the dependencies subdirectory
( lib . cmakeBool " C M A K E _ F I N D _ P A C K A G E _ T A R G E T S _ G L O B A L " true )
]
++ lib . optionals stdenv . hostPlatform . isDarwin [
# Without it, Cmake prefers using Find-module which is mysteriously broken
# But the generated Config works
( lib . cmakeBool " C M A K E _ F I N D _ P A C K A G E _ P R E F E R _ C O N F I G " true )
] ;
2024-07-16 01:22:15 +02:00
meta = {
description = " P y b i n d 1 1 b i n d i n g s f o r G o o g l e ' s P r o t o c o l B u f f e r s " ;
homepage = " h t t p s : / / g i t h u b . c o m / p y b i n d / p y b i n d 1 1 _ p r o t o b u f " ;
license = lib . licenses . bsd3 ;
maintainers = with lib . maintainers ; [ wegank ] ;
} ;
}