From 914a9ca2c8a0d2cc934bc8a63589346828cd2c75 Mon Sep 17 00:00:00 2001 From: isabel Date: Tue, 28 May 2024 10:56:32 +0100 Subject: catppuccin-cursors: 0.2.0 -> 0.2.1 --- pkgs/by-name/ca/catppuccin-cursors/package.nix | 76 ++++++++++++++++++++++++++ pkgs/data/icons/catppuccin-cursors/default.nix | 65 ---------------------- pkgs/top-level/all-packages.nix | 2 - 3 files changed, 76 insertions(+), 67 deletions(-) create mode 100644 pkgs/by-name/ca/catppuccin-cursors/package.nix delete mode 100644 pkgs/data/icons/catppuccin-cursors/default.nix (limited to 'pkgs') diff --git a/pkgs/by-name/ca/catppuccin-cursors/package.nix b/pkgs/by-name/ca/catppuccin-cursors/package.nix new file mode 100644 index 0000000000000..d43c1e4116602 --- /dev/null +++ b/pkgs/by-name/ca/catppuccin-cursors/package.nix @@ -0,0 +1,76 @@ +{ lib +, stdenvNoCC +, fetchFromGitHub +, inkscape +, just +, xcursorgen +}: + +let + dimensions = { + palette = [ "frappe" "latte" "macchiato" "mocha" ]; + color = [ "Blue" "Dark" "Flamingo" "Green" "Lavender" "Light" "Maroon" "Mauve" "Peach" "Pink" "Red" "Rosewater" "Sapphire" "Sky" "Teal" "Yellow" ]; + }; + variantName = { palette, color }: palette + color; + variants = lib.mapCartesianProduct variantName dimensions; + version = "0.2.1"; +in +stdenvNoCC.mkDerivation { + pname = "catppuccin-cursors"; + inherit version; + + src = fetchFromGitHub { + owner = "catppuccin"; + repo = "cursors"; + rev = "v${version}"; + hash = "sha256-aQfbziN5z62LlgVq4CNMXVMmTrzChFgWUMAmO/2/z3Y="; + }; + + nativeBuildInputs = [ just inkscape xcursorgen ]; + + outputs = variants ++ [ "out" ]; # dummy "out" output to prevent breakage + + outputsToInstall = []; + + buildPhase = '' + runHook preBuild + + patchShebangs . + + just all + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + for output in $(getAllOutputNames); do + if [ "$output" != "out" ]; then + local outputDir="''${!output}" + local iconsDir="$outputDir"/share/icons + + mkdir -p "$iconsDir" + + # Convert to kebab case with the first letter of each word capitalized + local variant=$(sed 's/\([A-Z]\)/-\1/g' <<< "$output") + local variant=''${variant,,} + + mv "dist/catppuccin-$variant-cursors" "$iconsDir" + fi + done + + # Needed to prevent breakage + mkdir -p "$out" + + runHook postInstall + ''; + + meta = { + description = "Catppuccin cursor theme based on Volantes"; + homepage = "https://github.com/catppuccin/cursors"; + license = lib.licenses.gpl2; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ dixslyf ]; + }; +} diff --git a/pkgs/data/icons/catppuccin-cursors/default.nix b/pkgs/data/icons/catppuccin-cursors/default.nix deleted file mode 100644 index eeb9dd3227f07..0000000000000 --- a/pkgs/data/icons/catppuccin-cursors/default.nix +++ /dev/null @@ -1,65 +0,0 @@ -{ lib -, stdenvNoCC -, fetchFromGitHub -, unzip -}: - -let - dimensions = { - palette = [ "Frappe" "Latte" "Macchiato" "Mocha" ]; - color = [ "Blue" "Dark" "Flamingo" "Green" "Lavender" "Light" "Maroon" "Mauve" "Peach" "Pink" "Red" "Rosewater" "Sapphire" "Sky" "Teal" "Yellow" ]; - }; - variantName = { palette, color }: (lib.strings.toLower palette) + color; - variants = lib.mapCartesianProduct variantName dimensions; -in -stdenvNoCC.mkDerivation rec { - pname = "catppuccin-cursors"; - version = "0.2.0"; - dontBuild = true; - - src = fetchFromGitHub { - owner = "catppuccin"; - repo = "cursors"; - rev = "v${version}"; - sha256 = "sha256-TgV5f8+YWR+h61m6WiBMg3aBFnhqShocZBdzZHSyU2c="; - sparseCheckout = [ "cursors" ]; - }; - - nativeBuildInputs = [ unzip ]; - - outputs = variants ++ [ "out" ]; # dummy "out" output to prevent breakage - - outputsToInstall = []; - - installPhase = '' - runHook preInstall - - for output in $(getAllOutputNames); do - if [ "$output" != "out" ]; then - local outputDir="''${!output}" - local iconsDir="$outputDir"/share/icons - - mkdir -p "$iconsDir" - - # Convert to kebab case with the first letter of each word capitalized - local variant=$(sed 's/\([A-Z]\)/-\1/g' <<< "$output") - local variant=''${variant^} - - unzip "cursors/Catppuccin-$variant-Cursors.zip" -d "$iconsDir" - fi - done - - # Needed to prevent breakage - mkdir -p "$out" - - runHook postInstall - ''; - - meta = with lib; { - description = "Catppuccin cursor theme based on Volantes"; - homepage = "https://github.com/catppuccin/cursors"; - license = licenses.gpl2; - platforms = platforms.linux; - maintainers = with maintainers; [ dixslyf ]; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 79dca219819a9..550ea3a5403f5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -28311,8 +28311,6 @@ with pkgs; cascadia-code = callPackage ../data/fonts/cascadia-code { }; - catppuccin-cursors = callPackage ../data/icons/catppuccin-cursors { }; - ccsymbols = callPackage ../data/fonts/ccsymbols { }; charis-sil = callPackage ../data/fonts/charis-sil { }; -- cgit 1.4.1