python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / tools / typesetting / tectonic / default.nix
blob0eaf307591fd413196141c939beb13c0a045043e
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , rustPlatform
5 , darwin
6 , fontconfig
7 , harfbuzz
8 , openssl
9 , pkg-config
10 , makeBinaryWrapper
11 , biber
12 , icu
15 rustPlatform.buildRustPackage rec {
16   pname = "tectonic";
17   version = "0.11.0";
19   src = fetchFromGitHub {
20     owner = "tectonic-typesetting";
21     repo = "tectonic";
22     rev = "tectonic@${version}";
23     fetchSubmodules = true;
24     sha256 = "tBX737Yv4TvDo64cDYuALX61vzKjhz6PTMXQhWc5S/I=";
25   };
27   cargoSha256 = "awDVjJLwgpSMbwptmLhczaxB5HqvsdvEOUsLYb/zTUc=";
29   nativeBuildInputs = [ pkg-config makeBinaryWrapper ];
31   buildInputs = [ icu fontconfig harfbuzz openssl ]
32     ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ ApplicationServices Cocoa Foundation ]);
34   # Tectonic runs biber when it detects it needs to run it, see:
35   # https://github.com/tectonic-typesetting/tectonic/releases/tag/tectonic%400.7.0
36   postInstall = ''
37     wrapProgram $out/bin/tectonic \
38       --prefix PATH : "${lib.getBin biber}/bin"
39   '' + lib.optionalString stdenv.isLinux ''
40     substituteInPlace dist/appimage/tectonic.desktop \
41       --replace Exec=tectonic Exec=$out/bin/tectonic
42     install -D dist/appimage/tectonic.desktop -t $out/share/applications/
43     install -D dist/appimage/tectonic.svg -t $out/share/icons/hicolor/scalable/apps/
45     ln -s $out/bin/tectonic $out/bin/nextonic
46   '';
48   doCheck = true;
50   meta = with lib; {
51     description = "Modernized, complete, self-contained TeX/LaTeX engine, powered by XeTeX and TeXLive";
52     homepage = "https://tectonic-typesetting.github.io/";
53     changelog = "https://github.com/tectonic-typesetting/tectonic/blob/tectonic@${version}/CHANGELOG.md";
54     license = with licenses; [ mit ];
55     maintainers = with maintainers; [ lluchs doronbehar ];
56   };