mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 16:03:23 +00:00
[Backport release-24.11] ibm-plex: 6.4.0 -> 1.1.0, add @ryanccn as maintainer (#357741)
This commit is contained in:
commit
ed0df42190
15
pkgs/by-name/ib/ibm-plex/hashes.nix
Normal file
15
pkgs/by-name/ib/ibm-plex/hashes.nix
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"serif" = "sha256-8ygaAeMKygYS4GCub4YUQmkh87pYHfi3s0PQ6AbaeGw=";
|
||||
"sans" = "sha256-mK+8GGl2ugF2+fS6yd3p5NWPHHcKEJWiShDS3lihOlI=";
|
||||
"sans-condensed" = "sha256-/aJTXmrHuoPSrtCKNodBY7I0CriayNTx5LCXw+/MFvE=";
|
||||
"sans-arabic" = "sha256-qi4k7kMLftIuq87idyxq46FOD6QYycdG6j3zJmu8mhI=";
|
||||
"sans-devanagari" = "sha256-K57OVqcH5r9tZx8NFEoz1P3xpUooqpF7xxJzNmnObwE=";
|
||||
"sans-thai" = "sha256-JZVbvZdj+IfBthiqivOXHrvAUe392M9ECGsiJkm0saE=";
|
||||
"sans-thai-looped" = "sha256-cry/Ctwt1bsrdbvWkJIYWLjsvV6a1lLFsT85znqERnw=";
|
||||
"sans-tc" = "sha256-kZvzSK6fEjfVMR4kxC4lxtD7GskqvJZx8BBJVT4T9MU=";
|
||||
"sans-kr" = "sha256-FsHxMvLlI4yylgG96DOZIdW2DYpk7I+c5QgkVIkNZIE=";
|
||||
"sans-jp" = "sha256-hUl/SSkN6q3pDTtrY2mJepw3ljhhLJskGbxfsTl9TuI=";
|
||||
"sans-hebrew" = "sha256-rTuBQYLI+6gEFTumCdaWpeoLzRoyFSmqWbXziq+UG6I=";
|
||||
"mono" = "sha256-OwUmrPfEehLDz0fl2ChYLK8FQM2p0G1+EMrGsYEq+6g=";
|
||||
"math" = "sha256-dJA6uqxa/yb3eLY4l39NeP0yIl2NfrbaRpf6h0/F7Xc=";
|
||||
}
|
@ -1,28 +1,51 @@
|
||||
{ lib, stdenvNoCC, fetchzip }:
|
||||
{
|
||||
lib,
|
||||
stdenvNoCC,
|
||||
fetchzip,
|
||||
families ? [ ],
|
||||
}:
|
||||
let
|
||||
version = import ./version.nix;
|
||||
availableFamilies = import ./hashes.nix;
|
||||
|
||||
stdenvNoCC.mkDerivation rec {
|
||||
availableFamilyNames = builtins.attrNames availableFamilies;
|
||||
selectedFamilies = if (families == [ ]) then availableFamilyNames else families;
|
||||
|
||||
unknownFamilies = lib.subtractLists availableFamilyNames families;
|
||||
in
|
||||
assert lib.assertMsg (unknownFamilies == [ ]) "Unknown font(s): ${toString unknownFamilies}";
|
||||
stdenvNoCC.mkDerivation {
|
||||
pname = "ibm-plex";
|
||||
version = "6.4.0";
|
||||
inherit version;
|
||||
|
||||
src = fetchzip {
|
||||
url = "https://github.com/IBM/plex/releases/download/v${version}/OpenType.zip";
|
||||
hash = "sha256-/aR3bu03VxenSPed6EqrGoPjWCcKT//MVtb9OC8tSRs=";
|
||||
};
|
||||
srcs = builtins.map (
|
||||
family:
|
||||
fetchzip {
|
||||
url = "https://github.com/IBM/plex/releases/download/%40ibm%2Fplex-${family}%40${version}/ibm-plex-${family}.zip";
|
||||
hash = availableFamilies.${family};
|
||||
}
|
||||
) selectedFamilies;
|
||||
|
||||
dontUnpack = true;
|
||||
sourceRoot = ".";
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
install -Dm644 */*.otf IBM-Plex-Sans-JP/unhinted/* -t $out/share/fonts/opentype
|
||||
|
||||
find $srcs -type f -name '*.otf' -exec install -Dm644 {} -t $out/share/fonts/opentype \;
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru.updateScript = ./update.sh;
|
||||
|
||||
meta = with lib; {
|
||||
description = "IBM Plex Typeface";
|
||||
homepage = "https://www.ibm.com/plex/";
|
||||
changelog = "https://github.com/IBM/plex/raw/v${version}/CHANGELOG.md";
|
||||
license = licenses.ofl;
|
||||
platforms = platforms.all;
|
||||
maintainers = [ maintainers.romildo ];
|
||||
maintainers = with maintainers; [
|
||||
romildo
|
||||
ryanccn
|
||||
];
|
||||
};
|
||||
}
|
||||
|
42
pkgs/by-name/ib/ibm-plex/update.sh
Executable file
42
pkgs/by-name/ib/ibm-plex/update.sh
Executable file
@ -0,0 +1,42 @@
|
||||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell -i bash -p nix nix-prefetch jq
|
||||
# shellcheck shell=bash
|
||||
set -eo pipefail
|
||||
|
||||
families=(
|
||||
"serif"
|
||||
"sans"
|
||||
"sans-condensed"
|
||||
"sans-arabic"
|
||||
"sans-devanagari"
|
||||
"sans-thai"
|
||||
"sans-thai-looped"
|
||||
"sans-tc"
|
||||
"sans-kr"
|
||||
"sans-jp"
|
||||
"sans-hebrew"
|
||||
"mono"
|
||||
"math"
|
||||
)
|
||||
|
||||
version=$(curl --silent 'https://api.github.com/repos/IBM/plex/releases/latest' | jq -r '.tag_name | sub("^@ibm/[\\w-]+@"; "")')
|
||||
|
||||
dirname="$(dirname "$0")"
|
||||
echo \""${version}"\" >"$dirname/version-new.nix"
|
||||
if diff -q "$dirname/version-new.nix" "$dirname/version.nix"; then
|
||||
echo No new version available, current: "$version"
|
||||
rm "$dirname/version-new.nix"
|
||||
exit 0
|
||||
else
|
||||
echo Updated to version "$version"
|
||||
mv "$dirname/version-new.nix" "$dirname/version.nix"
|
||||
fi
|
||||
|
||||
printf '{\n' > "$dirname/hashes.nix"
|
||||
|
||||
for family in "${families[@]}"; do
|
||||
url="https://github.com/IBM/plex/releases/download/%40ibm%2Fplex-${family}%40${version}/ibm-plex-${family}.zip"
|
||||
printf ' "%s" = "%s";\n' "$family" "$(nix-prefetch-url --unpack "$url" | xargs nix hash convert --hash-algo sha256)" >>"$dirname/hashes.nix"
|
||||
done
|
||||
|
||||
printf '}\n' >> "$dirname/hashes.nix"
|
1
pkgs/by-name/ib/ibm-plex/version.nix
Normal file
1
pkgs/by-name/ib/ibm-plex/version.nix
Normal file
@ -0,0 +1 @@
|
||||
"1.1.0"
|
Loading…
Reference in New Issue
Block a user