From 5ebc7e350b92451f072ff46abbcde7b644ba9553 Mon Sep 17 00:00:00 2001 From: pongo1231 Date: Sat, 26 Oct 2024 00:12:45 +0200 Subject: [PATCH] distrobox: 1.7.2.1 -> 1.8.0 --- .../virtualization/distrobox/default.nix | 12 +++++---- .../distrobox/relative-default-icon.patch | 26 +++++++++++++++++++ 2 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 pkgs/applications/virtualization/distrobox/relative-default-icon.patch diff --git a/pkgs/applications/virtualization/distrobox/default.nix b/pkgs/applications/virtualization/distrobox/default.nix index 567a1b4db6eb2..ce3c4e075a954 100644 --- a/pkgs/applications/virtualization/distrobox/default.nix +++ b/pkgs/applications/virtualization/distrobox/default.nix @@ -2,13 +2,13 @@ stdenvNoCC.mkDerivation (finalAttrs: { pname = "distrobox"; - version = "1.7.2.1"; + version = "1.8.0"; src = fetchFromGitHub { owner = "89luca89"; repo = "distrobox"; rev = finalAttrs.version; - hash = "sha256-H2jeKs0h4ZAcP33HB5jptlubq62cwnjPK2wSlEIfFWA="; + hash = "sha256-e9oSTk+UlkrkRSipqjjMqwtxEvEZffVBmlSTmsIT7cU="; }; dontConfigure = true; @@ -16,12 +16,14 @@ stdenvNoCC.mkDerivation (finalAttrs: { nativeBuildInputs = [ makeWrapper ]; + patches = [ + # https://github.com/89luca89/distrobox/issues/408 + ./relative-default-icon.patch + ]; + installPhase = '' runHook preInstall - # https://github.com/89luca89/distrobox/issues/408 - substituteInPlace ./distrobox-generate-entry \ - --replace-fail 'icon_default="''${HOME}/.local' "icon_default=\"$out" ./install -P $out runHook postInstall diff --git a/pkgs/applications/virtualization/distrobox/relative-default-icon.patch b/pkgs/applications/virtualization/distrobox/relative-default-icon.patch new file mode 100644 index 0000000000000..069c2d40d618a --- /dev/null +++ b/pkgs/applications/virtualization/distrobox/relative-default-icon.patch @@ -0,0 +1,26 @@ +diff --git a/distrobox-generate-entry b/distrobox-generate-entry +index 65fcea0..8d57e4e 100755 +--- a/distrobox-generate-entry ++++ b/distrobox-generate-entry +@@ -51,7 +51,7 @@ container_manager="autodetect" + container_name_default="my-distrobox" + delete=0 + icon="auto" +-icon_default="${XDG_DATA_HOME:-${HOME}/.local/share}/icons/terminal-distrobox-icon.svg" ++icon_default="terminal-distrobox-icon" + verbose=0 + online=0 + version="1.8.0" +@@ -335,12 +335,6 @@ if [ "${icon}" = "auto" ]; then + + icon_url="$(echo "${DISTRO_ICON_MAP}" | grep "${container_distro}:" | cut -d':' -f2-)" + +- # Distro not found in our map, fallback to generic icon +- if [ -z "${icon_url}" ]; then +- icon_url="https://raw.githubusercontent.com/89luca89/distrobox/main/icons/terminal-distrobox-icon.svg" +- container_distro="terminal-distrobox-icon" +- fi +- + if [ -n "${icon_url}" ] && [ "${download}" != "null" ]; then + icon_extension="${icon_url##*.}" +