From 023a9bf29bc7b2c2ab62d50741755b056c84cb86 Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Fri, 1 Jul 2022 21:59:27 +0200 Subject: [PATCH 1/2] iosevka-comfy: Add passthru.updateScript --- pkgs/data/fonts/iosevka/comfy.nix | 5 ++++ pkgs/data/fonts/iosevka/update-comfy.sh | 33 +++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100755 pkgs/data/fonts/iosevka/update-comfy.sh diff --git a/pkgs/data/fonts/iosevka/comfy.nix b/pkgs/data/fonts/iosevka/comfy.nix index 9cc2ecfb6368..fa548f645b14 100644 --- a/pkgs/data/fonts/iosevka/comfy.nix +++ b/pkgs/data/fonts/iosevka/comfy.nix @@ -5,6 +5,11 @@ let privateBuildPlan = builtins.readFile ./comfy-private-build-plans.toml; overrideAttrs = (attrs: { version = "0.1.0"; + + passthru = { + updateScript = ./update-comfy.sh; + }; + meta = with lib; { homepage = "https://github.com/protesilaos/iosevka-comfy"; description = '' diff --git a/pkgs/data/fonts/iosevka/update-comfy.sh b/pkgs/data/fonts/iosevka/update-comfy.sh new file mode 100755 index 000000000000..63e68c768dd9 --- /dev/null +++ b/pkgs/data/fonts/iosevka/update-comfy.sh @@ -0,0 +1,33 @@ +#! /usr/bin/env nix-shell +#! nix-shell -i bash -p curl jq + +set -euo pipefail +cd "$(dirname "${BASH_SOURCE[0]}")" + +repo=protesilaos/iosevka-comfy +oldVersion=$(nix-instantiate --eval -E 'with import ../../../.. {}; lib.getVersion iosevka-comfy.comfy' | tr -d \") +version=$(curl -s https://api.github.com/repos/$repo/tags | jq '.[0].name' | tr -d \") +buildPlansUrl=https://raw.githubusercontent.com/$repo/$(echo $version)/private-build-plans.toml + +if test "$oldVersion" = "$version"; then + echo "New version same as old version, nothing to do." >&2 + exit 0 +fi + +sed --in-place "s/$oldVersion/$version/" comfy.nix + +cat > ./comfy-private-build-plans.toml <> ./comfy-private-build-plans.toml + +sets=$(grep '^\[buildPlans\.iosevka-comfy[^.]*\]' comfy-private-build-plans.toml \ + | sed 's/^.*iosevka-\(comfy[^]]*\)].*$/"\1" /' \ + | tr -d '\n' \ + | sort) + +sed --in-place "s/sets = .*$/sets = [ $sets];/" comfy.nix From bae6a92d4feb2bef4aa6a3da9097199d1d6897a1 Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Fri, 1 Jul 2022 22:00:00 +0200 Subject: [PATCH 2/2] iosevka-comfy: 0.1.0 -> 0.2.1 --- .../iosevka/comfy-private-build-plans.toml | 34 +++++++++++++++---- pkgs/data/fonts/iosevka/comfy.nix | 4 +-- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/pkgs/data/fonts/iosevka/comfy-private-build-plans.toml b/pkgs/data/fonts/iosevka/comfy-private-build-plans.toml index d5b0221a64aa..1affc3a8c84d 100644 --- a/pkgs/data/fonts/iosevka/comfy-private-build-plans.toml +++ b/pkgs/data/fonts/iosevka/comfy-private-build-plans.toml @@ -1,5 +1,5 @@ # The file below is copy/pasted from -# https://github.com/protesilaos/iosevka-comfy/blob/0.1.0/private-build-plans.toml. It +# https://raw.githubusercontent.com/protesilaos/iosevka-comfy/0.2.1/private-build-plans.toml. It # seems like ofborg will prevent me from using fetchurl to download # this file automatically. [buildPlans.iosevka-comfy] # is your plan name @@ -303,9 +303,19 @@ serifs = "sans" [buildPlans.iosevka-comfy-duo.variants] inherits = "buildPlans.iosevka-comfy" -# The short middle leg in 'm' that we need in the narrow monospaced -# variants is necessary for legibility, especially at small point sizes. -# Otherwise it is a gimmick, so we remove it in the "wider" builds. +# The '0' has a forward slash that cuts diagonally through the middle of +# the circle, connecting the bottom left part to the top right of the +# oval shape. Whereas the narrow variants have a dashed forward slash +# which does not connect the two sides as it is positioned inside the +# oval shape. +[buildPlans.iosevka-comfy-duo.variants.design] +cv71 = 9 # 0 oval forward slash + +# The 'm' character has three legs of equal length, insetad of a shorter +# middle leg. The short middle leg in the narrow variants is necessary +# for legibility, especially at small point sizes (otherwise the +# character's legs visually blend into what appears to be a solid +# block). [buildPlans.iosevka-comfy-duo.variants.upright] cv38 = 5 # m earless normal middle leg @@ -371,9 +381,19 @@ serifs = "sans" [buildPlans.iosevka-comfy-wide.variants] inherits = "buildPlans.iosevka-comfy" -# The short middle leg in 'm' that we need in the narrow monospaced -# variants is necessary for legibility, especially at small point sizes. -# Otherwise it is a gimmick, so we remove it in the "wider" builds. +# The '0' has a forward slash that cuts diagonally through the middle of +# the circle, connecting the bottom left part to the top right of the +# oval shape. Whereas the narrow variants have a dashed forward slash +# which does not connect the two sides as it is positioned inside the +# oval shape. +[buildPlans.iosevka-comfy-wide.variants.design] +cv71 = 9 # 0 oval forward slash + +# The 'm' character has three legs of equal length, insetad of a shorter +# middle leg. The short middle leg in the narrow variants is necessary +# for legibility, especially at small point sizes (otherwise the +# character's legs visually blend into what appears to be a solid +# block). [buildPlans.iosevka-comfy-wide.variants.upright] cv38 = 5 # m earless normal middle leg diff --git a/pkgs/data/fonts/iosevka/comfy.nix b/pkgs/data/fonts/iosevka/comfy.nix index fa548f645b14..3e42151857f1 100644 --- a/pkgs/data/fonts/iosevka/comfy.nix +++ b/pkgs/data/fonts/iosevka/comfy.nix @@ -1,10 +1,10 @@ {stdenv, lib, nodejs, nodePackages, remarshal, ttfautohint-nox, fetchurl}: let - sets = [ "comfy" "comfy-duo" "comfy-wide" "comfy-wide-fixed"]; + sets = [ "comfy" "comfy-fixed" "comfy-duo" "comfy-wide" "comfy-wide-fixed" ]; privateBuildPlan = builtins.readFile ./comfy-private-build-plans.toml; overrideAttrs = (attrs: { - version = "0.1.0"; + version = "0.2.1"; passthru = { updateScript = ./update-comfy.sh;