dev-python/conda-libmamba-solver: bump version to 24.11.1
[gentoo-zh.git] / sys-boot / ventoy-bin / ventoy-bin-1.0.99.ebuild
blob2bf5509cfbe3c8228b6c8450d9a78555c996427c
1 # Copyright 2023 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 inherit desktop xdg
8 DESCRIPTION="A new multiboot USB solution"
9 HOMEPAGE="http://www.ventoy.net"
10 SRC_URI="https://github.com/ventoy/Ventoy/releases/download/v${PV}/ventoy-${PV}-linux.tar.gz"
12 S=${WORKDIR}/ventoy-${PV}
13 LICENSE="GPL-3"
14 SLOT="0"
15 KEYWORDS="~amd64"
17 IUSE="+qt5 +gtk"
19 RESTRICT="strip mirror"
21 DEPEND="
22 sys-fs/dosfstools
23 sys-fs/exfat-utils
24 sys-block/parted
26 RDEPEND="
27 ${DEPEND}
28 qt5? ( dev-qt/qtcore:5 dev-qt/qtgui:5 dev-qt/qtwidgets:5 )
29 gtk? ( x11-libs/gtk+:3 )
32 CARCH="x86_64"
34 src_prepare() {
35 # Decompress tools
36 pushd tool/$CARCH || die
37 for file in *.xz; do
38 xzcat "$file" >"${file%.xz}" || die
39 chmod +x "${file%.xz}" || die
40 done
42 # Cleanup .xz crap
43 rm -fv ./*.xz || die
44 popd || die
46 # Apply sanitize patch
47 eapply -p0 "${FILESDIR}/sanitize.patch"
49 # Log location
50 sed -i 's|log\.txt|/var/log/ventoy.log|g' WebUI/static/js/languages.js tool/languages.json || die
52 # Non-POSIX compliant scripts
53 sed -i 's|bin/sh|usr/bin/env bash|g' tool/{ventoy_lib.sh,VentoyWorker.sh} || die
55 # Clean up unused binaries
56 # Preserving mkexfatfs and mount.exfat-fuse because exfatprogs is incompatible
57 for binary in xzcat hexdump; do
58 rm -fv tool/$CARCH/$binary || die
59 done
61 # Exclude optional GUI binaries
62 if ! use qt5; then
63 rm -fv tool/$CARCH/Ventoy2Disk.qt5 || die
65 if ! use gtk; then
66 rm -fv tool/$CARCH/Ventoy2Disk.gtk3 || die
69 default
72 src_install() {
73 insopts -m0644
74 insinto /opt/ventoy/boot/
75 doins boot/*
76 insinto /opt/ventoy/ventoy/
77 doins ventoy/*
78 insopts -m0755
79 insinto /opt/ventoy/tool/
80 doins tool/*.{cer,glade,json,sh,xz}
81 insinto /opt/ventoy/tool/$CARCH/
82 doins tool/$CARCH/*
83 insinto /opt/ventoy/
84 doins ./*.sh plugin WebUI "VentoyGUI.$CARCH"
86 # Install .desktop
87 insopts -m0644
88 insinto /usr/share/pixmaps/
89 newins WebUI/static/img/VentoyLogo.png ventoy.png
90 domenu "${FILESDIR}/ventoy.desktop"
92 # Link system binaries
93 for binary in xzcat hexdump; do
94 dosym -r /usr/bin/$binary /opt/ventoy/tool/$CARCH/$binary
95 done
97 dobin "${FILESDIR}"/ventoy{,gui,web,plugson,-{,extend-}persistent}
99 rm "${D}"/opt/ventoy/tool/x86_64/Ventoy2Disk.gtk2 || die