guix_mirror_bot pushed a commit to branch gnome-team
in repository guix.

commit 2661e35f4c260eda4b030bd78220156a1c98c17f
Author: Liliana Marie Prikler <[email protected]>
AuthorDate: Tue Jul 28 09:19:15 2026 +0200

    gnu: Add python-youseedee.
    
    * gnu/packages/patches/python-youseedee-support-fallback-path.patch: New 
file.
    * gnu/packages/fontutils.scm (python-youseedee): New variable.
---
 gnu/packages/fontutils.scm                         | 41 +++++++++++++++
 .../python-youseedee-support-fallback-path.patch   | 61 ++++++++++++++++++++++
 2 files changed, 102 insertions(+)

diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm
index adb9ee57fb9..812cf555db9 100644
--- a/gnu/packages/fontutils.scm
+++ b/gnu/packages/fontutils.scm
@@ -77,6 +77,7 @@
   #:use-module (gnu packages python-build)
   #:use-module (gnu packages python-check)
   #:use-module (gnu packages python-graphics)
+  #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages rust-apps)
@@ -2061,6 +2062,46 @@ other support classes.  Where useful and possible, 
ufoLib2 tries to be
 API-compatible with defcon.")
     (license license:asl2.0)))
 
+(define-public python-youseedee
+  (package
+    (name "python-youseedee")
+    (version "0.8.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+              (url "https://github.com/simoncozens/youseedee";)
+              (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0y246b5b2k6n9z0mh63jn6bfl8h94pszyajcc4j92v6f8wbxn2wx"))
+       (patches
+        (search-patches "python-youseedee-support-fallback-path.patch"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list #:tests? #f        ; no tests
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'set-fallback-path
+                 (lambda* (#:key inputs #:allow-other-keys)
+                   (substitute* "lib/youseedee/__init__.py"
+                     (("fallback_path = .*")
+                      (string-append "fallback_path = Path(\""
+                                     (search-input-directory inputs
+                                                             "share/ucd")
+                                     "\")"))))))))
+    (inputs (list ucd))
+    (propagated-inputs (list python-filelock
+                             python-platformdirs
+                             python-requests))
+    (native-inputs (list python-setuptools python-setuptools-scm))
+    (home-page "https://github.com/simoncozens/youseedee";)
+    (synopsis "Interface to the Unicode Character Database")
+    (description
+     "This package provides a Python interface to the latest version of the
+Unicode Character Database.")
+    (license license:asl2.0)))
+
 ;;; A variant used to break a cycle between python-fontpens and
 ;;; python-fontparts.
 (define-public python-defcon-bootstrap
diff --git a/gnu/packages/patches/python-youseedee-support-fallback-path.patch 
b/gnu/packages/patches/python-youseedee-support-fallback-path.patch
new file mode 100644
index 00000000000..3246c973a2f
--- /dev/null
+++ b/gnu/packages/patches/python-youseedee-support-fallback-path.patch
@@ -0,0 +1,61 @@
+From c319459137c45a52a9f9f7c766886ce8032aab7d Mon Sep 17 00:00:00 2001
+From: Liliana Marie Prikler <[email protected]>
+Date: Sat, 3 Oct 2026 09:04:01 +0200
+Subject: [PATCH] youseedee: Support fallback_path.
+
+Upstream-Status: Not submitted
+---
+ lib/youseedee/__init__.py | 17 ++++++++++++++---
+ lib/youseedee/__main__.py |  2 +-
+ 2 files changed, 15 insertions(+), 4 deletions(-)
+
+diff --git a/lib/youseedee/__init__.py b/lib/youseedee/__init__.py
+index 5e73ef8..ee2e556 100644
+--- a/lib/youseedee/__init__.py
++++ b/lib/youseedee/__init__.py
+@@ -34,15 +34,27 @@ def bisect_key(haystack, needle, key):
+ 
+ 
+ UCD_URL = "https://unicode.org/Public/UCD/latest/ucd/UCD.zip";
++fallback_path = None            # Note: allow distro customization
+ 
+ 
+-def ucd_dir():
++def ucd_dir(force_cache=False):
+     """Return the directory where Unicode data is stored"""
+-    return Path(platformdirs.user_cache_dir("youseedee", ensure_exists=True))
++    if force_cache:
++        return Path(platformdirs.user_cache_dir("youseedee", 
ensure_exists=True))
++    else:
++        path = Path(platformdirs.user_cache_dir("youseedee"))
++        if path.exists():
++            return path
++        elif fallback_path is not None and fallback_path.exists():
++            return fallback_path
++        else:
++            return ucd_dir(force_cache=True)
+ 
+ 
+ def ensure_files():
+     """Ensure the Unicode data files are downloaded and up to date, and 
download them if not"""
++    if ucd_dir() is fallback_path:
++        return
+     file_lock = FileLock(ucd_dir() / ".youseedee_ensure_files.lock")
+     with file_lock:
+         if not (ucd_dir() / "UnicodeData.txt").is_file():
+diff --git a/lib/youseedee/__main__.py b/lib/youseedee/__main__.py
+index e1895ed..a756367 100644
+--- a/lib/youseedee/__main__.py
++++ b/lib/youseedee/__main__.py
+@@ -20,7 +20,7 @@ def main(args=None):
+ 
+     args = parser.parse_args(args)
+     if args.force_download:
+-        file_lock = FileLock(ucd_dir() / ".youseedee_ensure_files.lock")
++        file_lock = FileLock(ucd_dir(force_cache=True) / 
".youseedee_ensure_files.lock")
+         with file_lock:
+             _download_files()
+     char = sys.argv[1]
+-- 
+2.54.0
+

Reply via email to