Merge pull request #286615 from bryango/tectonic-lock-bundle

tectonic: wrap with a correct --web-bundle

authored by Doron Behar and committed by GitHub 17710c7e ae2b1e72

+28 -24
+3 -4
pkgs/tools/typesetting/tectonic/default.nix
··· 15 , harfbuzz 16 , openssl 17 , pkg-config 18 - , makeBinaryWrapper 19 , icu 20 }: 21 22 rustPlatform.buildRustPackage rec { 23 pname = "tectonic"; 24 - version = "0.14.1"; 25 26 src = fetchFromGitHub { 27 owner = "tectonic-typesetting"; 28 repo = "tectonic"; 29 rev = "tectonic@${version}"; 30 fetchSubmodules = true; 31 - sha256 = "sha256-Cd8YzjU5mCA5DmgLBjg8eVRc87chVVIXinJuf8cNw3o="; 32 }; 33 34 - cargoHash = "sha256-1WjZbmZFPB1+QYpjqq5Y+fDkMZNmWJYIxmMFWg7Tiac="; 35 36 nativeBuildInputs = [ pkg-config ]; 37
··· 15 , harfbuzz 16 , openssl 17 , pkg-config 18 , icu 19 }: 20 21 rustPlatform.buildRustPackage rec { 22 pname = "tectonic"; 23 + version = "0.15.0"; 24 25 src = fetchFromGitHub { 26 owner = "tectonic-typesetting"; 27 repo = "tectonic"; 28 rev = "tectonic@${version}"; 29 fetchSubmodules = true; 30 + sha256 = "sha256-xZHYiaQ8ASUwu0ieHIXcjRaH06SQoB6OR1y7Ok+FjAs="; 31 }; 32 33 + cargoHash = "sha256-niMgb4zsTWHw5yaa4kJOZzpOzO5gMG4k3cTHwSV+wmY="; 34 35 nativeBuildInputs = [ pkg-config ]; 36
+7 -1
pkgs/tools/typesetting/tectonic/tests.nix
··· 3 4 { lib 5 , fetchFromGitHub 6 , runCommand 7 , tectonic 8 , curl ··· 26 }; 27 testfiles = "${biber-dev-source}/testfiles"; 28 29 - noNetNotice = builtins.toFile "tectonic-offline-notice" '' 30 # To fetch tectonic's web bundle, the tests require internet access, 31 # which is not available in the current environment. 32 ''; ··· 83 # tectonic caches in the $HOME directory, so set it to $PWD 84 export HOME=$PWD 85 tectonic -X compile ./test.tex 86 ''; 87 }
··· 3 4 { lib 5 , fetchFromGitHub 6 + , writeText 7 , runCommand 8 , tectonic 9 , curl ··· 27 }; 28 testfiles = "${biber-dev-source}/testfiles"; 29 30 + noNetNotice = writeText "tectonic-offline-notice" '' 31 # To fetch tectonic's web bundle, the tests require internet access, 32 # which is not available in the current environment. 33 ''; ··· 84 # tectonic caches in the $HOME directory, so set it to $PWD 85 export HOME=$PWD 86 tectonic -X compile ./test.tex 87 + ''; 88 + 89 + workspace = '' 90 + tectonic -X new 91 + cat Tectonic.toml | grep "${tectonic.bundleUrl}" 92 ''; 93 }
+18 -19
pkgs/tools/typesetting/tectonic/wrapper.nix
··· 1 { lib 2 , symlinkJoin 3 , tectonic-unwrapped 4 , biber-for-tectonic 5 - , makeWrapper 6 , callPackage 7 }: 8 ··· 10 name = "${tectonic-unwrapped.pname}-wrapped-${tectonic-unwrapped.version}"; 11 paths = [ tectonic-unwrapped ]; 12 13 - nativeBuildInputs = [ makeWrapper ]; 14 15 passthru = { 16 unwrapped = tectonic-unwrapped; 17 biber = biber-for-tectonic; 18 tests = callPackage ./tests.nix { }; 19 }; 20 21 # Replace the unwrapped tectonic with the one wrapping it with biber 22 postBuild = '' 23 rm $out/bin/{tectonic,nextonic} 24 '' 25 - # Ideally, we would have liked to also pin the version of the online TeX 26 - # bundle that Tectonic's developer distribute, so that the `biber` version 27 - # and the `biblatex` version distributed from there are compatible. 28 - # However, that is not currently possible, due to lack of upstream support 29 - # for specifying this in runtime, there were 2 suggestions sent upstream 30 - # that suggested a way of improving the situation: 31 # 32 - # - https://github.com/tectonic-typesetting/tectonic/pull/1132 33 - # - https://github.com/tectonic-typesetting/tectonic/pull/1131 34 - # 35 - # The 1st suggestion seems more promising as it'd allow us to simply use 36 - # makeWrapper's --add-flags option. However, the PR linked above is not 37 - # complete, and as of currently, upstream hasn't even reviewed it, or 38 - # commented on the idea. 39 - # 40 - # Note also that upstream has announced that they will put less time and 41 - # energy for the project: 42 # 43 # https://github.com/tectonic-typesetting/tectonic/discussions/1122 44 # ··· 47 # won't require a higher version of biber. 48 + '' 49 makeWrapper ${lib.getBin tectonic-unwrapped}/bin/tectonic $out/bin/tectonic \ 50 - --prefix PATH : "${lib.getBin biber-for-tectonic}/bin" 51 ln -s $out/bin/tectonic $out/bin/nextonic 52 ''; 53
··· 1 { lib 2 , symlinkJoin 3 + , tectonic 4 , tectonic-unwrapped 5 , biber-for-tectonic 6 + , makeBinaryWrapper 7 , callPackage 8 }: 9 ··· 11 name = "${tectonic-unwrapped.pname}-wrapped-${tectonic-unwrapped.version}"; 12 paths = [ tectonic-unwrapped ]; 13 14 + nativeBuildInputs = [ makeBinaryWrapper ]; 15 16 passthru = { 17 unwrapped = tectonic-unwrapped; 18 biber = biber-for-tectonic; 19 tests = callPackage ./tests.nix { }; 20 + 21 + # The version locked tectonic web bundle, redirected from: 22 + # https://relay.fullyjustified.net/default_bundle_v33.tar 23 + # To check for updates, see: 24 + # https://github.com/tectonic-typesetting/tectonic/blob/master/crates/bundles/src/lib.rs 25 + # ... and look up `get_fallback_bundle_url`. 26 + bundleUrl = "https://data1.fullyjustified.net/tlextras-2022.0r0.tar"; 27 }; 28 29 # Replace the unwrapped tectonic with the one wrapping it with biber 30 postBuild = '' 31 rm $out/bin/{tectonic,nextonic} 32 '' 33 + # Pin the version of the online TeX bundle that Tectonic's developer 34 + # distribute, so that the `biber` version and the `biblatex` version 35 + # distributed from there are compatible. 36 # 37 + # Upstream is updating it's online TeX bundle slower then 38 + # https://github.com/plk/biber. That's why we match here the `bundleURL` 39 + # version with that of `biber-for-tectonic`. See also upstream discussion: 40 # 41 # https://github.com/tectonic-typesetting/tectonic/discussions/1122 42 # ··· 45 # won't require a higher version of biber. 46 + '' 47 makeWrapper ${lib.getBin tectonic-unwrapped}/bin/tectonic $out/bin/tectonic \ 48 + --prefix PATH : "${lib.getBin biber-for-tectonic}/bin" \ 49 + --add-flags "--web-bundle ${tectonic.passthru.bundleUrl}" 50 ln -s $out/bin/tectonic $out/bin/nextonic 51 ''; 52