|
| 1 | +/* |
| 2 | + This package provides an alternative version of `biber` |
| 3 | + as an optional runtime dependency of `tectonic`. |
| 4 | +
|
| 5 | + The development of tectonic has slowed down recently, such that its `biber` |
| 6 | + dependency has been lagging behind the one in the nixpkgs `texlive` bundle. |
| 7 | + See: |
| 8 | +
|
| 9 | + https://github.com/tectonic-typesetting/tectonic/discussions/1122 |
| 10 | +
|
| 11 | + It is now feasible to track this dependency in nixpkgs, as the biber version |
| 12 | + bump is not so frequent, and it would provide a more complete user experience |
| 13 | + of tectonic in nixpkgs. |
| 14 | +*/ |
| 15 | + |
| 16 | +{ lib, fetchFromGitHub, fetchpatch, biber }: |
| 17 | + |
| 18 | +let version = "2.17"; in ( |
| 19 | + biber.override { |
| 20 | + /* |
| 21 | + It is necessary to first override the `version` data here, which is |
| 22 | + passed to `buildPerlModule`, and then to `mkDerivation`. |
| 23 | +
|
| 24 | + If we simply do `biber.overrideAttrs` the resulting package `name` |
| 25 | + would be incorrect, since it has already been preprocessed by |
| 26 | + `buildPerlModule`. |
| 27 | + */ |
| 28 | + texlive.pkgs.biber.texsource = { |
| 29 | + inherit version; |
| 30 | + inherit (biber) pname meta; |
| 31 | + }; |
| 32 | + } |
| 33 | +).overrideAttrs (prevAttrs: { |
| 34 | + src = fetchFromGitHub { |
| 35 | + owner = "plk"; |
| 36 | + repo = "biber"; |
| 37 | + rev = "v${version}"; |
| 38 | + hash = "sha256-Tt2sN2b2NGxcWyZDj5uXNGC8phJwFRiyH72n3yhFCi0="; |
| 39 | + }; |
| 40 | + patches = [ |
| 41 | + # Perl 5.38 compatibility |
| 42 | + (fetchpatch { |
| 43 | + url = "https://patch-diff.githubusercontent.com/raw/plk/biber/pull/411.patch"; |
| 44 | + hash = "sha256-osgldRVfe3jnMSOMnAMQSB0Ymc1s7J6KtM2ig3c93SE="; |
| 45 | + }) |
| 46 | + ]; |
| 47 | + meta = prevAttrs.meta // { |
| 48 | + maintainers = with lib.maintainers; [ bryango ]; |
| 49 | + }; |
| 50 | +}) |
0 commit comments