xmake.lua 1.2 KB

123456789101112131415161718192021222324252627
  1. package("speex")
  2. set_homepage("https://www.speex.org/")
  3. set_description("A free codec for free speech")
  4. set_license("BSD-3-Clause")
  5. add_urls("https://github.com/xiph/speex/archive/refs/tags/Speex-$(version).tar.gz",
  6. "https://github.com/xiph/speex.git")
  7. add_versions("1.2.1", "beaf2642e81a822eaade4d9ebf92e1678f301abfc74a29159c4e721ee70fdce0")
  8. add_patches("1.2.1", "patches/1.2.1/filter-subdirs.patch", "00e740f7dc7d17f1d71206b13c596d61f85e92a44cee39441c9f00f4ad93d045")
  9. add_patches("1.2.1", "patches/1.2.1/fix-ac-compile-ifelse.patch", "446babf535de9aa3dae30bbd3983b662a3162cf149280413eb2e483836eb2039")
  10. add_deps("autotools")
  11. on_install("linux", "macosx", "bsd", "mingw", "wasm", "cross", "iphoneos", "android@linux,macosx", function (package)
  12. local configs = {"--disable-binaries"}
  13. table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
  14. if package:is_debug() then
  15. table.insert(configs, "--enable-debug")
  16. end
  17. import("package.tools.autoconf").install(package, configs)
  18. end)
  19. on_test(function (package)
  20. assert(package:has_cfuncs("speex_encoder_init", {includes = "speex/speex.h"}))
  21. end)