Merge pull request #178285 from AndersonTorres/ventoy

ventoy-bin: 1.0.76 -> 1.0.77
This commit is contained in:
Anderson Torres 2022-06-20 01:45:15 -03:00 committed by GitHub
commit 72bbea9db7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 103 additions and 45 deletions

View File

@ -1,14 +1,35 @@
{ lib, stdenv, fetchurl, fetchpatch { lib
, autoPatchelfHook, makeWrapper , stdenv
, bash, coreutils, dosfstools, exfat, gawk, gnugrep, gnused, hexdump, parted , fetchurl
, procps, util-linux, which, xz , fetchpatch
, withCryptsetup ? false, cryptsetup , autoPatchelfHook
, withXfs ? false, xfsprogs , bash
, withExt4 ? false, e2fsprogs , coreutils
, withNtfs ? false, ntfs3g , cryptsetup
, withGtk3 ? false, gtk3 , dosfstools
, withQt5 ? false, qt5 , e2fsprogs
, exfat
, gawk
, gnugrep
, gnused
, gtk3
, hexdump
, makeWrapper
, ntfs3g
, parted
, procps
, qt5
, util-linux
, which
, xfsprogs
, xz
, defaultGuiType ? "" , defaultGuiType ? ""
, withCryptsetup ? false
, withXfs ? false
, withExt4 ? false
, withNtfs ? false
, withGtk3 ? false
, withQt5 ? false
}: }:
assert lib.elem defaultGuiType [ "" "gtk3" "qt5" ]; assert lib.elem defaultGuiType [ "" "gtk3" "qt5" ];
@ -21,37 +42,30 @@ let
i686-linux = "i386"; i686-linux = "i386";
aarch64-linux = "aarch64"; aarch64-linux = "aarch64";
mipsel-linux = "mips64el"; mipsel-linux = "mips64el";
}.${stdenv.hostPlatform.system} or (throw "Unsupported platform ${stdenv.hostPlatform.system}"); }.${stdenv.hostPlatform.system}
or (throw "Unsupported platform ${stdenv.hostPlatform.system}");
in stdenv.mkDerivation rec { in stdenv.mkDerivation rec {
pname = "ventoy-bin"; pname = "ventoy-bin";
version = "1.0.76"; version = "1.0.77";
nativeBuildInputs = [ autoPatchelfHook makeWrapper ]
++ lib.optional withQt5 qt5.wrapQtAppsHook;
buildInputs = [
bash coreutils dosfstools exfat gawk gnugrep gnused hexdump parted procps
util-linux which xz
] ++ lib.optional withCryptsetup cryptsetup
++ lib.optional withXfs xfsprogs
++ lib.optional withExt4 e2fsprogs
++ lib.optional withNtfs ntfs3g
++ lib.optional withGtk3 gtk3
++ lib.optional withQt5 qt5.qtbase;
src = fetchurl { src = fetchurl {
url = "https://github.com/ventoy/Ventoy/releases/download/v${version}/ventoy-${version}-linux.tar.gz"; url = "https://github.com/ventoy/Ventoy/releases/download/v${version}/ventoy-${version}-linux.tar.gz";
sha256 = "f13c3c81eafe15ae4b3de3d98d240d94eabba7cda8e3330ff1769502ecfa33c0"; hash = "sha256-DmDWt06gjrAEZ9Qvb7qbKbfJr/u84qmQ44kfDA3HDp0=";
}; };
patches = [ patches = [
(fetchpatch { (fetchpatch {
name = "sanitize.patch"; name = "sanitize.patch";
url = "https://aur.archlinux.org/cgit/aur.git/plain/sanitize.patch?h=057f2d1eb496c7a3aaa8229e99a7f709428fa4c5"; url = "https://aur.archlinux.org/cgit/aur.git/plain/sanitize.patch?h=057f2d1eb496c7a3aaa8229e99a7f709428fa4c5";
sha256 = "sha256-iAtLtM+Q4OsXDK83eCnPNomeNSEqdRLFfK2x7ybPSpk="; sha256 = "sha256-iAtLtM+Q4OsXDK83eCnPNomeNSEqdRLFfK2x7ybPSpk=";
}) })
./fix-for-read-only-file-system.patch ./001-add-mips64.diff
./add-mips64.patch ./002-fix-for-read-only-file-system.diff
]; ];
patchFlags = [ "-p0" ]; patchFlags = [ "-p0" ];
postPatch = '' postPatch = ''
# Fix permissions. # Fix permissions.
find -type f -name \*.sh -exec chmod a+x '{}' \; find -type f -name \*.sh -exec chmod a+x '{}' \;
@ -60,7 +74,38 @@ in stdenv.mkDerivation rec {
sed -i 's:log\.txt:/var/log/ventoy\.log:g' \ sed -i 's:log\.txt:/var/log/ventoy\.log:g' \
WebUI/static/js/languages.js tool/languages.json WebUI/static/js/languages.js tool/languages.json
''; '';
nativeBuildInputs = [
autoPatchelfHook
makeWrapper
]
++ lib.optional withQt5 qt5.wrapQtAppsHook;
buildInputs = [
bash
coreutils
dosfstools
exfat
gawk
gnugrep
gnused
hexdump
parted
procps
util-linux
which
xz
]
++ lib.optional withCryptsetup cryptsetup
++ lib.optional withExt4 e2fsprogs
++ lib.optional withGtk3 gtk3
++ lib.optional withNtfs ntfs3g
++ lib.optional withXfs xfsprogs
++ lib.optional withQt5 qt5.qtbase;
installPhase = '' installPhase = ''
runHook preInstall
# Setup variables. # Setup variables.
local VENTOY_PATH="$out"/share/ventoy local VENTOY_PATH="$out"/share/ventoy
local ARCH='${arch}' local ARCH='${arch}'
@ -99,9 +144,10 @@ in stdenv.mkDerivation rec {
--prefix PATH : "${lib.makeBinPath buildInputs}" \ --prefix PATH : "${lib.makeBinPath buildInputs}" \
--chdir "$VENTOY_PATH" --chdir "$VENTOY_PATH"
done done
'' + lib.optionalString (withGtk3 || withQt5) '' ''
# VentoGUI uses the `ventoy_gui_type` file to determine the type of GUI. # VentoGUI uses the `ventoy_gui_type` file to determine the type of GUI.
# See <https://github.com/ventoy/Ventoy/blob/471432fc50ffad80bde5de0b22e4c30fa3aac41b/LinuxGUI/Ventoy2Disk/ventoy_gui.c#L1044>. # See <https://github.com/ventoy/Ventoy/blob/471432fc50ffad80bde5de0b22e4c30fa3aac41b/LinuxGUI/Ventoy2Disk/ventoy_gui.c#L1044>.
+ lib.optionalString (withGtk3 || withQt5) ''
echo "${defaultGuiType}" > "$VENTOY_PATH/ventoy_gui_type" echo "${defaultGuiType}" > "$VENTOY_PATH/ventoy_gui_type"
makeWrapper "$VENTOY_PATH/VentoyGUI.$ARCH" "$out/bin/ventoy-gui" \ makeWrapper "$VENTOY_PATH/VentoyGUI.$ARCH" "$out/bin/ventoy-gui" \
--prefix PATH : "${lib.makeBinPath buildInputs}" \ --prefix PATH : "${lib.makeBinPath buildInputs}" \
@ -109,31 +155,37 @@ in stdenv.mkDerivation rec {
mkdir "$out"/share/{applications,pixmaps} mkdir "$out"/share/{applications,pixmaps}
ln -s "$VENTOY_PATH"/WebUI/static/img/VentoyLogo.png "$out"/share/pixmaps/ ln -s "$VENTOY_PATH"/WebUI/static/img/VentoyLogo.png "$out"/share/pixmaps/
cp ${./ventoy-gui.desktop} "$out"/share/applications/ cp ${./ventoy-gui.desktop} "$out"/share/applications/
'' + lib.optionalString (!withGtk3) '' ''
+ lib.optionalString (!withGtk3) ''
rm "$VENTOY_PATH"/tool/{"$ARCH"/Ventoy2Disk.gtk3,VentoyGTK.glade} rm "$VENTOY_PATH"/tool/{"$ARCH"/Ventoy2Disk.gtk3,VentoyGTK.glade}
'' + lib.optionalString (!withQt5) '' ''
+ lib.optionalString (!withQt5) ''
rm "$VENTOY_PATH/tool/$ARCH/Ventoy2Disk.qt5" rm "$VENTOY_PATH/tool/$ARCH/Ventoy2Disk.qt5"
'' + lib.optionalString (!withGtk3 && !withQt5) '' ''
+ lib.optionalString (!withGtk3 && !withQt5) ''
rm "$VENTOY_PATH"/VentoyGUI.* rm "$VENTOY_PATH"/VentoyGUI.*
'' +
''
runHook postInstall
''; '';
meta = with lib; { meta = with lib; {
description = "An open source tool to create bootable USB drive for ISO/WIM/IMG/VHD(x)/EFI files"; description = "A New Bootable USB Solution";
longDescription = '' longDescription = ''
An open source tool to create bootable USB drive for homepage = "https://www.ventoy.net";
Ventoy is an open source tool to create bootable USB drive for
ISO/WIM/IMG/VHD(x)/EFI files. With ventoy, you don't need to format the ISO/WIM/IMG/VHD(x)/EFI files. With ventoy, you don't need to format the
disk over and over, you just need to copy the ISO/WIM/IMG/VHD(x)/EFI disk over and over, you just need to copy the ISO/WIM/IMG/VHD(x)/EFI files
files to the USB drive and boot them directly. You can copy many files to the USB drive and boot them directly. You can copy many files at a time
at a time and ventoy will give you a boot menu to select them. You can and ventoy will give you a boot menu to select them. You can also browse
also browse ISO/WIM/IMG/VHD(x)/EFI files in local disk and boot them. ISO/WIM/IMG/VHD(x)/EFI files in local disk and boot them. x86 Legacy
x86 Legacy BIOS, IA32 UEFI, x86_64 UEFI, ARM64 UEFI and MIPS64EL UEFI are BIOS, IA32 UEFI, x86_64 UEFI, ARM64 UEFI and MIPS64EL UEFI are supported
supported in the same way. Most type of OS supported in the same way. Most type of OS supported
(Windows/WinPE/Linux/ChromeOS/Unix/VMware/Xen...). With ventoy you can (Windows/WinPE/Linux/ChromeOS/Unix/VMware/Xen...). With ventoy you can
also browse ISO/WIM/IMG/VHD(x)/EFI files in local disk and boot them. also browse ISO/WIM/IMG/VHD(x)/EFI files in local disk and boot them.
800+ image files are tested. 90%+ distros in <distrowatch.com> 800+ image files are tested. 90%+ distros in DistroWatch supported.
supported.
''; '';
homepage = "https://www.ventoy.net";
changelog = "https://www.ventoy.net/doc_news.html"; changelog = "https://www.ventoy.net/doc_news.html";
license = licenses.gpl3Plus; license = licenses.gpl3Plus;
platforms = [ "x86_64-linux" "i686-linux" "aarch64-linux" "mipsel-linux" ]; platforms = [ "x86_64-linux" "i686-linux" "aarch64-linux" "mipsel-linux" ];

View File

@ -1244,6 +1244,12 @@ with pkgs;
veikk-linux-driver-gui = libsForQt5.callPackage ../tools/misc/veikk-linux-driver-gui { }; veikk-linux-driver-gui = libsForQt5.callPackage ../tools/misc/veikk-linux-driver-gui { };
ventoy-bin = callPackage ../tools/cd-dvd/ventoy-bin { }; ventoy-bin = callPackage ../tools/cd-dvd/ventoy-bin { };
ventoy-bin-full = ventoy-bin.override {
withCryptsetup = true;
withXfs = true;
withExt4 = true;
withNtfs = true;
};
voms = callPackage ../tools/networking/voms { }; voms = callPackage ../tools/networking/voms { };