1 # Copyright 2023 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
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}
19 RESTRICT
="strip mirror"
28 qt5? ( dev-qt/qtcore:5 dev-qt/qtgui:5 dev-qt/qtwidgets:5 )
29 gtk? ( x11-libs/gtk+:3 )
36 pushd tool
/$CARCH || die
38 xzcat
"$file" >"${file%.xz}" || die
39 chmod +x
"${file%.xz}" || die
46 # Apply sanitize patch
47 eapply
-p0 "${FILESDIR}/sanitize.patch"
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
61 # Exclude optional GUI binaries
63 rm -fv tool
/$CARCH/Ventoy2Disk.qt5 || die
66 rm -fv tool
/$CARCH/Ventoy2Disk.gtk3 || die
74 insinto
/opt
/ventoy
/boot
/
76 insinto
/opt
/ventoy
/ventoy
/
79 insinto
/opt
/ventoy
/tool
/
80 doins tool
/*.
{cer
,glade
,json
,sh
,xz
}
81 insinto
/opt
/ventoy
/tool
/$CARCH/
84 doins .
/*.sh plugin WebUI
"VentoyGUI.$CARCH"
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
97 dobin
"${FILESDIR}"/ventoy
{,gui
,web
,plugson
,-{,extend-
}persistent
}
99 rm "${D}"/opt
/ventoy
/tool
/x86_64
/Ventoy2Disk.gtk2 || die