font-awesome: convert to stdenvNoCC.mkDerivation

This commit is contained in:
Weijia Wang 2023-01-30 22:32:35 +01:00
parent 41b23132eb
commit ae066baf77

View File

@ -1,22 +1,23 @@
{ lib, fetchFromGitHub }:
{ lib, stdenvNoCC, fetchFromGitHub }:
let
font-awesome = { version, sha256, rev ? version }: fetchFromGitHub {
name = "font-awesome-${version}";
font-awesome = { version, hash, rev ? version }: stdenvNoCC.mkDerivation {
pname = "font-awesome";
inherit version;
src = fetchFromGitHub {
owner = "FortAwesome";
repo = "Font-Awesome";
inherit rev hash;
};
owner = "FortAwesome";
repo = "Font-Awesome";
inherit rev;
installPhase = ''
runHook preInstall
postFetch = ''
install -m444 -Dt $out/share/fonts/opentype $out/{fonts,otfs}/*.otf
shopt -s extglob dotglob
rm -rf $out/!(share)
shopt -u extglob dotglob
install -m444 -Dt $out/share/fonts/opentype {fonts,otfs}/*.otf
runHook postInstall
'';
inherit sha256;
meta = with lib; {
description = "Font Awesome - OTF font";
longDescription = ''
@ -40,14 +41,14 @@ in
v4 = font-awesome {
version = "4.7.0";
rev = "v4.7.0";
sha256 = "sha256-qdrIwxAB+z+4PXrKrj6bBuiJY0DYQuHm2DRng5sYEck=";
hash = "sha256-LL9zWFC+76wH74nqKszPQf2ZDfXq8BiH6tuiK43wYHA=";
};
v5 = font-awesome {
version = "5.15.3";
sha256 = "sha256-EDxk/yO3nMmtM/ytrAEgPYSBbep3rA3NrKkiqf3OsU0=";
hash = "sha256-CFXGsl70o/gXUCEKu8Wkv4EBRhrrcMIq8NpfWzcxEus=";
};
v6 = font-awesome {
version = "6.1.1";
sha256 = "sha256-BjK1PJQFWtKDvfQ2Vh7BoOPqYucyvOG+2Pu/Kh+JpAA=";
hash = "sha256-rujqhKI33Pi2xugMKGoTJDkPkCDK407+Da6yNJP2yAc=";
};
}