commit:     83f72c94f1b802a9ac38973d27b2303ac16a0b90
Author:     Michal Privoznik <michal.privoznik <AT> gmail <DOT> com>
AuthorDate: Sun Dec  1 07:59:13 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Dec  1 10:41:40 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=83f72c94

app-emulation/virt-manager: Fix shebang of installed files

Previously, app-emulation/virt-manager was installed using
distutils which automatically fixed shebang on installed python
scripts. Then virt-manager switched to meson, and our ebuilds
simply started inheriting meson instead of distutils-r1. But this
alone is not enough as shebangs are now broken. Fortunately,
there's python_fix_shebang which can be called to fix shebangs
and in ideal world this function would be called in src_prepare()
but this is not the case. virt-manager and other files are
generated at compile time with also too generic shebang [1].
Therefore, let's do that at the end of src_install().

1: 
https://github.com/virt-manager/virt-manager/blob/main/scripts/make_bin_wrapper.py
Fixes: c5ca13d818262729e691e4d23487cb427b50665d
Closes: https://bugs.gentoo.org/945329
Signed-off-by: Michal Privoznik <michal.privoznik <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-emulation/virt-manager/virt-manager-5.0.0.ebuild | 6 ++++++
 app-emulation/virt-manager/virt-manager-9999.ebuild  | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/app-emulation/virt-manager/virt-manager-5.0.0.ebuild 
b/app-emulation/virt-manager/virt-manager-5.0.0.ebuild
index d31e6ccd1906..f9c68ca57cc2 100644
--- a/app-emulation/virt-manager/virt-manager-5.0.0.ebuild
+++ b/app-emulation/virt-manager/virt-manager-5.0.0.ebuild
@@ -67,6 +67,12 @@ src_configure() {
        meson_src_configure
 }
 
+src_install() {
+       meson_src_install
+
+       python_fix_shebang "${ED}"
+}
+
 pkg_preinst() {
        if use gui ; then
                gnome2_pkg_preinst

diff --git a/app-emulation/virt-manager/virt-manager-9999.ebuild 
b/app-emulation/virt-manager/virt-manager-9999.ebuild
index d31e6ccd1906..f9c68ca57cc2 100644
--- a/app-emulation/virt-manager/virt-manager-9999.ebuild
+++ b/app-emulation/virt-manager/virt-manager-9999.ebuild
@@ -67,6 +67,12 @@ src_configure() {
        meson_src_configure
 }
 
+src_install() {
+       meson_src_install
+
+       python_fix_shebang "${ED}"
+}
+
 pkg_preinst() {
        if use gui ; then
                gnome2_pkg_preinst

Reply via email to