diff --git a/sys-boot/woeusb-ng/Manifest b/sys-boot/woeusb-ng/Manifest new file mode 100644 index 0000000000000..cc515198d1a7f --- /dev/null +++ b/sys-boot/woeusb-ng/Manifest @@ -0,0 +1 @@ +DIST woeusb-ng-0.2.12.tar.gz 219102 BLAKE2B d146697ce4143adc62b489a5dbd09bd2dd02d910a51357a27b1a92663eee279c6fa3bdd39b0f01e46f445cb0170c3b0dbf37ed7fdc442386247ff2acb85791e8 SHA512 3323d1f33f3c009652555ca20827d3ab902a59c21b4e57725ac7efb702c60c8ab8a572f77c7f5e4da91713ea5412811358870d6100e13e5828421645b7464c38 diff --git a/sys-boot/woeusb-ng/files/woeusb-ng-0.2.12-fix-pkg-discovery.patch b/sys-boot/woeusb-ng/files/woeusb-ng-0.2.12-fix-pkg-discovery.patch new file mode 100644 index 0000000000000..33d84aa3179b2 --- /dev/null +++ b/sys-boot/woeusb-ng/files/woeusb-ng-0.2.12-fix-pkg-discovery.patch @@ -0,0 +1,28 @@ +Fix setuptools package discovery issues by using custom discovery. + +``` +/usr/lib/python3.12/site-packages/setuptools/command/build_py.py:212: _Warning: Package 'WoeUSB.data' is absent from the `packages` configuration. + ``` + +There's an open PR to improve the packaging methods. +https://github.com/WoeUSB/WoeUSB-ng/pull/79 +--- a/setup.py ++++ b/setup.py +@@ -2,7 +2,7 @@ import os + import shutil + import stat + +-from setuptools import setup ++from setuptools import setup, find_namespace_packages + from setuptools.command.develop import develop + from setuptools.command.install import install + +@@ -57,7 +57,7 @@ setup( + author_email='jakubmateusz@poczta.onet.pl', + license='GPL-3', + zip_safe=False, +- packages=['WoeUSB'], ++ packages=find_namespace_packages(exclude=['doc', 'miscellaneous']), + include_package_data=True, + scripts=[ + 'WoeUSB/woeusb', diff --git a/sys-boot/woeusb-ng/files/woeusb-ng-0.2.12-skip-postinstall.patch b/sys-boot/woeusb-ng/files/woeusb-ng-0.2.12-skip-postinstall.patch new file mode 100644 index 0000000000000..3f632d3db67c6 --- /dev/null +++ b/sys-boot/woeusb-ng/files/woeusb-ng-0.2.12-skip-postinstall.patch @@ -0,0 +1,13 @@ +Prevent installing files to hardcoded locations. + +There's an open PR to improve the packaging methods. +https://github.com/WoeUSB/WoeUSB-ng/pull/79 +--- a/setup.py ++++ b/setup.py +@@ -68,6 +68,5 @@ setup( + ], + cmdclass={ + 'develop': PostDevelopCommand, +- 'install': PostInstallCommand + } + ) diff --git a/sys-boot/woeusb-ng/metadata.xml b/sys-boot/woeusb-ng/metadata.xml new file mode 100644 index 0000000000000..bbe0695f9f037 --- /dev/null +++ b/sys-boot/woeusb-ng/metadata.xml @@ -0,0 +1,15 @@ + + + + + pastalian46@gmail.com + Takuya Wakazono + + + proxy-maint@gentoo.org + Proxy Maintainers + + + WoeUSB/WoeUSB-ng + + diff --git a/sys-boot/woeusb-ng/woeusb-ng-0.2.12.ebuild b/sys-boot/woeusb-ng/woeusb-ng-0.2.12.ebuild new file mode 100644 index 0000000000000..6b4066c6c6a99 --- /dev/null +++ b/sys-boot/woeusb-ng/woeusb-ng-0.2.12.ebuild @@ -0,0 +1,69 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +DISTUTILS_SINGLE_IMPL=1 +PYTHON_COMPAT=( python3_{10..12} ) + +inherit desktop distutils-r1 optfeature xdg + +MY_PN="WoeUSB-ng" +DESCRIPTION="Create a Windows USB stick installer from an iso image (rewrite of WoeUSB)" +HOMEPAGE="https://github.com/WoeUSB/WoeUSB-ng" +SRC_URI="https://github.com/WoeUSB/WoeUSB-ng/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/${MY_PN}-${PV}" + +LICENSE="GPL-3+" +SLOT="0" +KEYWORDS="~amd64" +IUSE="gui" + +RDEPEND=" + !sys-boot/woeusb + app-arch/p7zip + sys-apps/util-linux + sys-block/parted + sys-boot/grub:2 + sys-fs/dosfstools + sys-fs/ntfs3g[ntfsprogs] + $(python_gen_cond_dep ' + dev-python/termcolor[${PYTHON_USEDEP}] + gui? ( dev-python/wxpython:4.0[${PYTHON_USEDEP}] ) + ') +" + +PATCHES=( + "${FILESDIR}"/${P}-fix-pkg-discovery.patch + "${FILESDIR}"/${P}-skip-postinstall.patch +) + +src_prepare() { + distutils-r1_src_prepare + python_fix_shebang WoeUSB + + # fix hardcoded org.freedesktop.policykit.exec.path + sed -i "s|/usr/local/bin|${EPREFIX}/usr/bin|" \ + miscellaneous/com.github.woeusb.woeusb-ng.policy \ + WoeUSB/utils.py || die +} + +src_install() { + distutils-r1_src_install + + if use gui; then + dobin WoeUSB/woeusbgui + + insinto /usr/share/polkit-1/actions + doins miscellaneous/com.github.woeusb.woeusb-ng.policy + + doicon -s 256 WoeUSB/data/woeusb-logo.png + make_desktop_entry woeusbgui WoeUSB-ng woeusb-logo Utility + fi +} + +pkg_postinst() { + xdg_pkg_postinst + optfeature "Legacy PC bootmode support" "sys-boot/grub:2[grub_platforms_pc]" +}