mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-13 19:43:02 +08:00
67 lines
1.5 KiB
Nix
67 lines
1.5 KiB
Nix
{
|
|
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 ];
|
|
};
|
|
}
|