Subject: [PATCH] gnu: Add python-pyclip.

From: Evgeny Pisemsky <[email-masked]>
Date: Sun, 19 Jan 2025 20:59:47 +0300

Improved package with tests enabled.

>From 79f705aaff93a538b627a85e4a792f5dae2d9a1f Mon Sep 17 00:00:00 2001
Message-ID: <[email-masked]>
From: Evgeny Pisemsky <[email-masked]>
Date: Sun, 19 Jan 2025 20:50:01 +0300
Subject: [PATCH] gnu: Add python-pyclip.

* gnu/packages/xdisorg.scm (python-pyclip): New variable.

Change-Id: Ia0142bb8361e2c7120ea2539f393701aa93d00a9
---
 gnu/packages/xdisorg.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index eadb30fab2..5d1c6bd14d 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -66,6 +66,7 @@
 ;;; Copyright © 2024 Ashish SHUKLA <[email-masked]>
 ;;; Copyright © 2024 Spencer Peters <[email-masked]>
 ;;; Copyright © 2024 Jakob Kirsch <[email-masked]>
+;;; Copyright © 2025 Evgeny Pisemsky <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -90,6 +91,7 @@ (define-module (gnu packages xdisorg)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system pyproject)
   #:use-module (guix build-system scons)
   #:use-module (guix download)
   #:use-module (guix gexp)
@@ -148,6 +150,7 @@ (define-module (gnu packages xdisorg)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-check)
+  #:use-module (gnu packages python-build)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages sphinx)
   #:use-module (gnu packages tex)
@@ -2683,6 +2686,38 @@ (define-public physlock
     (home-page "https://github.com/xyb3rt/physlock")
     (license license:gpl2+)))
 
+(define-public python-pyclip
+  (package
+    (name "python-pyclip")
+    (version "0.7.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/spyoungtech/pyclip")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "10q698snlid09jmlvsqlljj2r0w6cixncjcgbhnjqp7w0hva8wyj"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:phases #~(modify-phases %standard-phases
+                   (add-before 'check 'startx
+                     (lambda* (#:key inputs #:allow-other-keys)
+                       (let ((x (assoc-ref inputs "xorg-server")))
+                         (system (string-append x "/bin/Xvfb :1 &"))
+                         (setenv "DISPLAY" ":1")))))))
+    (native-inputs (list python-setuptools python-wheel python-pytest
+                         xorg-server))
+    (propagated-inputs (list xclip wl-clipboard))
+    (home-page "https://github.com/spyoungtech/pyclip")
+    (synopsis "Cross-platform clipboard module for Python")
+    (description
+     "This library implements cross-platform clipboard utilities supporting
+both binary and text data.")
+    (license license:asl2.0)))
+
 (define-public python-pyperclip
   (package
     (name "python-pyperclip")

base-commit: b88a79842cf53686e8c5ef8286aaa690bde5ef7f
-- 
2.47.1