From 834d612e355a29d22be050b1489c144d6e13d84a Mon Sep 17 00:00:00 2001 From: Sam <30577766+Samasaur1@users.noreply.github.com> Date: Fri, 27 Dec 2024 22:13:28 -0800 Subject: [PATCH] python312Packages.copykitten: init at 1.2.3 --- .../python-modules/copykitten/default.nix | 51 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 53 insertions(+) create mode 100644 pkgs/development/python-modules/copykitten/default.nix diff --git a/pkgs/development/python-modules/copykitten/default.nix b/pkgs/development/python-modules/copykitten/default.nix new file mode 100644 index 0000000000000..385cfe79401e9 --- /dev/null +++ b/pkgs/development/python-modules/copykitten/default.nix @@ -0,0 +1,51 @@ +{ + fetchFromGitHub, + buildPythonPackage, + rustPlatform, + lib, + pillow, +}: + +buildPythonPackage rec { + pname = "copykitten"; + version = "1.2.3"; + pyproject = true; + + src = fetchFromGitHub { + owner = "Klavionik"; + repo = "copykitten"; + tag = "v${version}"; + hash = "sha256-S4IPVhYk/o15LQK1AB8VpdrHwIwTZyvmI2+e27/vDLs="; + }; + + cargoDeps = rustPlatform.fetchCargoTarball { + inherit src; + hash = "sha256-Qgg2S1nRwWs2O81huj1g4wq7v4G377T+V8/1rjhz1ZE="; + }; + + build-system = [ + rustPlatform.cargoSetupHook + rustPlatform.maturinBuildHook + ]; + + dependencies = [ + pillow + ]; + + # The tests get/set the contents of the clipboard by running subprocesses. + # On Darwin, the tests try to use `pbcopy`/`pbpaste`, which aren't packaged in Nix. + # On Linux, I tried adding `xclip` to `nativeCheckInputs`, but got errors about + # displays being null and the clipboard never being initialized. + doCheck = false; + + pythonImportsCheck = [ "copykitten" ]; + + meta = { + description = "Robust, dependency-free way to use the system clipboard in Python"; + homepage = "https://github.com/Klavionik/copykitten"; + changelog = "https://github.com/Klavionik/copykitten/blob/v${version}/CHANGELOG.md"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.samasaur ]; + platforms = lib.platforms.all; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 78a8674d3e1d4..5dac098b94042 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2638,6 +2638,8 @@ self: super: with self; { coordinates = callPackage ../development/python-modules/coordinates { }; + copykitten = callPackage ../development/python-modules/copykitten { }; + coreapi = callPackage ../development/python-modules/coreapi { }; coredis = callPackage ../development/python-modules/coredis { };