xmake.lua 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. package("dav1d")
  2. set_homepage("https://www.videolan.org/projects/dav1d.html")
  3. set_description("dav1d is a new AV1 cross-platform decoder, open-source, and focused on speed, size and correctness.")
  4. set_license("BSD-2-Clause")
  5. add_urls("https://downloads.videolan.org/pub/videolan/dav1d/$(version)/dav1d-$(version).tar.xz")
  6. add_versions("0.9.0", "cfae88e8067c9b2e5b96d95a7a00155c353376fe9b992a96b4336e0eab19f9f6")
  7. add_versions("1.1.0", "fb57aae7875f28c30fb3dbae4a3683d27e2f91dde09ce5c60c22cef9bc58dfd1")
  8. add_deps("nasm", "meson", "ninja")
  9. if is_plat("linux") then
  10. add_syslinks("pthread", "dl")
  11. end
  12. on_install("windows", "macosx", "linux|x86_64", function (package)
  13. local configs = {"-Denable_tests=false"}
  14. table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static"))
  15. if package:is_plat("windows") and package:is_cross() then
  16. table.insert(configs, "-Denable_asm=false") -- arm asm requires bash and gas-preprocessor
  17. end
  18. import("package.tools.meson").install(package, configs)
  19. package:addenv("PATH", "bin")
  20. end)
  21. on_test(function (package)
  22. if not package:is_cross() then
  23. os.vrun("dav1d -v")
  24. end
  25. assert(package:has_cfuncs("dav1d_default_settings", {includes = "dav1d/dav1d.h"}))
  26. end)