tectonic, tectonic-unwrapped, texpresso: fix build & clean up (#384706)

Doron Behar 46f37357 00f0b088

Changed files
+75 -70
pkgs
by-name
te
tectonic-unwrapped
texpresso
tools
typesetting
tex
texpresso
top-level
+19 -19
pkgs/by-name/te/tectonic-unwrapped/package.nix
···
{
lib,
-
stdenv,
+
clangStdenv,
fetchFromGitHub,
rustPlatform,
-
darwin,
fontconfig,
harfbuzzFull,
openssl,
···
fetchpatch2,
}:
-
rustPlatform.buildRustPackage rec {
+
let
+
+
buildRustPackage = rustPlatform.buildRustPackage.override {
+
# use clang to work around build failure with GCC 14
+
# see: https://github.com/tectonic-typesetting/tectonic/issues/1263
+
stdenv = clangStdenv;
+
};
+
+
in
+
+
buildRustPackage rec {
pname = "tectonic";
version = "0.15.0";
···
buildFeatures = [ "external-harfbuzz" ];
-
buildInputs =
-
[
-
icu
-
fontconfig
-
harfbuzzFull
-
openssl
-
]
-
++ lib.optionals stdenv.hostPlatform.isDarwin (
-
with darwin.apple_sdk.frameworks;
-
[
-
ApplicationServices
-
Cocoa
-
Foundation
-
]
-
);
+
buildInputs = [
+
icu
+
fontconfig
+
harfbuzzFull
+
openssl
+
];
postInstall =
''
# Makes it possible to automatically use the V2 CLI API
ln -s $out/bin/tectonic $out/bin/nextonic
''
-
+ lib.optionalString stdenv.hostPlatform.isLinux ''
+
+ lib.optionalString clangStdenv.hostPlatform.isLinux ''
substituteInPlace dist/appimage/tectonic.desktop \
--replace Exec=tectonic Exec=$out/bin/tectonic
install -D dist/appimage/tectonic.desktop -t $out/share/applications/
+42
pkgs/by-name/te/texpresso/tectonic.nix
···
+
{
+
tectonic-unwrapped,
+
fetchFromGitHub,
+
rustPlatform,
+
}:
+
+
tectonic-unwrapped.overrideAttrs (
+
finalAttrs: prevAttrs: {
+
pname = "texpresso-tonic";
+
version = "0.15.0-unstable-2024-04-19";
+
src = fetchFromGitHub {
+
owner = "let-def";
+
repo = "tectonic";
+
rev = "b38cb3b2529bba947d520ac29fbb7873409bd270";
+
hash = "sha256-ap7fEPHsASAphIQkjcvk1CC7egTdxaUh7IpSS5os4W8=";
+
fetchSubmodules = true;
+
};
+
useFetchCargoVendor = true;
+
cargoHash = "sha256-mqhbIv5r/5EDRDfP2BymXv9se2NCKxzRGqNqwqbD9A0=";
+
# rebuild cargoDeps by hand because `.overrideAttrs cargoHash`
+
# does not reconstruct cargoDeps (a known limitation):
+
cargoDeps = rustPlatform.fetchCargoVendor {
+
inherit (finalAttrs) src;
+
name = "${finalAttrs.pname}-${finalAttrs.version}";
+
hash = finalAttrs.cargoHash;
+
patches = finalAttrs.cargoPatches;
+
};
+
# binary has a different name, bundled tests won't work
+
doCheck = false;
+
postInstall = ''
+
${prevAttrs.postInstall or ""}
+
+
# Remove the broken `nextonic` symlink
+
# It points to `tectonic`, which doesn't exist because the exe is
+
# renamed to texpresso-tonic
+
rm $out/bin/nextonic
+
'';
+
meta = prevAttrs.meta // {
+
mainProgram = "texpresso-tonic";
+
};
+
}
+
)
+14 -14
pkgs/tools/typesetting/tex/texpresso/default.nix pkgs/by-name/te/texpresso/package.nix
···
openjpeg,
gumbo,
libjpeg,
-
texpresso-tectonic,
+
callPackage,
}:
-
stdenv.mkDerivation rec {
+
stdenv.mkDerivation (finalAttrs: {
pname = "texpresso";
version = "0-unstable-2025-01-29";
+
+
src = fetchFromGitHub {
+
owner = "let-def";
+
repo = "texpresso";
+
rev = "c42a5912f501f180984840fa8adf9ffc09c5ac13";
+
hash = "sha256-T/vou7OcGtNoodCrznmjBLxg6ZAFDCjhpYgNyZaf44g=";
+
};
postPatch = ''
substituteInPlace Makefile \
···
libjpeg
];
-
src = fetchFromGitHub {
-
owner = "let-def";
-
repo = "texpresso";
-
rev = "c42a5912f501f180984840fa8adf9ffc09c5ac13";
-
hash = "sha256-T/vou7OcGtNoodCrznmjBLxg6ZAFDCjhpYgNyZaf44g=";
-
};
-
buildFlags = [ "texpresso" ];
env.NIX_CFLAGS_COMPILE = toString (
···
installPhase = ''
runHook preInstall
-
install -Dm0755 -t "$out/bin/" "build/${pname}"
+
install -Dm0755 -t "$out/bin/" "build/${finalAttrs.pname}"
runHook postInstall
'';
# needs to have texpresso-tonic on its path
postInstall = ''
wrapProgram $out/bin/texpresso \
-
--prefix PATH : ${lib.makeBinPath [ texpresso-tectonic ]}
+
--prefix PATH : ${lib.makeBinPath [ finalAttrs.finalPackage.passthru.tectonic ]}
'';
passthru = {
-
tectonic = texpresso-tectonic;
+
tectonic = callPackage ./tectonic.nix { };
updateScript = writeScript "update-texpresso" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq nix-update
···
};
meta = {
-
inherit (src.meta) homepage;
+
inherit (finalAttrs.src.meta) homepage;
description = "Live rendering and error reporting for LaTeX";
maintainers = with lib.maintainers; [ nickhu ];
license = lib.licenses.mit;
platforms = lib.platforms.unix;
};
-
}
+
})
-33
pkgs/tools/typesetting/tex/texpresso/tectonic.nix
···
-
{ tectonic-unwrapped, fetchFromGitHub }:
-
tectonic-unwrapped.override (old: {
-
rustPlatform = old.rustPlatform // {
-
buildRustPackage =
-
args:
-
old.rustPlatform.buildRustPackage (
-
args
-
// {
-
pname = "texpresso-tonic";
-
src = fetchFromGitHub {
-
owner = "let-def";
-
repo = "tectonic";
-
rev = "b38cb3b2529bba947d520ac29fbb7873409bd270";
-
hash = "sha256-ap7fEPHsASAphIQkjcvk1CC7egTdxaUh7IpSS5os4W8=";
-
fetchSubmodules = true;
-
};
-
useFetchCargoVendor = true;
-
cargoHash = "sha256-mqhbIv5r/5EDRDfP2BymXv9se2NCKxzRGqNqwqbD9A0=";
-
# binary has a different name, bundled tests won't work
-
doCheck = false;
-
postInstall = ''
-
${args.postInstall or ""}
-
-
# Remove the broken `nextonic` symlink
-
# It points to `tectonic`, which doesn't exist because the exe is
-
# renamed to texpresso-tonic
-
rm $out/bin/nextonic
-
'';
-
meta.mainProgram = "texpresso-tonic";
-
}
-
);
-
};
-
})
-4
pkgs/top-level/all-packages.nix
···
fmt = fmt_11;
-
texpresso = callPackage ../tools/typesetting/tex/texpresso {
-
texpresso-tectonic = callPackage ../tools/typesetting/tex/texpresso/tectonic.nix { };
-
};
-
tinyxml = tinyxml2;
tinyxml2 = callPackage ../development/libraries/tinyxml/2.6.2.nix { };