From 930a061d9c3fb8e11dd0a8d64315d86591b6e239 Mon Sep 17 00:00:00 2001 From: ping Date: Thu, 13 Oct 2022 16:46:34 +0000 Subject: [PATCH] add opencore-amr --- packages/o/opencore-amr/xmake.lua | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 packages/o/opencore-amr/xmake.lua diff --git a/packages/o/opencore-amr/xmake.lua b/packages/o/opencore-amr/xmake.lua new file mode 100644 index 000000000..fddddaccc --- /dev/null +++ b/packages/o/opencore-amr/xmake.lua @@ -0,0 +1,30 @@ +package("opencore-amr") + set_homepage("https://opencore-amr.sourceforge.io") + set_description("Library of OpenCORE Framework implementation of Adaptive Multi Rate Narrowband and Wideband (AMR-NB and AMR-WB) speech codec.") + + add_urls("https://sourceforge.net/projects/opencore-amr/files/opencore-amr/opencore-amr-$(version).tar.gz") + + add_versions("0.1.6", "483eb4061088e2b34b358e47540b5d495a96cd468e361050fae615b1809dc4a1") + + add_deps("autoconf", "automake", "libtool") + -- if is_plat("linux") then + -- add_syslinks("m") + -- end + + on_install(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("Decoder_Interface_init", {includes = "opencore-amrnb/interf_dec.h"})) + assert(package:has_cfuncs("Encoder_Interface_init", {includes = "opencore-amrnb/interf_enc.h"})) + assert(package:has_cfuncs("D_IF_init", {includes = "opencore-amrwb/dec_if.h"})) + end)