Skip to content

Commit 658a645

Browse files
authored
deps: add a lua dependency (#44351)
### What does this PR do? Add a BUILD file for lua ### Motivation Prerequisite for building RPM with lua ### Describe how you validated your changes ### Additional Notes It currently isn't depended upon by anything, this will come shortly when we start building RPM with Bazel (see #44112) Co-authored-by: hugo.beauzee <hugo.beauzee@datadoghq.com>
1 parent f20a1d4 commit 658a645

4 files changed

Lines changed: 52 additions & 5 deletions

File tree

MODULE.bazel.lock

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deps/lua/license

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright © 1994–2025 Lua.org, PUC-Rio.
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

deps/lua/lua.BUILD.bazel

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
load("@rules_license//rules:license.bzl", "license")
2+
load("@rules_cc//cc:cc_library.bzl", "cc_library")
3+
load("@rules_cc//cc:cc_shared_library.bzl", "cc_shared_library")
4+
5+
package(
6+
default_package_metadata = [":license"],
7+
default_visibility = ["//packages:__subpackages__"]
8+
)
9+
10+
license(
11+
name = "license",
12+
license_kinds = ["@rules_license//licenses/spdx:MIT"],
13+
license_text = "license_file",
14+
copyright_notice = "Copyright © 1994–2025 Lua.org, PUC-Rio.",
15+
visibility = ["//visibility:public"],
16+
)
17+
18+
cc_library(
19+
name = "liblua",
20+
srcs = glob(["src/*.c", "src/*.h"], exclude = [
21+
"src/lua.c",
22+
"src/luac.c",
23+
]),
24+
hdrs = [
25+
"src/lauxlib.h",
26+
"src/lua.h",
27+
"src/lua.hpp",
28+
"src/luaconf.h",
29+
"src/lualib.h",
30+
],
31+
visibility = ["//visibility:public"],
32+
strip_include_prefix = "src",
33+
)

deps/repos.MODULE.bazel

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
http_archive = use_repo_rule("//third_party/bazel/tools/build_defs/repo:http.bzl", "http_archive")
44

5-
# Defies a "liblua" target for the lib
6-
bazel_dep(name = "lua", version = "5.4.6")
7-
85
# Defines a "sqlite3" target for the lib
96
bazel_dep(name = "sqlite3", version = "3.46.1")
107

@@ -306,3 +303,15 @@ http_archive(
306303
url = "https://dbus.freedesktop.org/releases/dbus/dbus-1.16.2.tar.xz",
307304
strip_prefix = "dbus-1.16.2",
308305
)
306+
307+
http_archive(
308+
name = "lua",
309+
sha256 = "7d5ea1b9cb6aa0b59ca3dde1c6adcb57ef83a1ba8e5432c0ecd06bf439b3ad88",
310+
url = "https://www.lua.org/ftp/lua-5.4.6.tar.gz",
311+
strip_prefix = "lua-5.4.6",
312+
files = {
313+
"BUILD.bazel": "//deps:lua/lua.BUILD.bazel",
314+
"license_file": "//deps:lua/license",
315+
},
316+
)
317+

0 commit comments

Comments
 (0)