summaryrefslogtreecommitdiffstats
path: root/pkgs/data/fonts/font-awesome/default.nix
blob: eae5c5b8fe2410a667cdb48a9adfadadc077ef7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{
  lib,
  stdenvNoCC,
  fetchFromGitHub,
  installFonts,
}:
let
  font-awesome =
    {
      version,
      hash,
      rev ? version,
    }:
    stdenvNoCC.mkDerivation (finalAttrs: {
      pname = "font-awesome";
      inherit version;

      src = fetchFromGitHub {
        owner = "FortAwesome";
        repo = "Font-Awesome";
        inherit rev hash;
      };

      nativeBuildInputs = [ installFonts ];
      dontInstallWebfonts = true;

      sourceRoot = "${finalAttrs.src.name}/${if version == "4.7.0" then "fonts" else "otfs"}";

      meta = {
        description = "Font Awesome - OTF font";
        longDescription = ''
          Font Awesome gives you scalable vector icons that can instantly be customized.
          This package includes only the OTF font. For full CSS etc. see the project website.
        '';
        homepage = "https://fontawesome.com/";
        license = lib.licenses.ofl;
        platforms = lib.platforms.all;
        maintainers = with lib.maintainers; [
          abaldeau
          johnazoidberg
        ];
      };
    });
in
{
  # Keeping version 4 and 5 because version 6 is incompatible for some icons. That
  # means that projects which depend on it need to actively convert the
  # symbols. See:
  # https://github.com/greshake/i3status-rust/issues/130
  # https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4
  # https://fontawesome.com/v6/docs/web/setup/upgrade/
  v4 = font-awesome {
    version = "4.7.0";
    rev = "v4.7.0";
    hash = "sha256-LL9zWFC+76wH74nqKszPQf2ZDfXq8BiH6tuiK43wYHA=";
  };
  v5 = font-awesome {
    version = "5.15.4";
    hash = "sha256-gd23ZplNY56sm1lfkU3kPXUOmNmY5SRnT0qlQZRNuBo=";
  };
  v6 = font-awesome {
    version = "6.7.2";
    hash = "sha256-MaJG96kYj8ukJVyqOTDpkHH/eWr/ZlbVKk9AvJM7ub4=";
  };
  v7 = font-awesome {
    version = "7.2.0";
    hash = "sha256-BTm78NCZXksCuzoXm2B39/UIB/Sb/wwL1vvaGRVUaio=";
  };
}