about summary refs log tree commit diff
path: root/pkgs/tools/typesetting
diff options
context:
space:
mode:
authorBryan Lai <bryanlais@gmail.com>2023-12-09 16:20:18 +0800
committerDoron Behar <doron.behar@gmail.com>2023-12-20 16:46:33 +0200
commitd9c62652be7e305cd61b7cefaa70b8f72dda8cfb (patch)
tree1d32742b5bc1d37a0329d732090533f93dafa8fd /pkgs/tools/typesetting
parentbc32f4eb33f976b8473819b0e5bee6bf6af8fd6a (diff)
downloadnixlib-d9c62652be7e305cd61b7cefaa70b8f72dda8cfb.tar
nixlib-d9c62652be7e305cd61b7cefaa70b8f72dda8cfb.tar.gz
nixlib-d9c62652be7e305cd61b7cefaa70b8f72dda8cfb.tar.bz2
nixlib-d9c62652be7e305cd61b7cefaa70b8f72dda8cfb.tar.lz
nixlib-d9c62652be7e305cd61b7cefaa70b8f72dda8cfb.tar.xz
nixlib-d9c62652be7e305cd61b7cefaa70b8f72dda8cfb.tar.zst
nixlib-d9c62652be7e305cd61b7cefaa70b8f72dda8cfb.zip
biber-for-tectonic: init at 2.17
The `tectonic` package depends on a version of `biber` that is generally
different from the one in the nixpkgs `texlive` bundle. This package
provides an override of biber suitable for use with tectonic.

For biber<=2.17 on perl>=5.36.0 a patch is needed.
This is recovered from a previous nixpkgs commit:

  https://github.com/NixOS/nixpkgs/commit/c784cdbf6b98e3e3aefb678b6ee8309cbb8bee15

Co-authored-by: Mauricio Collares <mauricio@collares.org>
Co-authored-by: Doron Behar <doron.behar@gmail.com>
Diffstat (limited to 'pkgs/tools/typesetting')
-rw-r--r--pkgs/tools/typesetting/tectonic/biber.nix54
1 files changed, 54 insertions, 0 deletions
diff --git a/pkgs/tools/typesetting/tectonic/biber.nix b/pkgs/tools/typesetting/tectonic/biber.nix
new file mode 100644
index 000000000000..9798c1471667
--- /dev/null
+++ b/pkgs/tools/typesetting/tectonic/biber.nix
@@ -0,0 +1,54 @@
+/*
+  This package, `biber-for-tectonic`, provides a compatible version of `biber`
+  as an optional runtime dependency of `tectonic`.
+
+  The development of tectonic is slowing down recently, such that its `biber`
+  dependency has been lagging behind the one in the nixpkgs `texlive` bundle.
+  See:
+
+  https://github.com/tectonic-typesetting/tectonic/discussions/1122
+
+  It is now feasible to track the biber dependency in nixpkgs, as the
+  version bump is not very frequent, and it would provide a more complete
+  user experience of tectonic in nixpkgs.
+*/
+
+{ lib
+, fetchFromGitHub
+, fetchpatch
+, biber
+}:
+
+let version = "2.17"; in (
+  biber.override {
+    /*
+      It is necessary to first override the `version` data here, which is
+      passed to `buildPerlModule`, and then to `mkDerivation`.
+
+      If we simply do `biber.overrideAttrs` the resulting package `name`
+      would be incorrect, since it has already been preprocessed by
+      `buildPerlModule`.
+    */
+    texlive.pkgs.biber.texsource = {
+      inherit version;
+      inherit (biber) pname meta;
+    };
+  }
+).overrideAttrs (prevAttrs: {
+  src = fetchFromGitHub {
+    owner = "plk";
+    repo = "biber";
+    rev = "v${version}";
+    hash = "sha256-Tt2sN2b2NGxcWyZDj5uXNGC8phJwFRiyH72n3yhFCi0=";
+  };
+  patches = [
+    # Perl>=5.36.0 compatibility
+    (fetchpatch {
+      url = "https://patch-diff.githubusercontent.com/raw/plk/biber/pull/411.patch";
+      hash = "sha256-osgldRVfe3jnMSOMnAMQSB0Ymc1s7J6KtM2ig3c93SE=";
+    })
+  ];
+  meta = prevAttrs.meta // {
+    maintainers = with lib.maintainers; [ doronbehar bryango ];
+  };
+})