about summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
authorBryan Lai <bryanlais@gmail.com>2024-03-12 21:08:16 +0800
committerBryan Lai <bryanlais@gmail.com>2024-03-12 21:08:16 +0800
commit77c6cf9ec2b5eba2987a23db37ee914f11de2814 (patch)
tree44f8697c1bb2dab3db503183d01a611be7f5b913 /pkgs/tools
parenta343533bccc62400e8a9560423486a3b6c11a23b (diff)
downloadnixlib-77c6cf9ec2b5eba2987a23db37ee914f11de2814.tar
nixlib-77c6cf9ec2b5eba2987a23db37ee914f11de2814.tar.gz
nixlib-77c6cf9ec2b5eba2987a23db37ee914f11de2814.tar.bz2
nixlib-77c6cf9ec2b5eba2987a23db37ee914f11de2814.tar.lz
nixlib-77c6cf9ec2b5eba2987a23db37ee914f11de2814.tar.xz
nixlib-77c6cf9ec2b5eba2987a23db37ee914f11de2814.tar.zst
nixlib-77c6cf9ec2b5eba2987a23db37ee914f11de2814.zip
tectonic: --inherit-argv0 in the wrapper
The `nextonic` symlink was not working as intended because our tectonic
wrapper did not correctly pass along the executable name. This is fixed
by adding --inherit-argv0 to `makeWrapper`.

A test is also added to prevent breakage in the future.
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/typesetting/tectonic/tests.nix6
-rw-r--r--pkgs/tools/typesetting/tectonic/wrapper.nix3
2 files changed, 8 insertions, 1 deletions
diff --git a/pkgs/tools/typesetting/tectonic/tests.nix b/pkgs/tools/typesetting/tectonic/tests.nix
index da1961c8e42d..eac66f19599e 100644
--- a/pkgs/tools/typesetting/tectonic/tests.nix
+++ b/pkgs/tools/typesetting/tectonic/tests.nix
@@ -90,4 +90,10 @@ lib.mapAttrs networkRequiringTestPkg {
     tectonic -X new
     cat Tectonic.toml | grep "${tectonic.bundleUrl}"
   '';
+
+  /** test that the `nextonic -> tectonic` symlink is working as intended */
+  nextonic = ''
+    nextonic new 2>&1 \
+      | grep '"version 2" Tectonic command-line interface activated'
+  '';
 }
diff --git a/pkgs/tools/typesetting/tectonic/wrapper.nix b/pkgs/tools/typesetting/tectonic/wrapper.nix
index 42125e7855d8..900c695c9218 100644
--- a/pkgs/tools/typesetting/tectonic/wrapper.nix
+++ b/pkgs/tools/typesetting/tectonic/wrapper.nix
@@ -46,7 +46,8 @@ symlinkJoin {
   + ''
     makeWrapper ${lib.getBin tectonic-unwrapped}/bin/tectonic $out/bin/tectonic \
       --prefix PATH : "${lib.getBin biber-for-tectonic}/bin" \
-      --add-flags "--web-bundle ${tectonic.passthru.bundleUrl}"
+      --add-flags "--web-bundle ${tectonic.passthru.bundleUrl}" \
+      --inherit-argv0 ## make sure binary name e.g. `nextonic` is passed along
     ln -s $out/bin/tectonic $out/bin/nextonic
   '';