forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request NixOS#273740 from bryango/biber-versions
tectonic, biber-for-tectonic: wrap tectonic with biber-2.17, fix NixOS#88067
- Loading branch information
Showing
5 changed files
with
135 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2722,6 +2722,12 @@ | |
githubId = 53131727; | ||
name = "Bryan Albuquerque"; | ||
}; | ||
bryango = { | ||
name = "Bryan Lai"; | ||
email = "[email protected]"; | ||
github = "bryango"; | ||
githubId = 26322692; | ||
}; | ||
bryanhonof = { | ||
name = "Bryan Honof"; | ||
email = "[email protected]"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ]; | ||
}; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ lib | ||
, symlinkJoin | ||
, tectonic-unwrapped | ||
, biber-for-tectonic | ||
, makeWrapper | ||
}: | ||
|
||
symlinkJoin { | ||
name = "${tectonic-unwrapped.pname}-wrapped-${tectonic-unwrapped.version}"; | ||
paths = [ tectonic-unwrapped ]; | ||
|
||
nativeBuildInputs = [ makeWrapper ]; | ||
|
||
passthru = { | ||
unwrapped = tectonic-unwrapped; | ||
biber = biber-for-tectonic; | ||
}; | ||
|
||
# Replace the unwrapped tectonic with the one wrapping it with biber | ||
postBuild = '' | ||
rm $out/bin/{tectonic,nextonic} | ||
'' | ||
# Ideally, we would have liked to also pin the version of the online TeX | ||
# bundle that Tectonic's developer distribute, so that the `biber` version | ||
# and the `biblatex` version distributed from there are compatible. | ||
# However, that is not currently possible, due to lack of upstream support | ||
# for specifying this in runtime, there were 2 suggestions sent upstream | ||
# that suggested a way of improving the situation: | ||
# | ||
# - https://github.com/tectonic-typesetting/tectonic/pull/1132 | ||
# - https://github.com/tectonic-typesetting/tectonic/pull/1131 | ||
# | ||
# The 1st suggestion seems more promising as it'd allow us to simply use | ||
# makeWrapper's --add-flags option. However, the PR linked above is not | ||
# complete, and as of currently, upstream hasn't even reviewed it, or | ||
# commented on the idea. | ||
# | ||
# Note also that upstream has announced that they will put less time and | ||
# energy for the project: | ||
# | ||
# https://github.com/tectonic-typesetting/tectonic/discussions/1122 | ||
# | ||
# Hence, we can be rather confident that for the near future, the online | ||
# TeX bundle won't be updated and hence the biblatex distributed there | ||
# won't require a higher version of biber. | ||
+ '' | ||
makeWrapper ${lib.getBin tectonic-unwrapped}/bin/tectonic $out/bin/tectonic \ | ||
--prefix PATH : "${lib.getBin biber-for-tectonic}/bin" | ||
ln -s $out/bin/tectonic $out/bin/nextonic | ||
''; | ||
|
||
meta = tectonic-unwrapped.meta // { | ||
description = "Tectonic TeX/LaTeX engine, wrapped with a compatible biber"; | ||
maintainers = with lib.maintainers; [ doronbehar bryango ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters