Unverified Commit 5d07912c authored by Pavol Rusnak's avatar Pavol Rusnak
Browse files

python3Packages.pyobjc-framework-CoreBluetooth: init at 11.1

parent 747d686d
Loading
Loading
Loading
Loading
+66 −0
Original line number Diff line number Diff line
{
  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 ];
  };
}
+4 −0
Original line number Diff line number Diff line
@@ -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 { };