xmake.lua 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. package("libid3tag")
  2. set_homepage("https://www.underbit.com/products/mad/")
  3. set_description("ID3 tag manipulation library")
  4. set_license("GPL-2.0-or-later")
  5. add_urls("https://codeberg.org/tenacityteam/libid3tag.git",
  6. "https://codeberg.org/tenacityteam/libid3tag/archive/$(version).tar.gz")
  7. add_versions("0.16.3", "0561009778513a95d91dac33cee8418d6622f710450a7cb56a74636d53b588cb")
  8. add_deps("cmake")
  9. add_deps("zlib")
  10. on_install(function (package)
  11. local configs = {"-DCMAKE_POLICY_DEFAULT_CMP0057=NEW"}
  12. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  13. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  14. import("package.tools.cmake").install(package, configs)
  15. end)
  16. on_test(function (package)
  17. assert(package:check_csnippets({test = [[
  18. #include <id3tag.h>
  19. void test() {
  20. struct id3_file *fp_mp3 = id3_file_open("song.mp3", ID3_FILE_MODE_READONLY);
  21. struct id3_tag *tag_mp3 = id3_file_tag(fp_mp3);
  22. struct id3_frame *frame = id3_tag_findframe(tag_mp3, ID3_FRAME_TITLE, 0);
  23. id3_file_close(fp_mp3);
  24. }
  25. ]]}, {configs = {languages = "c11"}}))
  26. end)