From f44a7ba9c6da8e8d3b35fa42e3699ef79ce1c9c8 Mon Sep 17 00:00:00 2001 From: elkPi Date: Fri, 8 Sep 2023 09:40:40 +0800 Subject: [PATCH] add package mpg123 (#2551) * add package mpg123 * filter plat --- packages/m/mpg123/xmake.lua | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 packages/m/mpg123/xmake.lua diff --git a/packages/m/mpg123/xmake.lua b/packages/m/mpg123/xmake.lua new file mode 100644 index 000000000..5626e1670 --- /dev/null +++ b/packages/m/mpg123/xmake.lua @@ -0,0 +1,28 @@ +package("mpg123") + set_homepage("https://www.mpg123.de/") + set_description("Fast console MPEG Audio Player and decoder library") + + add_urls("https://sourceforge.net/projects/mpg123/files/mpg123/$(version)/mpg123-$(version).tar.bz2") + + add_versions("1.30.2", "c7ea863756bb79daed7cba2942ad3b267a410f26d2dfbd9aaf84451ff28a05d7") + + add_deps("autoconf", "automake", "libtool") + if is_plat("linux") then + add_syslinks("m") + end + + on_install("linux", "macosx", "android", "iphoneos", "bsd", "cross", function (package) + local configs = {} + table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) + if package:debug() then + table.insert(configs, "--enable-debug") + end + if package:is_plat("linux") and package:config("pic") ~= false then + table.insert(configs, "--with-pic") + end + import("package.tools.autoconf").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("mpg123_init", {includes = "mpg123.h"})) + end)