From d712d2ae471952c6c97dee5064e17e01e4e0e4f9 Mon Sep 17 00:00:00 2001 From: Raboneko <119771935+raboneko@users.noreply.github.com> Date: Thu, 5 Jun 2025 03:27:37 -0700 Subject: [PATCH] fix(woeusb-ng): I HATE Python (#5248) (#5259) (cherry picked from commit 4fd93980b83cd22782ce2711c1a0090845e2bd7c) Signed-off-by: Gilver Co-authored-by: Gilver --- anda/apps/woeusb-ng/WoeUSB-ng.spec | 37 ++++++++++++++++++++++++------ anda/apps/woeusb-ng/anda.hcl | 1 + 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/anda/apps/woeusb-ng/WoeUSB-ng.spec b/anda/apps/woeusb-ng/WoeUSB-ng.spec index c66a2ddd98..ae716fe328 100644 --- a/anda/apps/woeusb-ng/WoeUSB-ng.spec +++ b/anda/apps/woeusb-ng/WoeUSB-ng.spec @@ -1,6 +1,6 @@ Name: WoeUSB-ng Version: 0.2.12 -Release: 1%?dist +Release: 2%?dist Summary: Simple tool that enable you to create your own usb stick with Windows installer License: GPL-3.0-only Requires: parted dosfstools ntfsprogs p7zip p7zip-plugins xdg-utils grub2-tools @@ -8,28 +8,44 @@ URL: https://github.com/WoeUSB/WoeUSB-ng Source: https://github.com/WoeUSB/WoeUSB-ng/archive/refs/tags/v%version.tar.gz Patch0: https://patch-diff.githubusercontent.com/raw/WoeUSB/WoeUSB-ng/pull/79.patch BuildArch: noarch -BuildRequires: python3-devel python3-installer pyproject-rpm-macros python3dist(pip) python3dist(setuptools) python3dist(termcolor) python3dist(wxpython) +Requires: python3-%{name} = %{evr} +BuildRequires: anda-srpm-macros python3-devel python3-installer pyproject-rpm-macros python3dist(pip) python3dist(setuptools) python3dist(termcolor) python3dist(wxpython) python3dist(wheel) %global _description %{expand: WoeUSB-ng is a simple tool that enable you to create your own usb stick windows installer from an iso image or a real DVD. This is a rewrite of original WoeUSB.} %description %_description +%package -n python3-%{name} +Summary: Python files for %{name} +Requires: %{name} = %{evr} +BuildArch: noarch + +%description -n python3-%{name} +Python files needed for %{name}. + %prep %autosetup -p1 - +%if 0%{?fedora} > 41 %generate_buildrequires %pyproject_buildrequires - +%endif %build +%if 0%{?fedora} <= 41 +%py3_build +%else %pyproject_wheel - +%endif %install +%if 0%{?fedora} <= 41 +%py3_install +%else %pyproject_install %pyproject_save_files WoeUSB +%endif install -Dpm644 miscellaneous/WoeUSB-ng.desktop %buildroot%_datadir/applications/WoeUSB-ng.desktop install -Dpm644 miscellaneous/com.github.woeusb.woeusb-ng.policy %buildroot%_datadir/polkit-1/actions/com.github.woeusb.woeusb-ng.policy @@ -37,14 +53,21 @@ install -Dpm644 miscellaneous/com.github.woeusb.woeusb-ng.policy %buildroot%_dat %check #pyproject_check_import - -%files -f %{pyproject_files} +%files %_bindir/woeusb %_bindir/woeusbgui %_datadir/applications/WoeUSB-ng.desktop %_iconsdir/hicolor/scalable/apps/woeusb-logo.png %_datadir/polkit-1/actions/com.github.woeusb.woeusb-ng.policy +%if 0%{?fedora} <= 41 +%files -n python3-%{name} +%{python3_sitelib}/WoeUSB/ +%{python3_sitelib}/woeusb_ng-%{version}-py%{python3_version}.egg-info/ +%else +%files -n python3-%{name} -f %{pyproject_files} +%endif + %changelog %autochangelog diff --git a/anda/apps/woeusb-ng/anda.hcl b/anda/apps/woeusb-ng/anda.hcl index f729a2237e..33d5f43947 100644 --- a/anda/apps/woeusb-ng/anda.hcl +++ b/anda/apps/woeusb-ng/anda.hcl @@ -1,4 +1,5 @@ project pkg { + arches = ["x86_64"] rpm { spec = "WoeUSB-ng.spec" }