|
@@ -2,6 +2,7 @@ package("zstd")
|
|
|
|
|
|
set_homepage("https://www.zstd.net/")
|
|
set_homepage("https://www.zstd.net/")
|
|
set_description("Zstandard - Fast real-time compression algorithm")
|
|
set_description("Zstandard - Fast real-time compression algorithm")
|
|
|
|
+ set_license("BSD-3-Clause")
|
|
|
|
|
|
set_urls("https://github.com/facebook/zstd/archive/$(version).tar.gz",
|
|
set_urls("https://github.com/facebook/zstd/archive/$(version).tar.gz",
|
|
"https://github.com/facebook/zstd.git")
|
|
"https://github.com/facebook/zstd.git")
|
|
@@ -9,6 +10,12 @@ package("zstd")
|
|
add_versions("v1.5.0", "0d9ade222c64e912d6957b11c923e214e2e010a18f39bec102f572e693ba2867")
|
|
add_versions("v1.5.0", "0d9ade222c64e912d6957b11c923e214e2e010a18f39bec102f572e693ba2867")
|
|
add_versions("v1.5.2", "f7de13462f7a82c29ab865820149e778cbfe01087b3a55b5332707abf9db4a6e")
|
|
add_versions("v1.5.2", "f7de13462f7a82c29ab865820149e778cbfe01087b3a55b5332707abf9db4a6e")
|
|
|
|
|
|
|
|
+ on_load("windows", function (package)
|
|
|
|
+ if package:config("shared") then
|
|
|
|
+ package:add("defines", "ZSTD_DLL_IMPORT=1")
|
|
|
|
+ end
|
|
|
|
+ end)
|
|
|
|
+
|
|
on_install(function (package)
|
|
on_install(function (package)
|
|
io.writefile("xmake.lua", ([[
|
|
io.writefile("xmake.lua", ([[
|
|
set_version("%s")
|
|
set_version("%s")
|
|
@@ -19,10 +26,11 @@ package("zstd")
|
|
add_files("lib/common/*.c")
|
|
add_files("lib/common/*.c")
|
|
add_files("lib/compress/*.c")
|
|
add_files("lib/compress/*.c")
|
|
add_files("lib/decompress/*.c")
|
|
add_files("lib/decompress/*.c")
|
|
|
|
+ add_files("lib/dictBuilder/*.c")
|
|
add_headerfiles("lib/*.h")
|
|
add_headerfiles("lib/*.h")
|
|
add_defines("XXH_NAMESPACE=ZSTD_")
|
|
add_defines("XXH_NAMESPACE=ZSTD_")
|
|
if is_kind("shared") and is_plat("windows") then
|
|
if is_kind("shared") and is_plat("windows") then
|
|
- add_defines("ZSTD_DLL_EXPORT")
|
|
|
|
|
|
+ add_defines("ZSTD_DLL_EXPORT=1")
|
|
end
|
|
end
|
|
on_config(function (target)
|
|
on_config(function (target)
|
|
if target:is_arch("x64", "x86_64") and target:has_tool("cc", "clang", "gcc") then
|
|
if target:is_arch("x64", "x86_64") and target:has_tool("cc", "clang", "gcc") then
|
|
@@ -32,7 +40,6 @@ package("zstd")
|
|
end
|
|
end
|
|
end)
|
|
end)
|
|
]]):format(package:version_str()))
|
|
]]):format(package:version_str()))
|
|
-
|
|
|
|
import("package.tools.xmake").install(package)
|
|
import("package.tools.xmake").install(package)
|
|
end)
|
|
end)
|
|
|
|
|