Skip to content

Commit 8a4b47d

Browse files
committed
python3Packages.pyobjc-core: init at 11.0
1 parent 8c9ee72 commit 8a4b47d

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
buildPythonPackage,
3+
darwin,
4+
fetchFromGitHub,
5+
lib,
6+
setuptools,
7+
}:
8+
9+
buildPythonPackage rec {
10+
pname = "pyobjc-core";
11+
version = "11.0";
12+
pyproject = true;
13+
14+
src = fetchFromGitHub {
15+
owner = "ronaldoussoren";
16+
repo = "pyobjc";
17+
tag = "v${version}";
18+
hash = "sha256-RhB0Ht6vyDxYwDGS+A9HZL9ySIjWlhdB4S+gHxvQQBg=";
19+
};
20+
21+
sourceRoot = "source/pyobjc-core";
22+
23+
build-system = [ setuptools ];
24+
25+
buildInputs = [
26+
darwin.DarwinTools
27+
darwin.libffi
28+
];
29+
30+
nativeBuildInputs = [
31+
darwin.DarwinTools # sw_vers
32+
];
33+
34+
# See https://github.com/ronaldoussoren/pyobjc/pull/641. Unfortunately, we
35+
# cannot just pull that diff with fetchpatch due to https://discourse.nixos.org/t/how-to-apply-patches-with-sourceroot/59727.
36+
postPatch = ''
37+
for file in Modules/objc/test/*.m; do
38+
substituteInPlace "$file" --replace "[[clang::suppress]]" ""
39+
done
40+
41+
substituteInPlace setup.py \
42+
--replace-fail "-buildversion" "-buildVersion" \
43+
--replace-fail "-productversion" "-productVersion"
44+
'';
45+
46+
env.NIX_CFLAGS_COMPILE = toString [
47+
"-I${darwin.libffi.dev}/include"
48+
"-Wno-error=cast-function-type-mismatch"
49+
"-Wno-error=unused-command-line-argument"
50+
];
51+
52+
pythonImportsCheck = [ "objc" ];
53+
54+
meta = with lib; {
55+
description = "Python <-> Objective-C bridge";
56+
homepage = "https://github.com/ronaldoussoren/pyobjc";
57+
license = licenses.mit;
58+
platforms = platforms.darwin;
59+
maintainers = with maintainers; [ samuela ];
60+
};
61+
}

pkgs/top-level/python-packages.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12317,6 +12317,8 @@ self: super: with self; {
1231712317

1231812318
pyobihai = callPackage ../development/python-modules/pyobihai { };
1231912319

12320+
pyobjc-core = callPackage ../development/python-modules/pyobjc-core { };
12321+
1232012322
pyocd = callPackage ../development/python-modules/pyocd { };
1232112323

1232212324
pyocd-pemicro = callPackage ../development/python-modules/pyocd-pemicro { };

0 commit comments

Comments
 (0)