Skip to content

Commit b00b6c5

Browse files
authored
python3Packages.rumps: init at unstable-2025-02-02 (#378992)
2 parents 4b3d86c + f4305e6 commit b00b6c5

File tree

4 files changed

+159
-0
lines changed

4 files changed

+159
-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+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
buildPythonPackage,
3+
darwin,
4+
fetchFromGitHub,
5+
lib,
6+
pyobjc-core,
7+
setuptools,
8+
}:
9+
10+
buildPythonPackage rec {
11+
pname = "pyobjc-framework-Cocoa";
12+
version = "11.0";
13+
pyproject = true;
14+
15+
src = fetchFromGitHub {
16+
owner = "ronaldoussoren";
17+
repo = "pyobjc";
18+
tag = "v${version}";
19+
hash = "sha256-RhB0Ht6vyDxYwDGS+A9HZL9ySIjWlhdB4S+gHxvQQBg=";
20+
};
21+
22+
sourceRoot = "source/pyobjc-framework-Cocoa";
23+
24+
build-system = [ setuptools ];
25+
26+
buildInputs = [
27+
darwin.libffi
28+
darwin.DarwinTools
29+
];
30+
31+
nativeBuildInputs = [
32+
darwin.DarwinTools # sw_vers
33+
];
34+
35+
# See https://github.com/ronaldoussoren/pyobjc/pull/641. Unfortunately, we
36+
# cannot just pull that diff with fetchpatch due to https://discourse.nixos.org/t/how-to-apply-patches-with-sourceroot/59727.
37+
postPatch = ''
38+
substituteInPlace pyobjc_setup.py \
39+
--replace-fail "-buildversion" "-buildVersion" \
40+
--replace-fail "-productversion" "-productVersion"
41+
'';
42+
43+
dependencies = [ pyobjc-core ];
44+
45+
env.NIX_CFLAGS_COMPILE = toString [
46+
"-I${darwin.libffi.dev}/include"
47+
"-Wno-error=unused-command-line-argument"
48+
];
49+
50+
pythonImportsCheck = [ "Cocoa" ];
51+
52+
meta = with lib; {
53+
description = "PyObjC wrappers for the Cocoa frameworks on macOS";
54+
homepage = "https://github.com/ronaldoussoren/pyobjc";
55+
license = licenses.mit;
56+
platforms = platforms.darwin;
57+
maintainers = with maintainers; [ samuela ];
58+
};
59+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
buildPythonPackage,
3+
fetchFromGitHub,
4+
lib,
5+
pyobjc-framework-Cocoa,
6+
setuptools,
7+
}:
8+
9+
buildPythonPackage rec {
10+
pname = "rumps";
11+
version = "unstable-2025-02-02";
12+
pyproject = true;
13+
14+
src = fetchFromGitHub {
15+
owner = "jaredks";
16+
repo = "rumps";
17+
rev = "8730e7cff5768dfabecff478c0d5e3688862c1c6";
18+
hash = "sha256-oNJBpRaCGyOKCgBueRx4YhpNW1OnbIEWEEvlGfyoxUA=";
19+
};
20+
21+
build-system = [ setuptools ];
22+
dependencies = [ pyobjc-framework-Cocoa ];
23+
24+
pythonImportsCheck = [ "rumps" ];
25+
26+
meta = with lib; {
27+
description = "Ridiculously Uncomplicated macOS Python Statusbar apps";
28+
homepage = "https://github.com/jaredks/rumps";
29+
license = licenses.bsd2;
30+
platforms = platforms.darwin;
31+
maintainers = with maintainers; [ samuela ];
32+
};
33+
}

pkgs/top-level/python-packages.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12383,6 +12383,10 @@ self: super: with self; {
1238312383

1238412384
pyobihai = callPackage ../development/python-modules/pyobihai { };
1238512385

12386+
pyobjc-core = callPackage ../development/python-modules/pyobjc-core { };
12387+
12388+
pyobjc-framework-Cocoa = callPackage ../development/python-modules/pyobjc-framework-Cocoa { };
12389+
1238612390
pyocd = callPackage ../development/python-modules/pyocd { };
1238712391

1238812392
pyocd-pemicro = callPackage ../development/python-modules/pyocd-pemicro { };
@@ -14507,6 +14511,8 @@ self: super: with self; {
1450714511

1450814512
rules = callPackage ../development/python-modules/rules { };
1450914513

14514+
rumps = callPackage ../development/python-modules/rumps { };
14515+
1451014516
runs = callPackage ../development/python-modules/runs { };
1451114517

1451214518
runstats = callPackage ../development/python-modules/runstats { };

0 commit comments

Comments
 (0)