From 2ad144ef8955083e09788f71f9601e9578878ff2 Mon Sep 17 00:00:00 2001 From: kilianar Date: Fri, 1 Jul 2022 16:40:58 +0200 Subject: [PATCH] beauty-line-icon-theme: 0.0.1 -> 0.0.4 Update to the latest upstream release: https://github.com/gvolpe/BeautyLine/releases/tag/0.0.4 Includes some refactoring: - use stdenvNoCC instead of stdenv - use fetchFromGitHub instead of fetchzip for fetching the release from GitHub - the newest release is located in the subdirectory BeautyLine-V3, so we fetch only this folder via sparseCheckout and set it as source root - run preInstall and postInstall hooks in the installPhase - deduplicate files with jdupes - set dontPatchELF and dontRewriteSymlinks to true. These fixup steps are slow and unnecessary for this package. --- .../icons/beauty-line-icon-theme/default.nix | 39 +++++++++++++++---- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/pkgs/data/icons/beauty-line-icon-theme/default.nix b/pkgs/data/icons/beauty-line-icon-theme/default.nix index 3ed92f1965d9..d468f5a39b14 100644 --- a/pkgs/data/icons/beauty-line-icon-theme/default.nix +++ b/pkgs/data/icons/beauty-line-icon-theme/default.nix @@ -1,16 +1,32 @@ -{ lib, stdenvNoCC, fetchzip, breeze-icons, gtk3, gnome-icon-theme, hicolor-icon-theme, mint-x-icons, pantheon }: +{ lib +, stdenvNoCC +, fetchFromGitHub +, breeze-icons +, gtk3 +, gnome-icon-theme +, hicolor-icon-theme +, mint-x-icons +, pantheon +, jdupes +}: stdenvNoCC.mkDerivation rec { pname = "BeautyLine"; - version = "0.0.1"; + version = "0.0.4"; - src = fetchzip { - name = "${pname}-${version}"; - url = "https://github.com/gvolpe/BeautyLine/releases/download/${version}/BeautyLine.tar.gz"; - sha256 = "030bjk333fr9wm1nc740q8i31rfsgf3vg6cvz36xnvavx3q363l7"; + src = fetchFromGitHub { + owner = "gvolpe"; + repo = pname; + rev = version; + sparseCheckout = '' + BeautyLine-V3 + ''; + sha256 = "sha256-gFqGsni0tb5K/y0dzKmX9BirB3KCvqLkGyopBKf7ZwM="; }; - nativeBuildInputs = [ gtk3 ]; + sourceRoot = "${src.name}/BeautyLine-V3"; + + nativeBuildInputs = [ jdupes gtk3 ]; # ubuntu-mono is also required but missing in ubuntu-themes (please add it if it is packaged at some point) propagatedBuildInputs = [ @@ -23,10 +39,19 @@ stdenvNoCC.mkDerivation rec { dontDropIconThemeCache = true; + dontPatchELF = true; + dontRewriteSymlinks = true; + installPhase = '' + runHook preInstall + mkdir -p $out/share/icons/${pname} cp -r * $out/share/icons/${pname}/ gtk-update-icon-cache $out/share/icons/${pname} + + jdupes --link-soft --recurse $out/share + + runHook postInstall ''; meta = with lib; {