From ae285821f5bf04ef0960673584a98e0dac772f78 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 10 Sep 2023 22:04:37 +0800 Subject: [PATCH] add alsa-lib (#2583) * add alsa-lib * fix test * enable shared * enable debug --- packages/a/alsa-lib/xmake.lua | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 packages/a/alsa-lib/xmake.lua diff --git a/packages/a/alsa-lib/xmake.lua b/packages/a/alsa-lib/xmake.lua new file mode 100644 index 000000000..12a96afa5 --- /dev/null +++ b/packages/a/alsa-lib/xmake.lua @@ -0,0 +1,26 @@ +package("alsa-lib") + set_homepage("https://alsa-project.org/wiki/Main_Page") + set_description("The Advanced Linux Sound Architecture (ALSA) provides audio and MIDI functionality to the Linux operating system.") + + set_urls("http://www.alsa-project.org/files/pub/lib/alsa-lib-$(version).tar.bz2") + + add_versions("1.2.10", "c86a45a846331b1b0aa6e6be100be2a7aef92efd405cf6bac7eef8174baa920e") + + on_install("linux", function (package) + local configs = {} + table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) + table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes")) + if package:is_debug() then + table.insert(configs, "--enable-debug") + end + import("package.tools.autoconf").install(package, configs) + end) + + on_test(function (package) + assert(package:check_csnippets({test = [[ + void test() { + snd_ctl_card_info_t *info; + snd_ctl_card_info_alloca(&info); + } + ]]}, {includes = {"alsa/asoundlib.h"}})) + end)