xmake.lua 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package("ocilib")
  2. set_homepage("http://www.ocilib.net")
  3. set_description("OCILIB (C and C++ Drivers for Oracle) - Open source C and C++ library for accessing Oracle databases")
  4. set_license("Apache-2.0")
  5. add_urls("https://github.com/vrogier/ocilib/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/vrogier/ocilib.git")
  7. add_versions("v4.8.0", "dcaffe0766d9517ae2234e285dd07cae604c792c4016a9834584674f00e9b2ca")
  8. add_versions("v4.7.7", "92822cc683048d3a2cddbbc7835062a02a9011ed2d7382da52a4c120e8c911ab")
  9. add_versions("v4.7.6", "43f5093cac645518ad5bc8d6f48f5b77e12372ef84dc87ddb3a54c40e425bd26")
  10. add_patches("4.7.7", "patches/4.7.7/fix-gcc14.patch", "33253876d5bdffe6fd74372a812a54733b58bdc25368a5205220ffb56984da5c")
  11. add_configs("unicode", {description = "Enable Unicode", default = true, type = "boolean"})
  12. on_install(function (package)
  13. if not package:config("shared") then
  14. package:add("defines", "OCI_LIB_LOCAL_COMPILE")
  15. end
  16. io.replace("include/ocilibcpp/detail/core/SmartHandle.hpp",
  17. ".Set<SmartHandle*>",
  18. ".template Set<SmartHandle*>", {plain = true})
  19. local configs = {
  20. unicode = package:config("unicode")
  21. }
  22. os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua")
  23. import("package.tools.xmake").install(package, configs)
  24. end)
  25. on_test(function (package)
  26. assert(package:has_cfuncs("OCI_Initialize", {includes = "ocilib.h"}))
  27. assert(package:check_cxxsnippets({test = [[
  28. #include <ocilib.hpp>
  29. void test() {
  30. ocilib::Environment::Initialize();
  31. }
  32. ]]}, {configs = {languages = "c++11"}}))
  33. end)