Skip to content

Commit

Permalink
texpresso: modernize / standardize
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
doronbehar committed Feb 24, 2025
1 parent 4a37551 commit 3e07cb7
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions pkgs/by-name/te/texpresso/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand All @@ -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 (
Expand All @@ -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 = {
Expand All @@ -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;
};
}
})

0 comments on commit 3e07cb7

Please sign in to comment.