-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #118 from ljessendk/bzlmod
- Loading branch information
Showing
24 changed files
with
544 additions
and
296 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
example/bzlmod | ||
example/bzlmod_use_texlive_deps |
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 +1 @@ | ||
5.3.2 | ||
7.3.1 |
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 |
---|---|---|
|
@@ -15,7 +15,7 @@ jobs: | |
- uses: actions/checkout@v3 | ||
- uses: thompsonja/[email protected] | ||
with: | ||
buildifier_version: 5.1.0 | ||
buildifier_version: v7.3.1 | ||
warnings: all | ||
|
||
test: | ||
|
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
.ijwb | ||
.nfs* | ||
/bazel-* | ||
/MODULE.bazel.lock |
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,82 @@ | ||
""" | ||
""" | ||
|
||
module( | ||
name = "bazel_latex", | ||
version = "1.2.2", | ||
compatibility_level = 0, | ||
repo_name = "bazel_latex", | ||
) | ||
|
||
bazel_dep(name = "platforms", version = "0.0.10") | ||
bazel_dep(name = "rules_foreign_cc", version = "0.12.0") | ||
bazel_dep(name = "rules_python", version = "0.36.0") | ||
|
||
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") | ||
pip.parse( | ||
hub_name = "py_deps", | ||
python_version = "3.11", | ||
requirements_lock = "//:requirements_lock.txt", | ||
) | ||
use_repo(pip, "py_deps") | ||
|
||
register_toolchains( | ||
"//:latex_toolchain_aarch64-darwin", | ||
# The latex_toolchain_amd64-freebsd seems broken, see comment in BUILD.bazel, so disabled for now | ||
#"@bazel_latex//:latex_toolchain_amd64-freebsd", | ||
"//:latex_toolchain_x86_64-darwin", | ||
"//:latex_toolchain_x86_64-linux", | ||
) | ||
|
||
texlive_repositories = use_extension("//:extensions.bzl", "texlive_repositories") | ||
texlive_repositories.install() | ||
use_repo( | ||
texlive_repositories, | ||
"bazel_latex_texlive", | ||
"texlive_bin__aarch64-linux", | ||
"texlive_bin__amd64-freebsd", | ||
"texlive_bin__amd64-netbsd", | ||
"texlive_bin__armhf-linux", | ||
"texlive_bin__i386-cygwin", | ||
"texlive_bin__i386-freebsd", | ||
"texlive_bin__i386-linux", | ||
"texlive_bin__i386-netbsd", | ||
"texlive_bin__i386-solaris", | ||
"texlive_bin__universal-darwin", | ||
"texlive_bin__win32", | ||
"texlive_bin__x86_64-cygwin", | ||
"texlive_bin__x86_64-darwinlegacy", | ||
"texlive_bin__x86_64-linux", | ||
"texlive_bin__x86_64-linuxmusl", | ||
"texlive_bin__x86_64-solaris", | ||
"texlive_texmf__texmf-dist__scripts__texlive", | ||
) | ||
|
||
module_repositories = use_extension("//:repositories.bzl", "module_repositories") | ||
use_repo( | ||
module_repositories, | ||
"bazel_latex_latexrun", | ||
"ghost_script_source", | ||
) | ||
|
||
# mac os shared lib was difficult to build via foreign rules so as a temporary | ||
# solution we provide it as a precompiled artifact. | ||
# Consider making it available via bazel_latex binaries repo instead | ||
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
http_archive( | ||
name = "ghostscript_macos", | ||
build_file_content = """ | ||
filegroup( | ||
name = "libgs_macos", | ||
srcs = glob(["*/*"]), | ||
target_compatible_with = ["@platforms//os:osx"], | ||
visibility = ["//visibility:public"], | ||
) | ||
""", | ||
sha256 = "56b480ebdf34000eac4a29e108ce6384858941d892fd69e604d90585aaae4c94", | ||
urls = [ | ||
"https://github.com/solsjo/rules_latex_deps/releases/download/v0.9.4/rules_latex_deps_macos-latest.zip", | ||
], | ||
) |
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
Empty file.
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,2 @@ | ||
/bazel-* | ||
/MODULE.bazel.lock |
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,8 @@ | ||
load("@bazel_latex//:latex.bzl", "latex_document") | ||
|
||
latex_document( | ||
name = "my_document", | ||
srcs = [], | ||
main = "my_document.tex", | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
""" | ||
Simple bzlmod example | ||
""" | ||
|
||
module( | ||
name = "bazel_latex_example_bzlmod", | ||
) | ||
|
||
bazel_dep(name = "bazel_latex") | ||
local_path_override( | ||
module_name = "bazel_latex", | ||
path = "../..", | ||
) |
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,5 @@ | ||
\documentclass{article} | ||
\begin{document} | ||
\section{Hello world} | ||
Test | ||
\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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/bazel-* | ||
/MODULE.bazel.lock |
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,10 @@ | ||
load("@bazel_latex//:latex.bzl", "latex_document") | ||
|
||
latex_document( | ||
name = "my_document", | ||
srcs = [ | ||
"@bazel_latex_texlive//:texlive_texmf__texmf-dist__tex__latex__multirow", | ||
], | ||
main = "my_document.tex", | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
""" | ||
Simple example that shows how to import the 'bazel_latex_texlive' proxy | ||
""" | ||
|
||
module( | ||
name = "bazel_latex_example_bzlmod_use_texlive_deps", | ||
) | ||
|
||
bazel_dep(name = "bazel_latex") | ||
local_path_override( | ||
module_name = "bazel_latex", | ||
path = "../..", | ||
) | ||
|
||
texlive_repositories = use_extension("@bazel_latex//:extensions.bzl", "texlive_repositories") | ||
texlive_repositories.install() | ||
use_repo( | ||
texlive_repositories, | ||
"bazel_latex_texlive", | ||
) |
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,7 @@ | ||
\documentclass{article} | ||
\usepackage{multirow} | ||
\begin{document} | ||
\begin{tabular}{|c|c|} | ||
\multirow{2}{*}{1}\\ | ||
\end{tabular} | ||
\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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
""" | ||
Extensions for fetching texlive packages | ||
""" | ||
|
||
load("@bazel_latex//:repositories.bzl", "latex_texlive_repositories") | ||
load( | ||
"@bazel_latex//:texlive_2022_repos.bzl", | ||
"TEXLIVE_VERSION_2022", | ||
) | ||
|
||
def _texlive_repositories_impl(mctx): | ||
for install in mctx.modules[0].tags.install: | ||
latex_texlive_repositories(install.version) | ||
return mctx.extension_metadata(reproducible = True) | ||
|
||
texlive_repositories = module_extension( | ||
implementation = _texlive_repositories_impl, | ||
tag_classes = {"install": tag_class(attrs = {"version": attr.string(default = TEXLIVE_VERSION_2022)})}, | ||
) |
Oops, something went wrong.