about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/typesetting/tectonic
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2024-02-13 12:25:07 +0100
committerAlyssa Ross <hi@alyssa.is>2024-02-13 12:25:07 +0100
commita5e1520e4538e29ecfbd4b168306f890566d7bfd (patch)
tree28099c268b5d4b1e33c2b29f0714c45f0b961382 /nixpkgs/pkgs/tools/typesetting/tectonic
parent822f7c15c04567fbdc27020e862ea2b70cfbf8eb (diff)
parent3560d1c8269d0091b9aae10731b5e85274b7bbc1 (diff)
downloadnixlib-a5e1520e4538e29ecfbd4b168306f890566d7bfd.tar
nixlib-a5e1520e4538e29ecfbd4b168306f890566d7bfd.tar.gz
nixlib-a5e1520e4538e29ecfbd4b168306f890566d7bfd.tar.bz2
nixlib-a5e1520e4538e29ecfbd4b168306f890566d7bfd.tar.lz
nixlib-a5e1520e4538e29ecfbd4b168306f890566d7bfd.tar.xz
nixlib-a5e1520e4538e29ecfbd4b168306f890566d7bfd.tar.zst
nixlib-a5e1520e4538e29ecfbd4b168306f890566d7bfd.zip
Merge branch 'nixos-unstable-small' of https://github.com/NixOS/nixpkgs
Conflicts:
	nixpkgs/nixos/modules/services/mail/rss2email.nix
	nixpkgs/pkgs/build-support/go/module.nix
Diffstat (limited to 'nixpkgs/pkgs/tools/typesetting/tectonic')
-rw-r--r--nixpkgs/pkgs/tools/typesetting/tectonic/default.nix7
-rw-r--r--nixpkgs/pkgs/tools/typesetting/tectonic/tests.nix8
-rw-r--r--nixpkgs/pkgs/tools/typesetting/tectonic/wrapper.nix37
3 files changed, 28 insertions, 24 deletions
diff --git a/nixpkgs/pkgs/tools/typesetting/tectonic/default.nix b/nixpkgs/pkgs/tools/typesetting/tectonic/default.nix
index 6b98a5db6343..e7172e608746 100644
--- a/nixpkgs/pkgs/tools/typesetting/tectonic/default.nix
+++ b/nixpkgs/pkgs/tools/typesetting/tectonic/default.nix
@@ -15,23 +15,22 @@
 , harfbuzz
 , openssl
 , pkg-config
-, makeBinaryWrapper
 , icu
 }:
 
 rustPlatform.buildRustPackage rec {
   pname = "tectonic";
-  version = "0.14.1";
+  version = "0.15.0";
 
   src = fetchFromGitHub {
     owner = "tectonic-typesetting";
     repo = "tectonic";
     rev = "tectonic@${version}";
     fetchSubmodules = true;
-    sha256 = "sha256-Cd8YzjU5mCA5DmgLBjg8eVRc87chVVIXinJuf8cNw3o=";
+    sha256 = "sha256-xZHYiaQ8ASUwu0ieHIXcjRaH06SQoB6OR1y7Ok+FjAs=";
   };
 
-  cargoHash = "sha256-1WjZbmZFPB1+QYpjqq5Y+fDkMZNmWJYIxmMFWg7Tiac=";
+  cargoHash = "sha256-niMgb4zsTWHw5yaa4kJOZzpOzO5gMG4k3cTHwSV+wmY=";
 
   nativeBuildInputs = [ pkg-config ];
 
diff --git a/nixpkgs/pkgs/tools/typesetting/tectonic/tests.nix b/nixpkgs/pkgs/tools/typesetting/tectonic/tests.nix
index 0ecf47bf1977..da1961c8e42d 100644
--- a/nixpkgs/pkgs/tools/typesetting/tectonic/tests.nix
+++ b/nixpkgs/pkgs/tools/typesetting/tectonic/tests.nix
@@ -3,6 +3,7 @@
 
 { lib
 , fetchFromGitHub
+, writeText
 , runCommand
 , tectonic
 , curl
@@ -26,7 +27,7 @@ let
   };
   testfiles = "${biber-dev-source}/testfiles";
 
-  noNetNotice = builtins.toFile "tectonic-offline-notice" ''
+  noNetNotice = writeText "tectonic-offline-notice" ''
     # To fetch tectonic's web bundle, the tests require internet access,
     # which is not available in the current environment.
   '';
@@ -84,4 +85,9 @@ lib.mapAttrs networkRequiringTestPkg {
     export HOME=$PWD
     tectonic -X compile ./test.tex
   '';
+
+  workspace = ''
+    tectonic -X new
+    cat Tectonic.toml | grep "${tectonic.bundleUrl}"
+  '';
 }
diff --git a/nixpkgs/pkgs/tools/typesetting/tectonic/wrapper.nix b/nixpkgs/pkgs/tools/typesetting/tectonic/wrapper.nix
index f9e2f7eb59eb..42125e7855d8 100644
--- a/nixpkgs/pkgs/tools/typesetting/tectonic/wrapper.nix
+++ b/nixpkgs/pkgs/tools/typesetting/tectonic/wrapper.nix
@@ -1,8 +1,9 @@
 { lib
 , symlinkJoin
+, tectonic
 , tectonic-unwrapped
 , biber-for-tectonic
-, makeWrapper
+, makeBinaryWrapper
 , callPackage
 }:
 
@@ -10,35 +11,32 @@ symlinkJoin {
   name = "${tectonic-unwrapped.pname}-wrapped-${tectonic-unwrapped.version}";
   paths = [ tectonic-unwrapped ];
 
-  nativeBuildInputs = [ makeWrapper ];
+  nativeBuildInputs = [ makeBinaryWrapper ];
 
   passthru = {
     unwrapped = tectonic-unwrapped;
     biber = biber-for-tectonic;
     tests = callPackage ./tests.nix { };
+
+    # The version locked tectonic web bundle, redirected from:
+    #   https://relay.fullyjustified.net/default_bundle_v33.tar
+    # To check for updates, see:
+    #   https://github.com/tectonic-typesetting/tectonic/blob/master/crates/bundles/src/lib.rs
+    # ... and look up `get_fallback_bundle_url`.
+    bundleUrl = "https://data1.fullyjustified.net/tlextras-2022.0r0.tar";
   };
 
   # 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.
+    # 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.
     #
-    # Note also that upstream has announced that they will put less time and
-    # energy for the project:
+    # Upstream is updating it's online TeX bundle slower then
+    # https://github.com/plk/biber. That's why we match here the `bundleURL`
+    # version with that of `biber-for-tectonic`. See also upstream discussion:
     #
     # https://github.com/tectonic-typesetting/tectonic/discussions/1122
     #
@@ -47,7 +45,8 @@ symlinkJoin {
     # 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"
+      --prefix PATH : "${lib.getBin biber-for-tectonic}/bin" \
+      --add-flags "--web-bundle ${tectonic.passthru.bundleUrl}"
     ln -s $out/bin/tectonic $out/bin/nextonic
   '';