Merge pull request #115 from xq114/master

add package brotli
pull/116/head
ruki 4 years ago committed by GitHub
commit fb42b11d1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      packages/b/blosc/xmake.lua
  2. 39
      packages/b/brotli/xmake.lua

@ -28,11 +28,11 @@ package("blosc")
if package:is_plat("windows", "mingw") then
-- special concern for legacy versions which keep producing the shared library
local version = package:version()
if version:le("1.10") and not package:config("shared") then
os.rm(path.join(package:installdir("lib"), "blosc.lib"))
elseif package:config("shared") then
if package:config("shared") then
os.cp("build/install/bin", package:installdir())
package:addenv("PATH", "bin")
elseif version:le("1.10") then
os.rm(path.join(package:installdir("lib"), "blosc.lib"))
end
end
end)

@ -0,0 +1,39 @@
package("brotli")
set_homepage("https://github.com/google/brotli")
set_description("Brotli compression format.")
set_urls("https://github.com/google/brotli/archive/v$(version).tar.gz",
"https://github.com/google/brotli.git")
add_versions("1.0.9", "f9e8d81d0405ba66d181529af42a3354f838c939095ff99930da6aa9cdf6fe46")
add_deps("cmake")
on_install("linux", "macosx", "windows", function(package)
local configs = {"-DBUILD_TESTING=OFF"}
-- NOTE: BUILD_SHARED_LIBS not supported now, may be added in future.
-- table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
import("package.tools.cmake").install(package, configs, {buildir = "builddir"})
os.cp("builddir/install/bin", package:installdir())
if package:config("shared") then
os.rm(path.join(package:installdir("lib"), "*-static.*"))
else
for _, name in ipairs({"brotlicommon", "brotlienc", "brotlidec"}) do
os.rm(path.join(package:installdir("lib"), "*" .. name .. ".*"))
os.rm(path.join(package:installdir("bin"), name .. ".dll"))
end
end
package:addenv("PATH", "bin")
end)
on_test(function(package)
os.vrun("brotli --version")
assert(package:check_csnippets([[
void test() {
BrotliEncoderState* s = BrotliEncoderCreateInstance(NULL, NULL, NULL);
BrotliEncoderDestroyInstance(s);
}
]], {includes = "brotli/encode.h"}))
end)
Loading…
Cancel
Save