add libsquish, libde265, robin-map (#561)
* improve sourceforge urls * fix libsdl_gfx * add libsquish * add libde265 * add robin-mappull/562/head
parent
5b9f85d86b
commit
c13b77b1e7
10 changed files with 104 additions and 11 deletions
@ -0,0 +1,30 @@ |
||||
package("libde265") |
||||
|
||||
set_homepage("https://www.libde265.org/") |
||||
set_description("Open h.265 video codec implementation.") |
||||
set_license("LGPL-3.0") |
||||
|
||||
add_urls("https://github.com/strukturag/libde265/releases/download/v$(version)/libde265-$(version).tar.gz") |
||||
add_versions("1.0.8", "24c791dd334fa521762320ff54f0febfd3c09fc978880a8c5fbc40a88f21d905") |
||||
|
||||
add_deps("cmake") |
||||
if is_plat("linux") then |
||||
add_syslinks("pthread") |
||||
end |
||||
on_load("windows", function (package) |
||||
if not package:config("shared") then |
||||
package:add("defines", "LIBDE265_STATIC_BUILD") |
||||
end |
||||
end) |
||||
|
||||
on_install("windows", "macosx", "linux", "mingw", "android", function (package) |
||||
local configs = {"-DENABLE_SDL=OFF"} |
||||
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) |
||||
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) |
||||
table.insert(configs, "-DDISABLE_SSE=" .. (package:is_arch("x86", "x64", "x86_64") and "OFF" or "ON")) |
||||
import("package.tools.cmake").install(package, configs) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cfuncs("de265_new_decoder", {includes = "libde265/de265.h"})) |
||||
end) |
@ -0,0 +1,35 @@ |
||||
package("libsquish") |
||||
|
||||
set_homepage("https://sourceforge.net/projects/libsquish/") |
||||
set_description("The libSquish library compresses images with the DXT standard (also known as S3TC).") |
||||
set_license("MIT") |
||||
|
||||
add_urls("https://sourceforge.net/projects/libsquish/files/libsquish-$(version).tgz") |
||||
add_versions("1.15", "628796eeba608866183a61d080d46967c9dda6723bc0a3ec52324c85d2147269") |
||||
|
||||
add_configs("openmp", {description = "Enable OpenMP build.", default = false, type = "boolean"}) |
||||
if is_plat("windows") then |
||||
add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) |
||||
end |
||||
|
||||
add_deps("cmake") |
||||
on_install("windows", "macosx", "linux", function (package) |
||||
local configs = {} |
||||
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) |
||||
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) |
||||
table.insert(configs, "-DBUILD_SQUISH_WITH_OPENMP=" .. (package:config("openmp") and "ON" or "OFF")) |
||||
import("package.tools.cmake").install(package, configs) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:check_cxxsnippets({test = [[ |
||||
void test() { |
||||
using namespace squish; |
||||
u8 input[4*16]; |
||||
u8 output[4*16]; |
||||
u8 block[16]; |
||||
Compress( input, block, kDxt1 ); |
||||
Decompress( output, block, kDxt1 ); |
||||
} |
||||
]]}, {configs = {languages = "c++11"}, includes = "squish.h"})) |
||||
end) |
@ -0,0 +1,25 @@ |
||||
package("robin-map") |
||||
|
||||
set_kind("library", {headeronly = true}) |
||||
set_homepage("https://github.com/Tessil/robin-map") |
||||
set_description("A C++ implementation of a fast hash map and hash set using robin hood hashing") |
||||
set_license("MIT") |
||||
|
||||
add_urls("https://github.com/Tessil/robin-map/archive/refs/tags/$(version).tar.gz") |
||||
add_versions("v0.6.3", "e6654c8c2598f63eb0b1d52ff8bdf39cfcc91d81dd5d05274a6dca91241cd72f") |
||||
|
||||
add_deps("cmake") |
||||
on_install(function (package) |
||||
import("package.tools.cmake").install(package) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:check_cxxsnippets({test = [[ |
||||
void test() { |
||||
tsl::robin_map<int, int> map = {{1, 1}, {2, 1}, {3, 1}}; |
||||
for (auto it = map.begin(); it != map.end(); ++it) { |
||||
it.value() = 2; |
||||
} |
||||
} |
||||
]]}, {configs = {languages = "c++11"}, includes = "tsl/robin_map.h"})) |
||||
end) |
Loading…
Reference in new issue