texpresso: 0.1 -> 0.1-unstable-2026-04-02

The main improvement of this update, is this:

https://github.com/let-def/texpresso/pull/102

Which allows us to avoid maintaining yet another derivation.
This commit is contained in:
Doron Behar
2026-04-19 17:51:10 +03:00
parent a8eca96edb
commit 75ec8afea2
2 changed files with 19 additions and 73 deletions
+19 -31
View File
@@ -5,60 +5,65 @@
# nativeBuildInputs
makeWrapper,
pkg-config,
writeShellScriptBin,
# buildInputs
fontconfig,
freetype,
gumbo,
harfbuzz,
icu,
jbig2dec,
libjpeg,
mupdf,
openjpeg,
re2c,
SDL2,
# passthru
callPackage,
writeScript,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "texpresso";
version = "0.1";
version = "0.1-unstable-2026-04-02";
src = fetchFromGitHub {
owner = "let-def";
repo = "texpresso";
tag = "v${finalAttrs.version}";
hash = "sha256-d+wNQIysn3hdTQnHN9MJbFOIhJQ0ml6PoeuwsryntTI=";
rev = "96f008c94ece067fac8e896d0ab1808c948a4dd3";
hash = "sha256-ew7n3Sp4uYLv5jijRW2rRM9s63TQCeFgKXmmBXdYjx4=";
};
postPatch = ''
substituteInPlace Makefile \
--replace-fail "CC=gcc" "CC=${stdenv.cc.targetPrefix}cc" \
--replace-fail "LDCC=g++" "LDCC=${stdenv.cc.targetPrefix}c++"
substituteInPlace src/engine/Makefile \
--replace-fail "_CC?=gcc" "_CC?=${stdenv.cc.targetPrefix}cc" \
--replace-fail "_LD?=g++" "_LD?=${stdenv.cc.targetPrefix}c++" \
--replace-fail "_CXX?=g++" "_CXX?=${stdenv.cc.targetPrefix}c++"
'';
strictDeps = true;
nativeBuildInputs = [
makeWrapper
pkg-config
# Especially for Darwin builds, we pretend we are Linux to avoid upstream's
# makefiles from using brew.
(writeShellScriptBin "uname" "echo Linux")
];
buildInputs = [
fontconfig
freetype
gumbo
harfbuzz
icu
jbig2dec
libjpeg
mupdf
openjpeg
re2c
SDL2
];
buildFlags = [
"texpresso"
"texpresso-xetex"
];
env = lib.optionalAttrs stdenv.hostPlatform.isDarwin {
@@ -70,27 +75,10 @@ stdenv.mkDerivation (finalAttrs: {
installPhase = ''
runHook preInstall
install -D -t "$out/bin/" "build/texpresso"
install -D -t "$out/bin/" "build/texpresso-xetex"
runHook postInstall
'';
# needs to have texpresso-tonic on its path
postInstall = ''
wrapProgram $out/bin/texpresso \
--prefix PATH : ${lib.makeBinPath [ finalAttrs.finalPackage.passthru.tectonic ]}
'';
passthru = {
tectonic = callPackage ./tectonic.nix { };
updateScript = writeScript "update-texpresso" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq nix-update
tectonic_version="$(curl -s "https://api.github.com/repos/let-def/texpresso/contents/tectonic" | jq -r '.sha')"
nix-update texpresso
nix-update --version=branch=$tectonic_version texpresso.tectonic
'';
};
meta = {
inherit (finalAttrs.src.meta) homepage;
description = "Live rendering and error reporting for LaTeX";
-42
View File
@@ -1,42 +0,0 @@
{
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;
};
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";
};
}
)