Skip to content

Commit

Permalink
tectonic-with-biber: init wrapper
Browse files Browse the repository at this point in the history
This is a simple `symlinkJoin` wrapper that bundles tectonic with an
appropriate version of biber. This is partially is recovered from:

  5aa8e9f

Also, add @bryango as maintainer.

Co-authored-by: Doron Behar <[email protected]>
  • Loading branch information
bryango and doronbehar committed Dec 13, 2023
1 parent 007b025 commit 00b92ba
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
61 changes: 61 additions & 0 deletions pkgs/tools/typesetting/tectonic/wrapper.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{ lib
, makeBinaryWrapper
, symlinkJoin
, tectonic
, biberVersions
}:

let

pname = "tectonic-with-biber";
biber = biberVersions.biber-for-tectonic;
inherit (biber) version;

## manually construct `name` for `symlinkJoin`
name = "${pname}-${version}";

meta = tectonic.meta // {
inherit name;
description = "Modernized TeX/LaTeX engine, with biber for bibliography";
longDescription = ''
This package wraps tectonic with biber without triggering rebuilds.
The biber executable is exposed with a version suffix, such as
`biber-${version}`, to prevent conflict with the `biber` bundled with
texlive in nixpkgs. Example use:
let
pkgs = <...>; # import nixpkgs here
in pkgs.tectonic-with-biber.override {
biber = pkgs.biberVersions.biber_2_17;
}
This serves as a fix for:
- https://github.com/tectonic-typesetting/tectonic/issues/893
'';
maintainers = with lib.maintainers; [ bryango ];
};

## produce the correct `meta.position` for `symlinkJoin`
pos = builtins.unsafeGetAttrPos "description" meta;

in

symlinkJoin {

inherit pname version name meta pos;

paths = [ tectonic ];
nativeBuildInputs = [ makeBinaryWrapper ];
passthru = { biber = biber; };

## tectonic runs biber when it detects it needs to run it, see:
## https://github.com/tectonic-typesetting/tectonic/releases/tag/tectonic%400.7.0
postBuild = ''
wrapProgram $out/bin/tectonic \
--prefix PATH : "${lib.getBin biber}/bin"
makeBinaryWrapper "${lib.getBin biber}/bin/biber" \
$out/bin/biber-${biber.version}
'';
## the biber executable is exposed as `biber-${biber.version}`

}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25338,6 +25338,8 @@ with pkgs;
harfbuzz = harfbuzzFull;
};

tectonic-with-biber = callPackage ../tools/typesetting/tectonic/wrapper.nix { };

tepl = callPackage ../development/libraries/tepl { };

termbench-pro = callPackage ../development/libraries/termbench-pro { fmt = fmt_8; };
Expand Down

0 comments on commit 00b92ba

Please sign in to comment.