diff --git a/pkgs/development/python-modules/pyobjc-framework-Quartz/default.nix b/pkgs/development/python-modules/pyobjc-framework-Quartz/default.nix new file mode 100644 index 000000000000..0c238cbb69d0 --- /dev/null +++ b/pkgs/development/python-modules/pyobjc-framework-Quartz/default.nix @@ -0,0 +1,65 @@ +{ + buildPythonPackage, + fetchFromGitHub, + setuptools, + darwin, + pyobjc-core, + pyobjc-framework-Cocoa, + lib, +}: + +buildPythonPackage rec { + pname = "pyobjc-framework-Quartz"; + version = "11.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "ronaldoussoren"; + repo = "pyobjc"; + tag = "v${version}"; + hash = "sha256-2qPGJ/1hXf3k8AqVLr02fVIM9ziVG9NMrm3hN1de1Us="; + }; + + sourceRoot = "${src.name}/pyobjc-framework-Quartz"; + + build-system = [ setuptools ]; + + buildInputs = [ darwin.libffi ]; + + nativeBuildInputs = [ + darwin.DarwinTools # sw_vers + ]; + + # 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/sw_vers" "sw_vers" \ + --replace-fail "/usr/bin/xcrun" "xcrun" + ''; + + dependencies = [ + pyobjc-core + pyobjc-framework-Cocoa + ]; + + env.NIX_CFLAGS_COMPILE = toString [ + "-I${darwin.libffi.dev}/include" + "-Wno-error=unused-command-line-argument" + ]; + + pythonImportsCheck = [ + "Quartz" + "PyObjCTools" + ]; + + meta = { + description = "PyObjC wrappers for the Quartz frameworks on macOS"; + homepage = "https://github.com/ronaldoussoren/pyobjc"; + license = lib.licenses.mit; + platforms = lib.platforms.darwin; + maintainers = with lib.maintainers; [ xyenon ]; + }; +} diff --git a/pkgs/development/python-modules/pyobjc-framework-Security/default.nix b/pkgs/development/python-modules/pyobjc-framework-Security/default.nix new file mode 100644 index 000000000000..8209ff78bd8d --- /dev/null +++ b/pkgs/development/python-modules/pyobjc-framework-Security/default.nix @@ -0,0 +1,65 @@ +{ + buildPythonPackage, + fetchFromGitHub, + setuptools, + darwin, + pyobjc-core, + pyobjc-framework-Cocoa, + lib, +}: + +buildPythonPackage rec { + pname = "pyobjc-framework-Security"; + version = "11.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "ronaldoussoren"; + repo = "pyobjc"; + tag = "v${version}"; + hash = "sha256-2qPGJ/1hXf3k8AqVLr02fVIM9ziVG9NMrm3hN1de1Us="; + }; + + sourceRoot = "${src.name}/pyobjc-framework-Security"; + + build-system = [ setuptools ]; + + buildInputs = [ darwin.libffi ]; + + nativeBuildInputs = [ + darwin.DarwinTools # sw_vers + ]; + + # 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/sw_vers" "sw_vers" \ + --replace-fail "/usr/bin/xcrun" "xcrun" + ''; + + dependencies = [ + pyobjc-core + pyobjc-framework-Cocoa + ]; + + env.NIX_CFLAGS_COMPILE = toString [ + "-I${darwin.libffi.dev}/include" + "-Wno-error=unused-command-line-argument" + ]; + + pythonImportsCheck = [ + "Security" + "PyObjCTools" + ]; + + meta = { + description = "PyObjC wrappers for the Security frameworks on macOS"; + homepage = "https://github.com/ronaldoussoren/pyobjc"; + license = lib.licenses.mit; + platforms = lib.platforms.darwin; + maintainers = with lib.maintainers; [ xyenon ]; + }; +} diff --git a/pkgs/development/python-modules/pyobjc-framework-WebKit/default.nix b/pkgs/development/python-modules/pyobjc-framework-WebKit/default.nix new file mode 100644 index 000000000000..9e466395e469 --- /dev/null +++ b/pkgs/development/python-modules/pyobjc-framework-WebKit/default.nix @@ -0,0 +1,66 @@ +{ + buildPythonPackage, + fetchFromGitHub, + setuptools, + darwin, + pyobjc-core, + pyobjc-framework-Cocoa, + lib, +}: + +buildPythonPackage rec { + pname = "pyobjc-framework-WebKit"; + version = "11.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "ronaldoussoren"; + repo = "pyobjc"; + tag = "v${version}"; + hash = "sha256-2qPGJ/1hXf3k8AqVLr02fVIM9ziVG9NMrm3hN1de1Us="; + }; + + sourceRoot = "${src.name}/pyobjc-framework-WebKit"; + + build-system = [ setuptools ]; + + buildInputs = [ darwin.libffi ]; + + nativeBuildInputs = [ + darwin.DarwinTools # sw_vers + ]; + + # 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/sw_vers" "sw_vers" \ + --replace-fail "/usr/bin/xcrun" "xcrun" + ''; + + dependencies = [ + pyobjc-core + pyobjc-framework-Cocoa + ]; + + env.NIX_CFLAGS_COMPILE = toString [ + "-I${darwin.libffi.dev}/include" + "-Wno-error=unused-command-line-argument" + ]; + + pythonImportsCheck = [ + "WebKit" + "JavaScriptCore" + "PyObjCTools" + ]; + + meta = { + description = "PyObjC wrappers for the WebKit frameworks on macOS"; + homepage = "https://github.com/ronaldoussoren/pyobjc"; + license = lib.licenses.mit; + platforms = lib.platforms.darwin; + maintainers = with lib.maintainers; [ xyenon ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 82b48a2913d5..1baa5990e9f1 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -13549,6 +13549,12 @@ self: super: with self; { pyobjc-framework-Cocoa = callPackage ../development/python-modules/pyobjc-framework-Cocoa { }; + pyobjc-framework-Quartz = callPackage ../development/python-modules/pyobjc-framework-Quartz { }; + + pyobjc-framework-Security = callPackage ../development/python-modules/pyobjc-framework-Security { }; + + pyobjc-framework-WebKit = callPackage ../development/python-modules/pyobjc-framework-WebKit { }; + pyocd = callPackage ../development/python-modules/pyocd { }; pyocd-pemicro = callPackage ../development/python-modules/pyocd-pemicro { };