|
|
@ -4,8 +4,9 @@ package("libenvpp") |
|
|
|
set_license("Apache-2.0") |
|
|
|
set_license("Apache-2.0") |
|
|
|
|
|
|
|
|
|
|
|
add_urls("https://github.com/ph3at/libenvpp/archive/refs/tags/$(version).tar.gz", |
|
|
|
add_urls("https://github.com/ph3at/libenvpp/archive/refs/tags/$(version).tar.gz", |
|
|
|
"https://github.com/ph3at/libenvpp.git") |
|
|
|
"https://github.com/ph3at/libenvpp.git", {submodules = false}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
add_versions("v1.4.3", "affbd735b6f47615a54c9159baef9de206cc85badb5af4f662669f3789a13fa8") |
|
|
|
add_versions("v1.4.2", "14b2e14112036b15c7fc2d7e566ee6b2de9c2c55091e8d3de194ebed19f6fc34") |
|
|
|
add_versions("v1.4.2", "14b2e14112036b15c7fc2d7e566ee6b2de9c2c55091e8d3de194ebed19f6fc34") |
|
|
|
add_versions("v1.4.1", "1bcd0a1eb4eef32a53cbb410ae38d708ea662e491cc5536cb9b15d54cc8b5707") |
|
|
|
add_versions("v1.4.1", "1bcd0a1eb4eef32a53cbb410ae38d708ea662e491cc5536cb9b15d54cc8b5707") |
|
|
|
add_versions("v1.4.0", "3f9a4a4b62abc06522de76e3a999cc3cd6b60299dc26b28ccc2183aa614f10cd") |
|
|
|
add_versions("v1.4.0", "3f9a4a4b62abc06522de76e3a999cc3cd6b60299dc26b28ccc2183aa614f10cd") |
|
|
@ -17,15 +18,23 @@ package("libenvpp") |
|
|
|
add_deps("fmt >=9.1.0", {configs = {header_only = false}}) |
|
|
|
add_deps("fmt >=9.1.0", {configs = {header_only = false}}) |
|
|
|
|
|
|
|
|
|
|
|
on_install(function (package) |
|
|
|
on_install(function (package) |
|
|
|
|
|
|
|
local version = package:version() |
|
|
|
|
|
|
|
if package:gitref() or version:ge("1.4.3") then |
|
|
|
|
|
|
|
io.replace("CMakeLists.txt", "fetch_content_from_submodule(fmt external/fmt)", "find_package(fmt REQUIRED CONFIG)\ninclude(CMakePackageConfigHelpers)", {plain = true}) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
local configs = {"-DLIBENVPP_EXAMPLES=OFF", "-DLIBENVPP_TESTS=OFF", "-DLIBENVPP_INSTALL=ON"} |
|
|
|
local configs = {"-DLIBENVPP_EXAMPLES=OFF", "-DLIBENVPP_TESTS=OFF", "-DLIBENVPP_INSTALL=ON"} |
|
|
|
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) |
|
|
|
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) |
|
|
|
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) |
|
|
|
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) |
|
|
|
table.insert(configs, "-DLIBENVPP_CHECKS=" .. (package:is_debug() and "ON" or "OFF")) |
|
|
|
table.insert(configs, "-DLIBENVPP_CHECKS=" .. (package:is_debug() and "ON" or "OFF")) |
|
|
|
import("package.tools.cmake").install(package, configs) |
|
|
|
import("package.tools.cmake").install(package, configs) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if version or version:lt("1.4.3") then |
|
|
|
os.rm(package:installdir("include/fmt")) |
|
|
|
os.rm(package:installdir("include/fmt")) |
|
|
|
os.rm(package:installdir("lib/pkgconfig")) |
|
|
|
os.rm(package:installdir("lib/pkgconfig")) |
|
|
|
os.rm(package:installdir("lib/cmake/fmt")) |
|
|
|
os.rm(package:installdir("lib/cmake/fmt")) |
|
|
|
os.rm(package:installdir("lib/fmt*")) |
|
|
|
os.rm(package:installdir("lib/fmt*")) |
|
|
|
|
|
|
|
end |
|
|
|
end) |
|
|
|
end) |
|
|
|
|
|
|
|
|
|
|
|
on_test(function (package) |
|
|
|
on_test(function (package) |
|
|
|