From d9701137114e237680138295bb5bf06fe9212173 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Wed, 12 Mar 2025 12:19:51 +0100 Subject: [PATCH] roboto: 2.138 -> 3.011, switch to variable version The old repository (https://github.com/google/roboto) has been archived by Google. --- pkgs/by-name/ro/roboto/package.nix | 41 ++++++++++-------------------- 1 file changed, 13 insertions(+), 28 deletions(-) diff --git a/pkgs/by-name/ro/roboto/package.nix b/pkgs/by-name/ro/roboto/package.nix index fe4a666fbc6a..c794da387728 100644 --- a/pkgs/by-name/ro/roboto/package.nix +++ b/pkgs/by-name/ro/roboto/package.nix @@ -2,52 +2,37 @@ lib, stdenvNoCC, fetchzip, - python3Packages, }: -stdenvNoCC.mkDerivation rec { +stdenvNoCC.mkDerivation (finalAttrs: { pname = "roboto"; - version = "2.138"; + version = "3.011"; src = fetchzip { - url = "https://github.com/google/roboto/releases/download/v${version}/roboto-unhinted.zip"; + url = "https://github.com/googlefonts/roboto-3-classic/releases/download/v${finalAttrs.version}/Roboto_v${finalAttrs.version}.zip"; stripRoot = false; - hash = "sha256-ue3PUZinBpcYgSho1Zrw1KHl7gc/GlN1GhWFk6g5QXE="; + hash = "sha256-Ko5x4zn/bhrFLuYktaAsqsWUsIOMfnxK8rZ4UiqK8ds="; }; - nativeBuildInputs = [ - python3Packages.fonttools - ]; - installPhase = '' runHook preInstall - # The RobotoCondensed fonts have a usWidthClass value of 5, which is - # incorrect. It should be 3. - # See the corresponding issue at https://github.com/googlefonts/roboto-3-classic/issues/130 - for file in RobotoCondensed*; do - fontname=$(echo $file | sed 's/\.ttf//') - ttx -v -o $fontname.xml $file - substituteInPlace $fontname.xml \ - --replace-fail "" "" - ttx --no-recalc-timestamp $fontname.xml -o $fontname.ttf - done - - install -Dm644 *.ttf -t $out/share/fonts/truetype + install -Dm644 unhinted/static/*.ttf -t $out/share/fonts/truetype runHook postInstall ''; meta = { - homepage = "https://github.com/google/roboto"; - description = "Roboto family of fonts"; + homepage = "https://github.com/googlefonts/roboto-3-classic"; + description = "This is a variable version of Roboto intended to be a 1:1 match with the official non-variable release from Google"; longDescription = '' - Google’s signature family of fonts, the default font on Android and - Chrome OS, and the recommended font for Google’s visual language, - Material Design. + This is not an official Google project, but was enabled with generous + funding by Google Fonts, who contracted Type Network. The Roboto family of + instances contained 6 weights and two widths of normal, along with italic + of the regular width. ''; - license = lib.licenses.asl20; + license = lib.licenses.ofl; platforms = lib.platforms.all; maintainers = [ lib.maintainers.romildo ]; }; -} +})