1{
2 lib,
3 stdenvNoCC,
4 fetchFromGitHub,
5}:
6let
7 font-awesome =
8 {
9 version,
10 hash,
11 rev ? version,
12 }:
13 stdenvNoCC.mkDerivation {
14 pname = "font-awesome";
15 inherit version;
16
17 src = fetchFromGitHub {
18 owner = "FortAwesome";
19 repo = "Font-Awesome";
20 inherit rev hash;
21 };
22
23 installPhase = ''
24 runHook preInstall
25
26 install -m444 -Dt $out/share/fonts/opentype {fonts,otfs}/*.otf
27
28 runHook postInstall
29 '';
30
31 meta = with lib; {
32 description = "Font Awesome - OTF font";
33 longDescription = ''
34 Font Awesome gives you scalable vector icons that can instantly be customized.
35 This package includes only the OTF font. For full CSS etc. see the project website.
36 '';
37 homepage = "https://fontawesome.com/";
38 license = licenses.ofl;
39 platforms = platforms.all;
40 maintainers = with maintainers; [
41 abaldeau
42 johnazoidberg
43 ];
44 };
45 };
46in
47{
48 # Keeping version 4 and 5 because version 6 is incompatible for some icons. That
49 # means that projects which depend on it need to actively convert the
50 # symbols. See:
51 # https://github.com/greshake/i3status-rust/issues/130
52 # https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4
53 # https://fontawesome.com/v6/docs/web/setup/upgrade/
54 v4 = font-awesome {
55 version = "4.7.0";
56 rev = "v4.7.0";
57 hash = "sha256-LL9zWFC+76wH74nqKszPQf2ZDfXq8BiH6tuiK43wYHA=";
58 };
59 v5 = font-awesome {
60 version = "5.15.4";
61 hash = "sha256-gd23ZplNY56sm1lfkU3kPXUOmNmY5SRnT0qlQZRNuBo=";
62 };
63 v6 = font-awesome {
64 version = "6.7.2";
65 hash = "sha256-MaJG96kYj8ukJVyqOTDpkHH/eWr/ZlbVKk9AvJM7ub4=";
66 };
67}