waylyrics: 0.3.16 -> 0.3.20 (#364626)
[NixPkgs.git] / pkgs / tools / typesetting / tectonic / default.nix
blobcd95b8c0585420f750f58c6ebb39173f393b53f3
1 /*
2   This file provides the `tectonic-unwrapped` package. On the other hand,
3   the `tectonic` package is defined in `./wrapper.nix`, by wrapping
4   - [`tectonic-unwrapped`](./default.nix) i.e. this package, and
5   - [`biber-for-tectonic`](./biber.nix),
6     which provides a compatible version of `biber`.
7 */
10   lib,
11   stdenv,
12   fetchFromGitHub,
13   rustPlatform,
14   darwin,
15   fontconfig,
16   harfbuzz,
17   openssl,
18   pkg-config,
19   icu,
20   fetchpatch2,
23 rustPlatform.buildRustPackage rec {
24   pname = "tectonic";
25   version = "0.15.0";
27   src = fetchFromGitHub {
28     owner = "tectonic-typesetting";
29     repo = "tectonic";
30     rev = "tectonic@${version}";
31     sha256 = "sha256-xZHYiaQ8ASUwu0ieHIXcjRaH06SQoB6OR1y7Ok+FjAs=";
32   };
34   patches = [
35     (fetchpatch2 {
36       # https://github.com/tectonic-typesetting/tectonic/pull/1155
37       name = "1155-fix-endless-reruns-when-generating-bbl";
38       url = "https://github.com/tectonic-typesetting/tectonic/commit/fbb145cd079497b8c88197276f92cb89685b4d54.patch";
39       hash = "sha256-6FW5MFkOWnqzYX8Eg5DfmLaEhVWKYVZwodE4SGXHKV0=";
40     })
41   ];
43   cargoPatches = [
44     (fetchpatch2 {
45       # cherry-picked from https://github.com/tectonic-typesetting/tectonic/pull/1202
46       name = "1202-fix-build-with-rust-1_80";
47       url = "https://github.com/tectonic-typesetting/tectonic/commit/6b49ca8db40aaca29cb375ce75add3e575558375.patch";
48       hash = "sha256-i1L3XaSuBbsmgOSXIWVqr6EHlHGs8A+6v06kJ3C50sk=";
49     })
50   ];
52   cargoHash = "sha256-Zn+xU6NJOY+jDYrSGsbYGAVqprQ6teEdNvlTNDXuzKs=";
54   nativeBuildInputs = [ pkg-config ];
56   buildFeatures = [ "external-harfbuzz" ];
58   buildInputs =
59     [
60       icu
61       fontconfig
62       harfbuzz
63       openssl
64     ]
65     ++ lib.optionals stdenv.hostPlatform.isDarwin (
66       with darwin.apple_sdk.frameworks;
67       [
68         ApplicationServices
69         Cocoa
70         Foundation
71       ]
72     );
74   postInstall =
75     ''
76       # Makes it possible to automatically use the V2 CLI API
77       ln -s $out/bin/tectonic $out/bin/nextonic
78     ''
79     + lib.optionalString stdenv.hostPlatform.isLinux ''
80       substituteInPlace dist/appimage/tectonic.desktop \
81         --replace Exec=tectonic Exec=$out/bin/tectonic
82       install -D dist/appimage/tectonic.desktop -t $out/share/applications/
83       install -D dist/appimage/tectonic.svg -t $out/share/icons/hicolor/scalable/apps/
84     '';
86   doCheck = true;
88   meta = with lib; {
89     description = "Modernized, complete, self-contained TeX/LaTeX engine, powered by XeTeX and TeXLive";
90     homepage = "https://tectonic-typesetting.github.io/";
91     changelog = "https://github.com/tectonic-typesetting/tectonic/blob/tectonic@${version}/CHANGELOG.md";
92     license = with licenses; [ mit ];
93     mainProgram = "tectonic";
94     maintainers = with maintainers; [
95       lluchs
96       doronbehar
97       bryango
98     ];
99   };