Skip to content

Commit

Permalink
Switch to Tectonic 0.7.1 via Artifacts (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
rikhuijzer authored Oct 8, 2021
1 parent 9c0aeba commit 93376d9
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 38 deletions.
33 changes: 33 additions & 0 deletions Artifacts.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,36 @@ git-tree-sha1 = "abf95d66dacf271c927a922ec729b5276e3a4b44"
[[Highlight.download]]
sha256 = "7c1a68258e93aca65f7a6a475be7d315b43a107f872a1db20a637c5d447d22ea"
url = "https://github.com/highlightjs/cdn-release/archive/refs/tags/11.1.0.tar.gz"

[[Tectonic]]
lazy = true
os = "linux"
arch = "x86_64"
libc = "musl"
git-tree-sha1 = "4e6be1718b95ca6b28c2072f7ec676a35a0aea94"

[[Tectonic.download]]
sha256 = "e46767ab9edc8cd83666a293020c290c984470d984f6f6e2f53454c0869c3dd4"
url = "https://github.com/tectonic-typesetting/tectonic/releases/download/tectonic%400.7.1/tectonic-0.7.1-x86_64-unknown-linux-musl.tar.gz"

[[Tectonic]]
lazy = true
os = "linux"
arch = "x86_64"
libc = "glibc"
git-tree-sha1 = "6f6dfab970aad1671eb771b077a2d559b35b51f2"

[[Tectonic.download]]
sha256 = "3a128a4f2302033c350f9a18dc35a48f3034173d9e02b80c00ae4f83ee506cde"
url = "https://github.com/tectonic-typesetting/tectonic/releases/download/tectonic%400.7.1/tectonic-0.7.1-x86_64-unknown-linux-gnu.tar.gz"

[[Tectonic]]
lazy = true
os = "macos"
arch = "x86_64"
git-tree-sha1 = "14162c715ca3bf18c65382c933951c6e5d4696f5"

[[Tectonic.download]]
sha256 = "4311c5f77d89f11be2f56c14997c8b850f748038f679b8e73c5fe8601a50cba4"
url = "https://github.com/tectonic-typesetting/tectonic/releases/download/tectonic%400.7.1/tectonic-0.7.1-x86_64-apple-darwin.tar.gz"

3 changes: 1 addition & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
LazyArtifacts = "4af54fe1-eca0-43a8-85a7-787d91b784e3"
LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
Memoize = "c03570c3-d221-55d1-a50c-7939bbd78826"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
Tectonic = "9ac5f52a-99c6-489f-af81-462ef484790f"
URIs = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4"
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
pandoc_crossref_jll = "f96e3c25-ae70-5588-8d8e-4a7ab3ba4c45"
Expand All @@ -35,7 +35,6 @@ Memoize = "0.4"
Plots = "1"
Requires = "1.1"
TOML = "1.0"
Tectonic = "0.6"
URIs = "1.3"
YAML = "0.4"
julia = "1.6"
Expand Down
2 changes: 2 additions & 0 deletions defaults/template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,13 @@
$titlepage-top$
}
\vfill
{\small
$titlepage-bottom$

$build-info$

$tex-license$
}
\makeatother

$if(dedication)$
Expand Down
2 changes: 1 addition & 1 deletion docs/metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ book: true # Set to false to get a shorter PDF.
author:
- Rik Huijzer
- and contributors
pdf-footer: https://github.com/rikhuijzer/Books.jl
pdf-footer: ""

# An example additional header include for html.
# Note that the url will be updated by `Books.fix_links`.
Expand Down
2 changes: 1 addition & 1 deletion src/Books.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ end

import Artifacts
import CodeTracking
import LazyArtifacts
import LiveServer
import TOML
import YAML
Expand All @@ -19,7 +20,6 @@ using InteractiveUtils: gen_call_with_extracted_types
using Markdown: MD
using Memoize: @memoize
using Requires: @require
using Tectonic: tectonic
using pandoc_crossref_jll: pandoc_crossref_path
using pandoc_jll: pandoc

Expand Down
55 changes: 27 additions & 28 deletions src/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -312,34 +312,33 @@ function pdf(; project="default")
listings_path = joinpath(PROJECT_ROOT, "defaults", "julia_listings.tex")
build_info = today()

tectonic() do tectonic_bin
pdf_engine = "--pdf-engine=$tectonic_bin"

args = [
input_path;
crossref;
citeproc;
csl();
metadata;
template;
"--listings";
pdf_engine;
# Print engine info. Extremely useful for debugging.
"--pdf-engine-opt=--print";
"--variable=listings-unicode-path:$listings_unicode_path";
"--variable=listings-path:$listings_path";
"--variable=build-info:$build_info";
extra_args
]
output_tex_filename = joinpath(BUILD_DIR, "$file.tex")
println("Wrote $output_tex_filename (for debugging purposes)")
tex_output = "--output=$output_tex_filename"
call_pandoc([args; tex_output])

out = call_pandoc([args; output])
if !isnothing(out)
println("Built $output_filename")
end
tectonic = joinpath(Artifacts.artifact"Tectonic", "tectonic")
pdf_engine = "--pdf-engine=$tectonic"

args = [
input_path;
crossref;
citeproc;
csl();
metadata;
template;
"--listings";
pdf_engine;
# Print engine info. Extremely useful for debugging.
"--pdf-engine-opt=--print";
"--variable=listings-unicode-path:$listings_unicode_path";
"--variable=listings-path:$listings_path";
"--variable=build-info:$build_info";
extra_args
]
output_tex_filename = joinpath(BUILD_DIR, "$file.tex")
println("Wrote $output_tex_filename (for debugging purposes)")
tex_output = "--output=$output_tex_filename"
call_pandoc([args; tex_output])

out = call_pandoc([args; output])
if !isnothing(out)
println("Built $output_filename")
end

return nothing
Expand Down
12 changes: 6 additions & 6 deletions src/ci.jl
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ function patch_tectonic_url()
old_url = "https://archive.org/services/purl/net/pkgwpub/tectonic-default"
# The new URL seems to be required to have the same length as the old URL for patching to work.
new_url = "https://tectonicredirectmirrorabc.netlify.app/tectonic-default"
tectonic() do bin
run(`chmod 775 $bin`)
arg = "s@$(old_url)@$(new_url)@"
cmd = `sed -i $arg $bin`
run(cmd)
end

tectonic = joinpath(Artifacts.artifact"Tectonic", "tectonic")
run(`chmod 775 $tectonic`)
arg = "s@$(old_url)@$(new_url)@"
cmd = `sed -i $arg $tectonic`
run(cmd)
return nothing
end

0 comments on commit 93376d9

Please sign in to comment.