nixpkgs/pkgs/tools/typesetting/tectonic/default.nix
Doron Behar 0889989397 tectonic: Don't wrap with biber
Frequently, users complain about incompatibilities between biblatex from
Tectonic's bundle releases, and Nixpkgs' biber version, compiled from
texlive's sources. The issue does not happen within Nixpkgs' texlive,
and Nixpkgs' biber, since both of them are updated at the same time, and
hence are always compatible with each other. Since Tectonic manages it's
tex packages bundle by itself, it's natural that there will be
incompatibilities between Tectonic's user's distribution `biber`, and
Tectonic's biblatex version from Tectonic's bundle. See upstream's
issue: https://github.com/tectonic-typesetting/tectonic/issues/893

For the issue not to arise, we simply hope Tectonic's bundle update
itself not long after Nixpkgs' texlive packages are updated. In anycase,
`tectonic`'s users in Nixpkgs will be better off dealing with
incompatibilities without the need to recompile `tectonic` just to
change the `biber` path in wrapper.
2023-06-16 09:16:01 +03:00

52 lines
1.5 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, darwin
, fontconfig
, harfbuzz
, openssl
, pkg-config
, makeBinaryWrapper
, icu
}:
rustPlatform.buildRustPackage rec {
pname = "tectonic";
version = "0.14.1";
src = fetchFromGitHub {
owner = "tectonic-typesetting";
repo = "tectonic";
rev = "tectonic@${version}";
fetchSubmodules = true;
sha256 = "sha256-Cd8YzjU5mCA5DmgLBjg8eVRc87chVVIXinJuf8cNw3o=";
};
cargoHash = "sha256-1WjZbmZFPB1+QYpjqq5Y+fDkMZNmWJYIxmMFWg7Tiac=";
nativeBuildInputs = [ pkg-config makeBinaryWrapper ];
buildInputs = [ icu fontconfig harfbuzz openssl ]
++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ ApplicationServices Cocoa Foundation ]);
postInstall = lib.optionalString stdenv.isLinux ''
substituteInPlace dist/appimage/tectonic.desktop \
--replace Exec=tectonic Exec=$out/bin/tectonic
install -D dist/appimage/tectonic.desktop -t $out/share/applications/
install -D dist/appimage/tectonic.svg -t $out/share/icons/hicolor/scalable/apps/
ln -s $out/bin/tectonic $out/bin/nextonic
'';
doCheck = true;
meta = with lib; {
description = "Modernized, complete, self-contained TeX/LaTeX engine, powered by XeTeX and TeXLive";
homepage = "https://tectonic-typesetting.github.io/";
changelog = "https://github.com/tectonic-typesetting/tectonic/blob/tectonic@${version}/CHANGELOG.md";
license = with licenses; [ mit ];
maintainers = with maintainers; [ lluchs doronbehar ];
};
}