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"
17 RESTRICT="strip mirror"
26 S=${WORKDIR}/ventoy-${PV}
32 pushd tool/$CARCH || die
34 xzcat "$file" >"${file%.xz}" || die
35 chmod +x "${file%.xz}" || die
42 # Apply sanitize patch
43 eapply -p0 "${FILESDIR}/sanitize.patch"
46 sed -i 's|log\.txt|/var/log/ventoy.log|g' WebUI/static/js/languages.js tool/languages.json || die
48 # Non-POSIX compliant scripts
49 sed -i 's|bin/sh|usr/bin/env bash|g' tool/{ventoy_lib.sh,VentoyWorker.sh} || die
51 # Clean up unused binaries
52 # Preserving mkexfatfs and mount.exfat-fuse because exfatprogs is incompatible
53 for binary in xzcat hexdump; do
54 rm -fv tool/$CARCH/$binary || die
61 insinto /opt/ventoy/boot/
63 insinto /opt/ventoy/ventoy/
66 insinto /opt/ventoy/tool/
67 doins tool/*.{cer,glade,json,sh,xz}
68 insinto /opt/ventoy/tool/$CARCH/
71 doins ./*.sh plugin WebUI "VentoyGUI.$CARCH"
75 insinto /usr/share/pixmaps/
76 newins WebUI/static/img/VentoyLogo.png ventoy.png
77 domenu "${FILESDIR}/ventoy.desktop"
79 # Link system binaries
80 for binary in xzcat hexdump; do
81 dosym -r /usr/bin/$binary /opt/ventoy/tool/$CARCH/$binary
84 dobin "${FILESDIR}"/ventoy{,gui,web,plugson,-{,extend-}persistent}
86 rm "${D}"/opt/ventoy/tool/x86_64/Ventoy2Disk.gtk2 || die