blob: 42aaf37b0b10adffd67ac732e50df6072b949d48 [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", "configure_make")
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:github/alsa-project/alsa-lib@v1.2.12",
)
# Required, so that license.bzl can see the existence of those files.
exports_files(
glob(
include = ["**"],
exclude = ["LICENSE.txt"],
),
visibility = ["//visibility:private"],
)
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 = "alsa-lib Composite License",
identifier = " AND ".join([
"GPL-2.0-or-later WITH Autoconf-exception-2.0",
"LGPL-2.0",
"LGPL-2.1",
]),
)
license(
name = "license",
kind = ":license_kind",
text = ":LICENSE.txt",
)
mirror_url(
name = "mirror_url",
url = "https://third-party-mirror.googlesource.com/alsa-lib",
)
filegroup(
name = "all_srcs",
srcs = glob(["**"]),
)
configure_make(
name = "alsa-lib",
autoreconf = True,
autoreconf_options = [
"-vi",
],
configure_in_place = True,
configure_options = [
"--disable-static",
"--with-versioned=no",
] + select({
"//stardust-build/config:dbg_mode": [],
"//conditions:default": [
"--with-debug=no",
"--enable-symbolic-functions",
],
}),
configure_xcompile = True,
lib_source = ":all_srcs",
linkopts = ["-landroid-shmem"],
out_shared_libs = ["libasound.so"],
visibility = ["//visibility:public"],
deps = [
"//third_party/android-shmem",
],
)