From 5d07912ccc39c331cc4b5fe6aad57cb06d24d7b7 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Tue, 28 Oct 2025 19:01:09 +0100 Subject: [PATCH] python3Packages.pyobjc-framework-CoreBluetooth: init at 11.1 --- .../default.nix | 66 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 4 ++ 2 files changed, 70 insertions(+) create mode 100644 pkgs/development/python-modules/pyobjc-framework-CoreBluetooth/default.nix diff --git a/pkgs/development/python-modules/pyobjc-framework-CoreBluetooth/default.nix b/pkgs/development/python-modules/pyobjc-framework-CoreBluetooth/default.nix new file mode 100644 index 000000000000..ac702d1d3160 --- /dev/null +++ b/pkgs/development/python-modules/pyobjc-framework-CoreBluetooth/default.nix @@ -0,0 +1,66 @@ +{ + buildPythonPackage, + darwin, + fetchFromGitHub, + lib, + pyobjc-core, + pyobjc-framework-Cocoa, + setuptools, + unittestCheckHook, +}: + +buildPythonPackage rec { + pname = "pyobjc-framework-CoreBluetooth"; + pyproject = true; + + inherit (pyobjc-core) version src; + + patches = pyobjc-core.patches or [ ]; + + sourceRoot = "${src.name}/pyobjc-framework-CoreBluetooth"; + + build-system = [ setuptools ]; + + buildInputs = [ + darwin.libffi + ]; + + nativeBuildInputs = [ + darwin.DarwinTools # sw_vers + ]; + + nativeCheckInputs = [ + unittestCheckHook + ]; + + # See https://github.com/ronaldoussoren/pyobjc/pull/641. Unfortunately, we + # cannot just pull that diff with fetchpatch due to https://discourse.nixos.org/t/how-to-apply-patches-with-sourceroot/59727. + postPatch = '' + substituteInPlace pyobjc_setup.py \ + --replace-fail "-buildversion" "-buildVersion" \ + --replace-fail "-productversion" "-productVersion" \ + --replace-fail "/usr/bin/" "" + ''; + + dependencies = [ + pyobjc-core + pyobjc-framework-Cocoa + ]; + + env.NIX_CFLAGS_COMPILE = toString [ + "-I${lib.getDev darwin.libffi}/include" + "-Wno-error=unused-command-line-argument" + ]; + + pythonImportsCheck = [ + "CoreBluetooth" + ]; + + meta = { + description = "PyObjC wrappers for the CoreBluetooth framework on macOS"; + homepage = "https://github.com/ronaldoussoren/pyobjc/tree/main/pyobjc-framework-CoreBluetooth"; + license = lib.licenses.mit; + platforms = lib.platforms.darwin; + maintainers = with lib.maintainers; [ prusnak ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index eb44f2fd32d3..8e1584f3185e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -13944,6 +13944,10 @@ self: super: with self; { pyobjc-framework-Cocoa = callPackage ../development/python-modules/pyobjc-framework-Cocoa { }; + pyobjc-framework-CoreBluetooth = + callPackage ../development/python-modules/pyobjc-framework-CoreBluetooth + { }; + pyobjc-framework-Quartz = callPackage ../development/python-modules/pyobjc-framework-Quartz { }; pyobjc-framework-Security = callPackage ../development/python-modules/pyobjc-framework-Security { };