瀏覽代碼

speex: add new package (#7694)

* speex: add new package

* just limit android@windows and windows
Saikari 1 月之前
父節點
當前提交
69feca53ce

+ 13 - 0
packages/s/speex/patches/1.2.1/filter-subdirs.patch

@@ -0,0 +1,13 @@
+diff --git a/Makefile.am b/Makefile.am
+index dc90415..3b3c16d 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -14,7 +14,7 @@ pkgconfig_DATA = speex.pc
+ EXTRA_DIST = Speex.spec Speex.spec.in Speex.kdevelop speex.m4 speex.pc.in README.blackfin README.symbian README.TI-DSP
+ 
+ #Fools KDevelop into including all files
+-SUBDIRS = libspeex include doc win32 symbian ti
++SUBDIRS = libspeex include
+ 
+ if BUILD_BINARIES
+ SUBDIRS += src

+ 13 - 0
packages/s/speex/patches/1.2.1/fix-ac-compile-ifelse.patch

@@ -0,0 +1,13 @@
+diff --git a/configure.ac b/configure.ac
+index d94c2fe..b813148 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -37,7 +37,7 @@ AC_C_RESTRICT
+ 
+ 
+ AC_MSG_CHECKING(for C99 variable-size arrays)
+-+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
++AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
+ int foo;
+ foo = 10;
+ int array[foo];

+ 27 - 0
packages/s/speex/xmake.lua

@@ -0,0 +1,27 @@
+package("speex")
+    set_homepage("https://www.speex.org/")
+    set_description("A free codec for free speech")
+    set_license("BSD-3-Clause")
+
+    add_urls("https://github.com/xiph/speex/archive/refs/tags/Speex-$(version).tar.gz",
+             "https://github.com/xiph/speex.git")
+
+    add_versions("1.2.1", "beaf2642e81a822eaade4d9ebf92e1678f301abfc74a29159c4e721ee70fdce0")
+
+    add_patches("1.2.1", "patches/1.2.1/filter-subdirs.patch", "00e740f7dc7d17f1d71206b13c596d61f85e92a44cee39441c9f00f4ad93d045")
+    add_patches("1.2.1", "patches/1.2.1/fix-ac-compile-ifelse.patch", "446babf535de9aa3dae30bbd3983b662a3162cf149280413eb2e483836eb2039")
+
+    add_deps("autotools")
+
+    on_install("linux", "macosx", "bsd", "mingw", "wasm", "cross", "iphoneos", "android@linux,macosx", function (package)
+        local configs = {"--disable-binaries"}
+        table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
+        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:has_cfuncs("speex_encoder_init", {includes = "speex/speex.h"}))
+    end)