summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemco van 't Veer <remco@remworks.net>2025-06-03 12:55:44 +0200
committerSharlatan Hellseher <sharlatanus@gmail.com>2025-06-18 23:28:52 +0100
commit8e6b8dc6d8221b14786d1fcb32ed2262585b4335 (patch)
treea488565770a52d8ec0009b299de3568d9e8e0cb8
parente88289c3fc049026cc0d00fbe3f47a2f2ba56740 (diff)
gnu: quodlibet: Remove bundled packages senf and raven.
* gnu/packages/patches/quodlibet-disable-bundled-packages.patch: Add. * gnu/packages/music.scm (quodlibet): [patches]: Add quodlibet-disable-bundled-packages.patch. [snippet]: Remove bundled packages. Change-Id: Ia544b8b1eda2823077892107cc7aaf33ab401057 Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
-rw-r--r--gnu/local.mk3
-rw-r--r--gnu/packages/music.scm8
-rw-r--r--gnu/packages/patches/quodlibet-disable-bundled-packages.patch92
3 files changed, 101 insertions, 2 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 002df1518a..2541afa86f 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -48,7 +48,7 @@
# Copyright © 2021 Andrew Tropin <andrew@trop.in>
# Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
# Copyright © 2022 Daniel Meißner <daniel.meissner-i4k@ruhr-uni-bochum.de>
-# Copyright © 2022, 2024 Remco van 't Veer <remco@remworks.net>
+# Copyright © 2022, 2024, 2025 Remco van 't Veer <remco@remworks.net>
# Copyright © 2022, 2024, 2025 Artyom V. Poptsov <poptsov.artyom@gmail.com>
# Copyright © 2022, 2023 John Kehayias <john.kehayias@protonmail.com>
# Copyright © 2022 muradm <mail@muradm.net>
@@ -2044,6 +2044,7 @@ dist_patch_DATA = \
%D%/packages/patches/qcodeeditor-qt6.patch \
%D%/packages/patches/qtdeclarative-5-disable-qmlcache.patch \
%D%/packages/patches/qtdeclarative-disable-qmlcache.patch \
+ %D%/packages/patches/quodlibet-disable-bundled-packages.patch \
%D%/packages/patches/qucs-s-qucsator-rf-search.patch \
%D%/packages/patches/qxlsx-fix-include-directory.patch \
%D%/packages/patches/scn-fast-float-compat.patch \
diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 7fa895872e..4012b011e4 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -8043,7 +8043,12 @@ streaming audio server.")
(commit (string-append "release-" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "0nk2n4j0vm9ibrm3p9qwf5s0a4iwjkbvr6z23sc0v3rdxvaxrgf6"))))
+ (base32 "0nk2n4j0vm9ibrm3p9qwf5s0a4iwjkbvr6z23sc0v3rdxvaxrgf6"))
+
+ ;; Disable and remove bundled packages.
+ (patches (search-patches "quodlibet-disable-bundled-packages.patch"))
+ (modules '((guix build utils)))
+ (snippet '(delete-file-recursively "quodlibet/packages"))))
(build-system python-build-system)
(arguments
(list
@@ -8106,6 +8111,7 @@ streaming audio server.")
python-pycairo
python-pygobject
python-pyinotify
+ python-senf
python-sgmllib3k
python-toml))
(home-page "https://github.com/quodlibet/quodlibet")
diff --git a/gnu/packages/patches/quodlibet-disable-bundled-packages.patch b/gnu/packages/patches/quodlibet-disable-bundled-packages.patch
new file mode 100644
index 0000000000..e2679c47b5
--- /dev/null
+++ b/gnu/packages/patches/quodlibet-disable-bundled-packages.patch
@@ -0,0 +1,92 @@
+commit 5fd86d2158f7113879f0f150604fbd5435231531
+Author: Remco van 't Veer <remco@remworks.net>
+Date: Sat Jun 7 12:52:00 2025 +0200
+
+ Disable loading bundled packages
+
+diff --git a/quodlibet/__init__.py b/quodlibet/__init__.py
+index d740aaeaf..d99bb2271 100644
+--- a/quodlibet/__init__.py
++++ b/quodlibet/__init__.py
+@@ -16,10 +16,6 @@ if sys.platform == "win32":
+
+ windll.kernel32.SetDllDirectoryW(os.path.dirname(sys.executable))
+
+-from ._import import install_redirect_import_hook
+-
+-install_redirect_import_hook()
+-
+ from .util.i18n import _, C_, N_, ngettext, npgettext
+ from .util.dprint import print_d, print_e, print_w
+ from ._init import init_cli, init
+diff --git a/quodlibet/_import.py b/quodlibet/_import.py
+deleted file mode 100644
+index eb70c8ea9..000000000
+--- a/quodlibet/_import.py
++++ /dev/null
+@@ -1,65 +0,0 @@
+-# Copyright 2017 Christoph Reiter
+-# 2020 Nick Boultbee
+-#
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2 of the License, or
+-# (at your option) any later version.
+-
+-import sys
+-import importlib
+-import importlib.util
+-
+-
+-class RedirectImportHook:
+- """Import hook which loads packages as sub packages.
+-
+- e.g. "import raven" will import "quodlibet.packages.raven" even
+- if raven uses absolute imports internally.
+- """
+-
+- def __init__(self, name, packages):
+- """
+- Args:
+- name (str): The package path to load the packages from
+- packages (List[str]): A list of packages provided
+- """
+-
+- for package in packages:
+- if package in sys.modules:
+- raise Exception(f"{package!r} already loaded, can't redirect")
+-
+- self._name = name
+- self._packages = packages
+-
+- def find_spec(self, fullname, path, target=None):
+- loader = self.find_module(fullname, path)
+- if loader is not None:
+- return importlib.util.spec_from_loader(fullname, loader)
+- return None
+-
+- def find_module(self, fullname, path=None):
+- package = fullname.split(".")[0]
+- if package in self._packages:
+- return self
+- return None
+-
+- def load_module(self, name):
+- mod = None
+- if name in sys.modules:
+- mod = sys.modules[name]
+- loadname = self._name + "." + name
+- if loadname in sys.modules:
+- mod = sys.modules[loadname]
+- if mod is None:
+- mod = importlib.import_module(loadname)
+- sys.modules[name] = mod
+- sys.modules[loadname] = mod
+- return mod
+-
+-
+-def install_redirect_import_hook():
+- """Install the import hook, does not import anything"""
+-
+- import_hook = RedirectImportHook("quodlibet.packages", ["senf", "raven"])
+- sys.meta_path.insert(0, import_hook)