2024-06-30 08:16:52 +00:00
|
|
|
{
|
|
|
|
fetchFromGitHub,
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fontforge,
|
|
|
|
perl,
|
|
|
|
perlPackages,
|
|
|
|
}:
|
2024-05-02 00:46:19 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
version = "2.37";
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A typeface family based on the Bitstream Vera fonts";
|
|
|
|
longDescription = ''
|
|
|
|
The DejaVu fonts are TrueType fonts based on the BitStream Vera fonts,
|
|
|
|
providing more styles and with greater coverage of Unicode.
|
|
|
|
|
|
|
|
This package includes DejaVu Sans, DejaVu Serif, DejaVu Sans Mono, and
|
|
|
|
the TeX Gyre DejaVu Math font.
|
|
|
|
'';
|
|
|
|
homepage = "https://dejavu-fonts.github.io/";
|
|
|
|
|
|
|
|
# Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved.
|
|
|
|
# Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved.
|
|
|
|
# DejaVu changes are in public domain
|
|
|
|
# See http://dejavu-fonts.org/wiki/License for details
|
|
|
|
license = lib.licenses.free;
|
|
|
|
|
|
|
|
platforms = lib.platforms.all;
|
|
|
|
};
|
|
|
|
|
|
|
|
full-ttf = stdenv.mkDerivation {
|
|
|
|
pname = "dejavu-fonts-full";
|
|
|
|
inherit version;
|
2024-06-30 08:16:52 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
fontforge
|
|
|
|
perl
|
|
|
|
perlPackages.IOString
|
|
|
|
perlPackages.FontTTF
|
|
|
|
];
|
2024-05-02 00:46:19 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dejavu-fonts";
|
|
|
|
repo = "dejavu-fonts";
|
2024-06-30 08:16:52 +00:00
|
|
|
rev = "version_${lib.replaceStrings [ "." ] [ "_" ] version}";
|
2024-05-02 00:46:19 +00:00
|
|
|
sha256 = "1xknlg2h287dx34v2n5r33bpcl4biqf0cv7nak657rjki7s0k4bk";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildFlags = [ "full-ttf" ];
|
|
|
|
|
|
|
|
preBuild = "patchShebangs scripts";
|
|
|
|
|
|
|
|
installPhase = "install -m444 -Dt $out/share/fonts/truetype build/*.ttf";
|
|
|
|
|
|
|
|
inherit meta;
|
|
|
|
};
|
|
|
|
|
|
|
|
minimal = stdenv.mkDerivation {
|
|
|
|
pname = "dejavu-fonts-minimal";
|
|
|
|
inherit version;
|
|
|
|
buildCommand = ''
|
|
|
|
install -m444 -Dt $out/share/fonts/truetype ${full-ttf}/share/fonts/truetype/DejaVuSans.ttf
|
|
|
|
'';
|
|
|
|
inherit meta;
|
|
|
|
};
|
2024-06-30 08:16:52 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
2024-05-02 00:46:19 +00:00
|
|
|
pname = "dejavu-fonts";
|
|
|
|
inherit version;
|
|
|
|
buildCommand = ''
|
|
|
|
install -m444 -Dt $out/share/fonts/truetype ${full-ttf}/share/fonts/truetype/*.ttf
|
|
|
|
ln -s --relative --force --target-directory=$out/share/fonts/truetype ${minimal}/share/fonts/truetype/DejaVuSans.ttf
|
|
|
|
'';
|
|
|
|
inherit meta;
|
|
|
|
|
2024-06-30 08:16:52 +00:00
|
|
|
passthru = {
|
|
|
|
inherit minimal full-ttf;
|
|
|
|
};
|
2024-05-02 00:46:19 +00:00
|
|
|
}
|