blob: dca7fe8f1b174b604f6d05cf4a90b2b8074caff1 [file] [edit]
load("@bazel_lib//lib:write_source_files.bzl", "write_source_file")
load("@package_metadata//licenses/rules:license.bzl", "license")
load("@package_metadata//licenses/rules:license_kind.bzl", "license_kind")
load("@package_metadata//rules:package_metadata.bzl", "package_metadata")
load("@rules_foreign_cc//foreign_cc:defs.bzl", "meson")
load("@stardust_build_package_metadata_mirror_url//:mirror_url.bzl", "mirror_url")
load(":license.bzl", "concat_package_licenses")
package(
default_package_metadata = [":package_metadata"],
)
package_metadata(
name = "package_metadata",
attributes = [
":license",
":mirror_url",
],
purl = "pkg:gitlab/GNOME/glib@2.82.4?repository_url=https%3A%2F%2Fgitlab.gnome.org",
)
concat_package_licenses(
name = "concat_licenses",
)
write_source_file(
name = "write_license",
in_file = ":concat_licenses",
out_file = "LICENSE.txt",
)
license_kind(
name = "license_kind",
full_name = "GLib Composite License",
identifier = " AND ".join([
"Apache-2.0",
"BSD-4-Clause",
"CC0-1.0",
"FSFULLR",
"GCR-docs",
"GPL-2.0-or-later WITH Autoconf-exception-2.0",
"LGPL-2.0",
"LGPL-2.1",
"LicenseRef-Public-Domain-MD5",
"LicenseRef-check-gdk-permissive",
"MIT",
"MPL-1.1",
"Unicode-TOU",
]),
)
license(
name = "license",
kind = ":license_kind",
text = ":LICENSE.txt",
)
mirror_url(
name = "mirror_url",
url = "https://third-party-mirror.googlesource.com/glib",
)
filegroup(
name = "all_srcs",
srcs = glob(["**"]),
)
meson(
name = "glib",
lib_source = ":all_srcs",
options = {
"introspection": "disabled",
"libmount": "disabled",
"man-pages": "disabled",
"tests": "false",
"selinux": "disabled",
"libelf": "disabled",
},
out_binaries = [
"glib-mkenums",
"glib-genmarshal",
"glib-compile-resources",
"glib-compile-schemas",
],
out_data_dirs = ["lib/pkgconfig"],
out_shared_libs = [
"libglib-2.0.so",
"libgobject-2.0.so",
"libgio-2.0.so",
"libgmodule-2.0.so",
"libgthread-2.0.so",
],
resource_size = "large",
target_args = {
# Force meson to install *.so files to the lib directory, otherwise, meson installs to
# different folders even on different Linux distros.
"setup": [
"--libdir=lib",
"--wrap-mode=nodownload",
],
},
visibility = ["//visibility:public"],
deps = [
"//third_party/gettext-tiny:intl",
"//third_party/libffi",
"//third_party/pcre2:pcre2_cmake",
"//third_party/zlib",
],
)
filegroup(
name = "gen_dir",
srcs = [":glib"],
output_group = "gen_dir",
visibility = ["//visibility:public"],
)