From d8ccdf66df8c90234eafdd8a1354599f805c9687 Mon Sep 17 00:00:00 2001 From: Alex Winter Date: Tue, 26 Oct 2021 14:43:43 +0000 Subject: [PATCH] ventoy-bin: 1.0.51 -> 1.0.56 (#141616) Co-authored-by: Sandro --- pkgs/tools/cd-dvd/ventoy-bin/default.nix | 34 ++++++++++++++++++------ 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/pkgs/tools/cd-dvd/ventoy-bin/default.nix b/pkgs/tools/cd-dvd/ventoy-bin/default.nix index 334b3abdfc95..b5f33f7a6585 100644 --- a/pkgs/tools/cd-dvd/ventoy-bin/default.nix +++ b/pkgs/tools/cd-dvd/ventoy-bin/default.nix @@ -1,6 +1,8 @@ { lib, stdenv, fetchurl, fetchpatch , autoPatchelfHook, makeWrapper , hexdump, exfat, dosfstools, e2fsprogs, xz, util-linux, bash, parted +, withGtk3 ? true, gtk3 +, withQt5 ? false, qt5 }: let arch = { @@ -9,16 +11,22 @@ let arch = { aarch64-linux = "aarch64"; mipsel-linux = "mips64el"; }.${stdenv.hostPlatform.system} or (throw "Unsupported platform ${stdenv.hostPlatform.system}"); +defaultGuiType = if withGtk3 then "gtk3" + else if withQt5 then "qt5" + else ""; in stdenv.mkDerivation rec { pname = "ventoy-bin"; - version = "1.0.51"; + version = "1.0.56"; - nativeBuildInputs = [ autoPatchelfHook makeWrapper ]; - buildInputs = [ hexdump exfat dosfstools e2fsprogs xz util-linux bash parted ]; + nativeBuildInputs = [ autoPatchelfHook makeWrapper ] + ++ lib.optional withQt5 qt5.wrapQtAppsHook; + buildInputs = [ hexdump exfat dosfstools e2fsprogs xz util-linux bash parted ] + ++ lib.optional withGtk3 gtk3 + ++ lib.optional withQt5 qt5.qtbase; src = fetchurl { url = "https://github.com/ventoy/Ventoy/releases/download/v${version}/ventoy-${version}-linux.tar.gz"; - sha256 = "81ae02a06b132b5965dd09c9b64e000a6dafa1d57e03d8564feefda14ef1ee02"; + sha256 = "da53d51e653092a170c11dd560e0ad6fb27c497dd77ad0ba483c32935c069dea"; }; patches = [ (fetchpatch { @@ -53,12 +61,13 @@ in stdenv.mkDerivation rec { # Cleanup. case "$ARCH" in - x86_64) rm -r tool/{i386,aarch64,mips64el};; - i386) rm -r tool/{x86_64,aarch64,mips64el};; - aarch64) rm -r tool/{x86_64,i386,mips64el};; - mips64el) rm -r tool/{x86_64,i386,aarch64};; + x86_64) rm -r {tool/,VentoyGUI.}{i386,aarch64,mips64el};; + i386) rm -r {tool/,VentoyGUI.}{x86_64,aarch64,mips64el};; + aarch64) rm -r {tool/,VentoyGUI.}{x86_64,i386,mips64el};; + mips64el) rm -r {tool/,VentoyGUI.}{x86_64,i386,aarch64};; esac rm README + rm tool/"$ARCH"/Ventoy2Disk.gtk2 # Copy from "$src" to "$out". mkdir -p "$out"/bin "$VENTOY_PATH" @@ -72,6 +81,15 @@ in stdenv.mkDerivation rec { --prefix PATH : "${lib.makeBinPath buildInputs}" \ --run "cd '$VENTOY_PATH' || exit 1" done + '' + lib.optionalString (withGtk3 || withQt5) '' + echo "${defaultGuiType}" > "$VENTOY_PATH/ventoy_gui_type" + makeWrapper "$VENTOY_PATH/VentoyGUI.$ARCH" "$out/bin/ventoy-gui" \ + --prefix PATH : "${lib.makeBinPath buildInputs}" \ + --run "cd '$VENTOY_PATH' || exit 1" + '' + lib.optionalString (!withGtk3) '' + rm "$out"/share/ventoy/tool/"$ARCH"/Ventoy2Disk.gtk3 + '' + lib.optionalString (!withQt5) '' + rm "$out"/share/ventoy/tool/"$ARCH"/Ventoy2Disk.qt5 ''; meta = with lib; {