forked from ProdriveTechnologies/bazel-latex
-
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.
Add support for generating svgs from tex files
This can be a nice feature when a .tex file contains a tikz figure. This is enabled by exposing the dvisvgm binary in the defined latex texlive toolchan. dvisvgm is dependent on ghostscript as a dynamic lib, which is why it has been added. The previously referenced bazel docker image in cirrus.yaml was not actively updated by google. The last supported version was 3.5. So the docker image was changed to the newly provided image. See: bazelbuild/continuous-integration#1060 bazelbuild/continuous-integration#1401 ghostscript is built from source using rules_foreign_cc, which can't be entirely bootstrapped at this point. (It can't build autoconf) So it needs that to be installed from e.g. apt. The bazel docker container did as far as I investigated not allow to install packages in the container, I could be wrong though. Instead I created a github workflow, which depends on bazelisk. bazelisk is a downloader for bazel. You can configure it always run with a specific version. But sense cirrus.yaml uses latest, we don't state any version meaning it will always download the latest bazel. It also enables a bazel cache which "should" speed up execution in the ci pipeline.
- Loading branch information
Showing
9 changed files
with
214 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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
container: | ||
image: l.gcr.io/google/bazel:latest | ||
image: gcr.io/bazel-public/bazel:latest | ||
task: | ||
name: Build the example document | ||
build_script: bazel build //example:all | ||
build_script: bazel build //example:my_report //example:my_dvi_report | ||
task: | ||
name: Build all package tests | ||
build_script: bazel build //packages:all |
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,22 @@ | ||
name: Build and Deploy | ||
on: [push] | ||
permissions: | ||
contents: write | ||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v3 | ||
- uses: mishas/setup-bazelisk-action@v1 | ||
- name: Mount bazel cache # Optional | ||
uses: actions/cache@v1 | ||
with: | ||
path: "~/.cache/bazel" | ||
key: bazel | ||
- name: build | ||
shell: bash | ||
run: > | ||
bazelisk build //example:example_svg; | ||
bazelisk build //...; | ||
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
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,12 @@ | ||
\documentclass{article} | ||
\usepackage{tikz} | ||
\begin{document} | ||
\begin{tikzpicture} | ||
|
||
\draw (-2,0) -- (2,0); | ||
\filldraw [gray] (0,0) circle (2pt); | ||
\draw (-2,-2) .. controls (0,0) .. (2,-2); | ||
\draw (-2,2) .. controls (-1,0) and (1,0) .. (2,2); | ||
|
||
\end{tikzpicture} | ||
\end{document} |
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
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,24 @@ | ||
load("@rules_foreign_cc//foreign_cc:defs.bzl", "configure_make") | ||
|
||
filegroup( | ||
name = "ghostscript_dependencies", | ||
srcs = [ | ||
"@texlive_texmf__texmf-dist__dvips__base", | ||
], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
configure_make( | ||
name = "lib_ghost_script_configure", | ||
configure_in_place = True, | ||
autogen = True, | ||
install_prefix = "output", | ||
lib_source = "@ghost_script_source//:all_srcs", | ||
targets = ["so", "soinstall"], | ||
out_shared_libs = select({ | ||
"@platforms//os:macos": ["libgs.dylib"], | ||
"@platforms//os:windows": ["libgs.dll"], | ||
"//conditions:default": ["libgs.so"], | ||
}), | ||
visibility = ["//visibility:public"] | ||
) |
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