Unverified Commit 3f7fcbb2 authored by jopejoe1's avatar jopejoe1 Committed by GitHub
Browse files

Merge pull request #290014 from jopejoe1/ubuntu-font

ubuntu-sans{,-mono}: rename from ubuntu_font_family, 0.83 -> 1.004
parents b37088de b3c8c0e4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -224,7 +224,7 @@ in
      # Default Fonts
      fonts.packages = with pkgs; [
        dejavu_fonts # Default monospace font in LMDE 6+
        ubuntu_font_family # required for default theme
        ubuntu-classic # required for default theme
      ];
    })

+1 −1
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@ in

    environment.etc."X11/xkb".source = xcfg.xkb.dir;

    fonts.packages = [ pkgs.dejavu_fonts pkgs.ubuntu_font_family ];
    fonts.packages = [ pkgs.dejavu_fonts ];

    services.udisks2.enable = true;
    services.upower.enable = config.powerManagement.enable;
+2 −2
Original line number Diff line number Diff line
@@ -71,8 +71,8 @@ in
      font = {
        package = mkOption {
          type = types.package;
          default = pkgs.ubuntu_font_family;
          defaultText = literalExpression "pkgs.ubuntu_font_family";
          default = pkgs.ubuntu-classic;
          defaultText = literalExpression "pkgs.ubuntu-classic";
          description = ''
            The package path that contains the font given in the name option.
          '';
+41 −0
Original line number Diff line number Diff line
{ lib, stdenvNoCC, fetchzip }:
{
  lib,
  stdenvNoCC,
  fetchgit,
  gitUpdater,
  rename,
}:

stdenvNoCC.mkDerivation rec {
  pname = "ubuntu-font-family";
  version = "0.83";
stdenvNoCC.mkDerivation (finalAttrs: {
  pname = "ubuntu-classic";
  version = "0.83-6ubuntu2";

  src = fetchzip {
    url = "https://assets.ubuntu.com/v1/fad7939b-ubuntu-font-family-${version}.zip";
    hash = "sha256-FAg1xn8Gcbwmuvqtg9SquSet4oTT9nqE+Izeq7ZMVcA=";
  src = fetchgit {
    url = "https://git.launchpad.net/ubuntu/+source/fonts-ubuntu-classic";
    rev = "import/${finalAttrs.version}";
    hash = "sha256-GrpBVgisVu7NklFYqkEqYi0hui/pCHlsM3Ky4mEUq90=";
  };

  installPhase = ''
    runHook preInstall

    mkdir -p $out/share/fonts/ubuntu
    mv *.ttf $out/share/fonts/ubuntu
    install -m444 -Dt $out/share/fonts/truetype/ubuntu *.ttf

    runHook postInstall
  '';

  passthru.updateScript = gitUpdater { rev-prefix = "import/"; };

  meta = with lib; {
    description = "Ubuntu Font Family";
    description = "Ubuntu Classic font";
    longDescription = "The Ubuntu typeface has been specially
    created to complement the Ubuntu tone of voice. It has a
    contemporary style and contains characteristics unique to
    the Ubuntu brand that convey a precise, reliable and free attitude.";
    homepage = "http://font.ubuntu.com/";
    homepage = "https://design.ubuntu.com/font";
    changelog = "https://git.launchpad.net/ubuntu/+source/fonts-ubuntu-classic/tree/FONTLOG.txt?h=${finalAttrs.src.rev}";
    license = licenses.ufl;
    platforms = platforms.all;
    maintainers = [ maintainers.antono ];
    maintainers = with maintainers; [ bobby285271 ];
  };
}
})
+43 −0
Original line number Diff line number Diff line
{
  lib,
  stdenvNoCC,
  fetchFromGitHub,
  gitUpdater,
  rename,
}:

stdenvNoCC.mkDerivation (finalAttrs: {
  pname = "ubuntu-sans-mono";
  version = "1.004";

  src = fetchFromGitHub {
    owner = "canonical";
    repo = "Ubuntu-Sans-Mono-fonts";
    rev = "v${finalAttrs.version}";
    hash = "sha256-IjfjFsXRYK2l6i4Q/LoYuwu5t18TmVXXJQDSsW45qNc=";
  };

  installPhase = ''
    runHook preInstall

    install -m444 -Dt $out/share/fonts/truetype/ubuntu-sans fonts/variable/*
    ${rename}/bin/rename 's/\[.*\]//' $out/share/fonts/truetype/ubuntu-sans/*

    runHook postInstall
  '';

  passthru.updateScript = gitUpdater { rev-prefix = "v"; };

  meta = with lib; {
    description = "Ubuntu Font Family (Mono)";
    longDescription = "The Ubuntu Font Family are a set of matching libre/open fonts.
    The fonts were originally developed in 2010–2011,
    further expanded and improved in 2015,
    and expanded again in 2022–2023 when variable fonts were added.";
    homepage = "https://design.ubuntu.com/font";
    changelog = "https://github.com/canonical/Ubuntu-Sans-Mono-fonts/blob/${finalAttrs.src.rev}/FONTLOG.txt";
    license = licenses.ufl;
    platforms = platforms.all;
    maintainers = with maintainers; [ jopejoe1 ];
  };
})
Loading