xmake.lua 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package("alsa-lib")
  2. set_homepage("https://alsa-project.org/wiki/Main_Page")
  3. set_description("The Advanced Linux Sound Architecture (ALSA) provides audio and MIDI functionality to the Linux operating system.")
  4. set_license("LGPL-2.1")
  5. add_urls("http://www.alsa-project.org/files/pub/lib/alsa-lib-$(version).tar.bz2", {alias = "home"})
  6. add_urls("https://github.com/alsa-project/alsa-lib/archive/refs/tags/v$(version).tar.gz", {alias = "github"})
  7. add_versions("home:1.2.10", "c86a45a846331b1b0aa6e6be100be2a7aef92efd405cf6bac7eef8174baa920e")
  8. add_versions("github:1.2.10", "f55749847fd98274501f4691a2d847e89280c07d40a43cdac43d6443f69fc939")
  9. add_configs("versioned", {description = "pass flag --without-versioned", default = true, type = "boolean"})
  10. if is_plat("linux") then
  11. add_syslinks("pthread")
  12. add_extsources("pacman::alsa-lib", "apt::libasound2-dev")
  13. end
  14. if not is_plat("windows") then
  15. add_deps("autoconf", "automake", "libtool", "m4")
  16. end
  17. on_install("linux", function (package)
  18. local configs = {}
  19. table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
  20. table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
  21. if package:is_debug() then
  22. table.insert(configs, "--enable-debug")
  23. end
  24. if package:config("versioned")then
  25. table.insert(configs, "--without-versioned")
  26. end
  27. import("package.tools.autoconf").install(package, configs)
  28. end)
  29. on_test(function (package)
  30. assert(package:has_cfuncs("snd_pcm_open", {includes = "alsa/asoundlib.h"}))
  31. end)