nixpkgs/pkgs/by-name/ju/junicode/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

52 lines
1.5 KiB
Nix

{ lib, stdenvNoCC, fetchzip, texlive, callPackage }:
stdenvNoCC.mkDerivation rec {
pname = "junicode";
version = "2.209";
src = fetchzip {
url = "https://github.com/psb1558/Junicode-font/releases/download/v${version}/Junicode_${version}.zip";
hash = "sha256-hdCDLwTiyE2ZpFgmYAX7YWCujUwozIozD+k/lCStJUg=";
};
outputs = [ "out" "doc" "tex" ];
patches = [ ./tex-font-path.patch ];
postPatch = ''
substituteInPlace TeX/junicode.sty \
--replace '@@@opentype_path@@@' "$out/share/fonts/opentype/" \
--replace '@@@truetype_path@@@' "$out/share/fonts/truetype/"
substituteInPlace TeX/junicodevf.sty \
--replace '@@@truetype_path@@@' "$out/share/fonts/truetype/"
'';
installPhase = ''
runHook preInstall
install -Dm 444 -t $out/share/fonts/truetype TTF/*.ttf VAR/*.ttf
install -Dm 444 -t $out/share/fonts/opentype OTF/*.otf
install -Dm 444 -t $out/share/fonts/woff2 WOFF2/*.woff2
install -Dm 444 -t $doc/share/doc/${pname}-${version} docs/*.pdf
install -Dm 444 -t $tex/tex/latex/junicode TeX/junicode.sty
install -Dm 444 -t $tex/tex/latex/junicodevf TeX/junicodevf.{sty,lua}
runHook postInstall
'';
passthru = {
tlDeps = with texlive; [ xkeyval fontspec ];
tests = callPackage ./tests.nix { };
};
meta = {
homepage = "https://github.com/psb1558/Junicode-font";
description = "Unicode font for medievalists";
maintainers = with lib.maintainers; [ ivan-timokhin ];
license = lib.licenses.ofl;
};
}