Commit e18aa0b1 authored by rczb's avatar rczb
Browse files

nerd-fonts: change pname, version and license schema

Fix issue #370117.
parent c4974366
Loading
Loading
Loading
Loading
+13 −9
Original line number Diff line number Diff line
@@ -17,11 +17,7 @@ let
    if builtins.match "[[:digit:]].*" lowerName != null then "_" + lowerName else lowerName;

  convertVersion =
    version: date:
    if builtins.match "[[:digit:]].*" version != null then
      version
    else
      "0-unstable-" + builtins.head (lib.strings.splitString "T" date);
    version: if builtins.match "[[:digit:]].*" version != null then "+" + version else "";

  convertLicense = import ./convert-license.nix lib;

@@ -36,8 +32,8 @@ let
      ...
    }:
    stdenvNoCC.mkDerivation {
      pname = lib.strings.toLower caskName;
      version = convertVersion version releaseInfo.published_at;
      pname = "nerd-fonts-" + lib.strings.toLower caskName;
      version = (lib.removePrefix "v" releaseInfo.tag_name) + convertVersion version;

      src =
        let
@@ -74,7 +70,15 @@ let

      meta = {
        description = "Nerd Fonts: " + description;
        license = convertLicense licenseId;
        license = lib.unique (
          (with lib.licenses; [
            # > Nerd Fonts source fonts, patched fonts, and folders with explict OFL SIL files
            ofl
            # > Nerd Fonts original source code files (such as `.sh`, `.py`, `font-patcher` and others)
            mit
          ])
          ++ lib.toList (convertLicense licenseId)
        );
        homepage = "https://nerdfonts.com/";
        changelog = "https://github.com/ryanoasis/nerd-fonts/blob/${releaseInfo.tag_name}/changelog.md";
        platforms = lib.platforms.all;
@@ -86,7 +90,7 @@ let
    };

  nerdFonts = lib.trivial.pipe fontsInfo [
    (map (font: lib.attrsets.nameValuePair (convertAttrName font.caskName) (makeNerdFont font)))
    (map (font: lib.nameValuePair (convertAttrName font.caskName) (makeNerdFont font)))
    builtins.listToAttrs
  ];
in
+1 −2
Original line number Diff line number Diff line
{
  "tag_name": "v3.3.0",
  "published_at": "2024-11-18T12:43:12Z"
  "tag_name": "v3.3.0"
}
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ os.chdir(os.path.join(os.path.dirname(os.path.abspath(__file__)), "manifests"))

release_info = slicedict(
    fetchjson(RELEASE_INFO_URL),
    ["tag_name", "published_at"]
    ["tag_name"]
)

tag_name = release_info["tag_name"]