texpresso: modernize / standardize

Move src closer to version attribute, so diffs of version bumps will be
smaller and easier to read, and a version attribute changing without a
hash changing will be more apparent, in case that happens.
This commit is contained in:
Doron Behar
2025-02-24 13:39:55 +02:00
parent 4a3755155c
commit 3e07cb79a6
+12 -12
View File
@@ -16,10 +16,17 @@
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 \
--replace-fail "CC=gcc" "CC=${stdenv.cc.targetPrefix}cc" \
@@ -39,13 +46,6 @@ stdenv.mkDerivation rec {
libjpeg
];
src = fetchFromGitHub {
owner = "let-def";
repo = "texpresso";
rev = "c42a5912f501f180984840fa8adf9ffc09c5ac13";
hash = "sha256-T/vou7OcGtNoodCrznmjBLxg6ZAFDCjhpYgNyZaf44g=";
};
buildFlags = [ "texpresso" ];
env.NIX_CFLAGS_COMPILE = toString (
@@ -56,14 +56,14 @@ stdenv.mkDerivation rec {
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 [ passthru.tectonic ]}
--prefix PATH : ${lib.makeBinPath [ finalAttrs.finalPackage.passthru.tectonic ]}
'';
passthru = {
@@ -79,10 +79,10 @@ stdenv.mkDerivation rec {
};
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;
};
}
})