Просмотр исходного кода

add libsquish, libde265, robin-map (#561)

* improve sourceforge urls

* fix libsdl_gfx

* add libsquish

* add libde265

* add robin-map
Hoildkv 4 лет назад
Родитель
Сommit
c13b77b1e7

+ 1 - 1
packages/g/giflib/xmake.lua

@@ -4,7 +4,7 @@ package("giflib")
     set_description("A library for reading and writing gif images.")
     set_license("MIT")
 
-    add_urls("https://jaist.dl.sourceforge.net/project/giflib/giflib-$(version).tar.gz")
+    add_urls("https://sourceforge.net/projects/giflib/files/giflib-$(version).tar.gz")
     add_versions("5.2.1", "31da5562f44c5f15d63340a09a4fd62b48c45620cd302f77a6d9acf0077879bd")
 
     add_configs("utils", {description = "Build utility binaries.", default = true, type = "boolean"})

+ 1 - 1
packages/i/irrxml/xmake.lua

@@ -3,7 +3,7 @@ package("irrxml")
     set_homepage("https://sourceforge.net/projects/irrlicht/")
     set_description("High speed and easy-to-use XML Parser for C++")
 
-    set_urls("https://deac-fra.dl.sourceforge.net/project/irrlicht/irrXML%20SDK/$(version)/irrxml-$(version).zip")
+    set_urls("https://sourceforge.net/projects/irrlicht/files/irrXML%20SDK/$(version)/irrxml-$(version).zip")
     add_versions("1.2", "9b4f80639b2dee3caddbf75862389de684747df27bea7d25f96c7330606d7079")
 
     on_install(function (package)

+ 30 - 0
packages/l/libde265/xmake.lua

@@ -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)

+ 7 - 5
packages/l/libsdl_gfx/xmake.lua

@@ -5,7 +5,7 @@ package("libsdl_gfx")
 
     if is_plat("windows") then
         set_urls("https://www.ferzkopp.net/Software/SDL2_gfx/SDL2_gfx-$(version).zip", {alias = "ferzkopp"})
-        add_urls("https://ufpr.dl.sourceforge.net/project/sdl2gfx/SDL2_gfx-$(version).tar.gz", {alias = "sourceforge"})
+        add_urls("https://sourceforge.net/projects/sdl2gfx/files/SDL2_gfx-$(version).tar.gz", {alias = "sourceforge"})
         add_versions("ferzkopp:1.0.4", "b6da07583b7fb8f4d8cee97cac9176b97a287f56a8112e22f38183ecf47b9dcb")
         add_versions("sourceforge:1.0.4", "63e0e01addedc9df2f85b93a248f06e8a04affa014a835c2ea34bfe34e576262")
 
@@ -13,18 +13,20 @@ package("libsdl_gfx")
         add_patches("1.0.4", path.join(os.scriptdir(), "patches", "1.0.4", "lrint_fix.patch"), "9fb928306fb25293720214377bff2f605f60ea26f43ea5346cf1268c504aff1a")
     elseif is_plat("macosx", "linux") then
         set_urls("https://www.ferzkopp.net/Software/SDL2_gfx/SDL2_gfx-$(version).tar.gz")
-        add_urls("https://ufpr.dl.sourceforge.net/project/sdl2gfx/SDL2_gfx-$(version).tar.gz")
+        add_urls("https://sourceforge.net/projects/sdl2gfx/files/SDL2_gfx-$(version).tar.gz")
         add_versions("1.0.4", "63e0e01addedc9df2f85b93a248f06e8a04affa014a835c2ea34bfe34e576262")
     end
 
     add_deps("libsdl")
-    on_load(function(package)
-        package:add("includedirs", "include")
-    end)
 
     add_links("SDL2_gfx")
 
     on_install("windows", function(package)
+        local vs = import("core.tool.toolchain").load("msvc"):config("vs")
+        if tonumber(vs) < 2019 then
+            raise("Your compiler is too old to use this library.")
+        end
+
         local file_name = "SDL2_gfx.vcxproj"
         local content = io.readfile(file_name)
         content = content:gsub("%%%(AdditionalIncludeDirectories%)", package:dep("libsdl"):installdir("include", "SDL2") .. ";%%%(AdditionalIncludeDirectories%)")

+ 35 - 0
packages/l/libsquish/xmake.lua

@@ -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)

+ 1 - 0
packages/l/libtiff/xmake.lua

@@ -7,6 +7,7 @@ package("libtiff")
              "https://gitlab.com/libtiff/libtiff.git")
     add_versions("v4.1.0", "fddd8838e7e57ba20a93b17706c3f9fe68c8711a6321f04b9ce9a9c24196ac74")
     add_versions("v4.2.0", "f87463ac8984b43e8dd84a04c14816f5f217796d9f1f459756239c499857e75a")
+    add_versions("v4.3.0", "5abe48cb2ea469fefb36d85718ddb1b9f28f95c87063e006696c83f23f5b8e41")
 
     add_deps("zlib")
     add_deps("cmake")

+ 1 - 1
packages/l/libuuid/xmake.lua

@@ -3,7 +3,7 @@ package("libuuid")
     set_homepage("https://sourceforge.net/projects/libuuid")
     set_description("Portable uuid C library")
 
-    set_urls("https://jaist.dl.sourceforge.net/project/libuuid/libuuid-$(version).tar.gz",
+    set_urls("https://sourceforge.net/projects/libuuid/files/libuuid-$(version).tar.gz",
              "https://git.code.sf.net/p/libuuid/code.git")
 
     add_versions("1.0.3", "46af3275291091009ad7f1b899de3d0cea0252737550e7919d17237997db5644")

+ 2 - 2
packages/m/mingw-w64/xmake.lua

@@ -5,10 +5,10 @@ package("mingw-w64")
     set_description("The mingw-w64 project is a complete runtime environment for gcc to support binaries native to Windows 64-bit and 32-bit operating systems.")
 
     if is_arch("x86") then
-        add_urls("https://jaist.dl.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/$(version)/threads-posix/sjlj/i686-$(version)-release-posix-sjlj-rt_v6-rev0.7z")
+        add_urls("https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/$(version)/threads-posix/sjlj/i686-$(version)-release-posix-sjlj-rt_v6-rev0.7z")
         add_versions("8.1.0", "f5b97d1a8c15f527c0f0397d0f128ff0af6acc9fab1ecd79ad403661c0a425ac")
     else
-        add_urls("https://jaist.dl.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/$(version)/threads-posix/seh/x86_64-$(version)-release-posix-seh-rt_v6-rev0.7z")
+        add_urls("https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/$(version)/threads-posix/seh/x86_64-$(version)-release-posix-seh-rt_v6-rev0.7z")
         add_versions("8.1.0", "853970527b5de4a55ec8ca4d3fd732c00ae1c69974cc930c82604396d43e79f8")
     end
 

+ 25 - 0
packages/r/robin-map/xmake.lua

@@ -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)

+ 1 - 1
packages/t/tinyxml/xmake.lua

@@ -4,7 +4,7 @@ package("tinyxml")
     set_description("TinyXML is a simple, small, minimal, C++ XML parser that can be easily integrating into other programs.")
     set_license("zlib")
 
-    add_urls("https://jaist.dl.sourceforge.net/project/tinyxml/tinyxml/$(version).zip", {version = function (version) return version .. "/tinyxml_" .. version:gsub("%.", "_") end})
+    add_urls("https://sourceforge.net/projects/tinyxml/files/tinyxml/$(version).zip", {version = function (version) return version .. "/tinyxml_" .. version:gsub("%.", "_") end})
     add_versions("2.6.2", "ac6bb9501c6f50cc922d22f26b02fab168db47521be5e845b83d3451a3e1d512")
 
     on_install(function (package)