Skip to content

Commit

Permalink
Get meson examples working with bzlmod
Browse files Browse the repository at this point in the history
Note that a newer version of pkgconfig than that installed in ubuntu 20
must be used to build libxau, therefore the built_pkgconfig_toolchain is
now registered
  • Loading branch information
jheaff1 committed Jun 9, 2023
1 parent ba65122 commit 527b017
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
3 changes: 3 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use_repo(
"cmake_3.23.2_toolchains",
"cmake_src",
"gnumake_src",
"meson_src",
"ninja_1.11.1_toolchains",
"ninja_build_src",
"pkgconfig_src",
Expand All @@ -31,6 +32,8 @@ register_toolchains(
"@rules_foreign_cc_framework_toolchain_macos//:toolchain",
"@rules_foreign_cc_framework_toolchain_windows//:toolchain",
"@rules_foreign_cc//toolchains:built_make_toolchain",
"@rules_foreign_cc//toolchains:built_meson_toolchain",
"@rules_foreign_cc//toolchains:built_pkgconfig_toolchain",
"@rules_foreign_cc//toolchains:preinstalled_autoconf_toolchain",
"@rules_foreign_cc//toolchains:preinstalled_automake_toolchain",
"@rules_foreign_cc//toolchains:preinstalled_m4_toolchain",
Expand Down
33 changes: 33 additions & 0 deletions examples/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,44 @@ local_path_override(
tools = use_extension("@rules_foreign_cc//foreign_cc:extensions.bzl", "tools")
tools.cmake(version = "3.23.1")
tools.ninja(version = "1.11.1")
use_repo(
tools,
"meson_src",
)

bazel_dep(name = "platforms", version = "0.0.6")
bazel_dep(name = "rules_swift", version = "1.6.0", repo_name = "build_bazel_rules_swift")
bazel_dep(name = "rules_apple", version = "2.1.0", repo_name = "build_bazel_rules_apple")
bazel_dep(name = "apple_support", version = "1.4.1", repo_name = "build_bazel_apple_support")
bazel_dep(name = "rules_python", version = "0.22.0")

python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
name = "python3_9",
python_version = "3.9",
)
use_repo(python, "python3_9")
use_repo(python, "python3_9_toolchains")

register_toolchains(
"@python3_9_toolchains//:all",
)

interpreter = use_extension("@rules_python//python/extensions:interpreter.bzl", "interpreter")
interpreter.install(
name = "interpreter_python3_9",
python_name = "python3_9",
)
use_repo(interpreter, "interpreter_python3_9")

pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
name = "pip",
python_interpreter_target = "@interpreter_python3_9//:python",
requirements_lock = "//:requirements_lock.txt",
requirements_windows = "//:requirements_windows.txt",
)
use_repo(pip, "pip")

# bazel_dep(name = "rules_android", version = "0.1.1")
# bazel_dep(name = "rules_jvm_external", version = "5.1")
Expand Down

0 comments on commit 527b017

Please sign in to comment.