nerd-fonts: change pname, version and license schema

Fix issue #370117.
This commit is contained in:
rczb
2025-01-02 21:07:12 +08:00
parent c49743669a
commit e18aa0b180
3 changed files with 15 additions and 12 deletions
+13 -9
View File
@@ -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,4 +1,3 @@
{
"tag_name": "v3.3.0",
"published_at": "2024-11-18T12:43:12Z"
"tag_name": "v3.3.0"
}
+1 -1
View File
@@ -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"]