Unverified Commit b66c90b6 authored by Kenichi Kamiya's avatar Kenichi Kamiya
Browse files

plemoljp, plemoljp-{nf,hs}: refine updateScript

* Share `version` and `meta` in font variants
  While fonts have fewer restrictions than executables,
  the motivation is essentially the same as 900ebdb9.
  There is no reason to update these packages individually.

* Add `updateScript`
  Upstream used `-beta*` tags for the 2.0.0 release.
  The script now only targets tags for stable versions.

* Prefer `finalAttrs` over `rec`'
  I included this modernization in the same commit
  because it relates to the version reference.
parent f77d533e
Loading
Loading
Loading
Loading
+9 −10
Original line number Diff line number Diff line
{
  lib,
  stdenvNoCC,
  fetchzip,
  plemoljp,
}:

stdenvNoCC.mkDerivation rec {
stdenvNoCC.mkDerivation (finalAttrs: {
  pname = "plemoljp-hs";
  version = "3.0.0";

  # plemoljp's updateScript also updates this version.
  # nixpkgs-update: no auto update
  inherit (plemoljp) version;

  src = fetchzip {
    url = "https://github.com/yuru7/PlemolJP/releases/download/v${version}/PlemolJP_HS_v${version}.zip";
    url = "https://github.com/yuru7/PlemolJP/releases/download/v${finalAttrs.version}/PlemolJP_HS_v${finalAttrs.version}.zip";
    hash = "sha256-V21T8ktNZE4nq3SH6aN9iIJHmGTkZuMsvT84yHbwSqI=";
  };

@@ -24,11 +27,7 @@ stdenvNoCC.mkDerivation rec {
    runHook postInstall
  '';

  meta = {
  meta = plemoljp.meta // {
    description = "Composite font of IBM Plex Mono, IBM Plex Sans JP and hidden full-width space";
    homepage = "https://github.com/yuru7/PlemolJP";
    license = lib.licenses.ofl;
    platforms = lib.platforms.all;
    maintainers = with lib.maintainers; [ kachick ];
  };
}
})
+9 −10
Original line number Diff line number Diff line
{
  lib,
  stdenvNoCC,
  fetchzip,
  plemoljp,
}:

stdenvNoCC.mkDerivation rec {
stdenvNoCC.mkDerivation (finalAttrs: {
  pname = "plemoljp-nf";
  version = "3.0.0";

  # plemoljp's updateScript also updates this version.
  # nixpkgs-update: no auto update
  inherit (plemoljp) version;

  src = fetchzip {
    url = "https://github.com/yuru7/PlemolJP/releases/download/v${version}/PlemolJP_NF_v${version}.zip";
    url = "https://github.com/yuru7/PlemolJP/releases/download/v${finalAttrs.version}/PlemolJP_NF_v${finalAttrs.version}.zip";
    hash = "sha256-m8zR9ySl88DnVzG4fKJtc9WjSLDMLU4YDX+KXhcP2WU=";
  };

@@ -22,11 +25,7 @@ stdenvNoCC.mkDerivation rec {
    runHook postInstall
  '';

  meta = {
  meta = plemoljp.meta // {
    description = "Composite font of IBM Plex Mono, IBM Plex Sans JP and nerd-fonts";
    homepage = "https://github.com/yuru7/PlemolJP";
    license = lib.licenses.ofl;
    platforms = lib.platforms.all;
    maintainers = with lib.maintainers; [ kachick ];
  };
}
})
+10 −3
Original line number Diff line number Diff line
@@ -2,14 +2,15 @@
  lib,
  stdenvNoCC,
  fetchzip,
  nix-update-script,
}:

stdenvNoCC.mkDerivation rec {
stdenvNoCC.mkDerivation (finalAttrs: {
  pname = "plemoljp";
  version = "3.0.0";

  src = fetchzip {
    url = "https://github.com/yuru7/PlemolJP/releases/download/v${version}/PlemolJP_v${version}.zip";
    url = "https://github.com/yuru7/PlemolJP/releases/download/v${finalAttrs.version}/PlemolJP_v${finalAttrs.version}.zip";
    hash = "sha256-R4zC1pnM72FVqBQ5d03z8vyVccsM163BE15m2hdEnSA=";
  };

@@ -24,6 +25,12 @@ stdenvNoCC.mkDerivation rec {
    runHook postInstall
  '';

  passthru = {
    updateScript = nix-update-script {
      extraArgs = [ "--version-regex=^v([0-9.]+)$" ];
    };
  };

  meta = {
    description = "Composite font of IBM Plex Mono and IBM Plex Sans JP";
    homepage = "https://github.com/yuru7/PlemolJP";
@@ -31,4 +38,4 @@ stdenvNoCC.mkDerivation rec {
    platforms = lib.platforms.all;
    maintainers = with lib.maintainers; [ kachick ];
  };
}
})