variety/796.patch

60 lines
2 KiB
Diff

From 325552174e51c56d98297c2a08ddb4d2c7092c58 Mon Sep 17 00:00:00 2001
From: Martin Gansser <martinkg@fedoraproject.org>
Date: Thu, 9 Oct 2025 10:00:56 +0200
Subject: [PATCH] Fix wheel-based installations to include
variety_build_settings
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes https://github.com/varietywalls/variety/issues/795
This could also move the cleanup to a custom cmdclass,
but it is not necessary.
Co-Authored-By: Miro Hrončok <miro@hroncok.cz>
---
setup.py | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/setup.py b/setup.py
index 3f486d9b..00fa31da 100644
--- a/setup.py
+++ b/setup.py
@@ -20,6 +20,7 @@
import os
import sys
+from setuptools.command.build_py import build_py as _build_py
from variety_lib.varietyconfig import get_version
@@ -41,14 +42,15 @@
BUILD_SETTINGS_PATH = "variety_lib/variety_build_settings.py"
-class InstallWithDataDirectory(DistUtilsExtra.auto.install_auto):
+
+class BuildWithDataDirectory(_build_py):
def run(self):
- data_path = os.path.join(self.prefix, "share/variety/")
+ data_path = os.path.join(sys.prefix, "share/variety/")
with open(BUILD_SETTINGS_PATH, "w") as f:
f.write("### Autogenerated by setup.py - do not edit!\n")
f.write("__variety_data_directory__ = %r\n" % data_path)
- print("This build will look for Variety's data in %r." % data_path)
- DistUtilsExtra.auto.install_auto.run(self)
+ print(f"[build_py] This build will look for Variety's data in {data_path!r}.")
+ super().run()
DistUtilsExtra.auto.setup(
@@ -69,7 +71,7 @@ def run(self):
Variety also includes a range of image effects, such as oil painting and blur,
as well as options to layer quotes and a clock onto the background.""",
url="https://github.com/varietywalls/variety",
- cmdclass={"install": InstallWithDataDirectory},
+ cmdclass={"build_py": BuildWithDataDirectory},
data_files=[("share/metainfo", ["variety.appdata.xml"])],
)