Browse Source

rename libsdl2 deps (#6317)

* rename libsdl2 deps

* Update xmake.lua

* fix blah
ruki 5 months ago
parent
commit
86d70f6d94

+ 4 - 4
packages/b/blah/xmake.lua

@@ -7,7 +7,7 @@ package("blah")
     add_versions("2023.01.03", "a0cccca457cfb91213fae6e4e994d1c181c358fe")
 
     add_deps("cmake")
-    add_deps("libsdl >=2.26")
+    add_deps("libsdl2 >=2.26")
 
     if is_plat("macosx") then
         add_frameworks("ForceFeedback", "CoreVideo", "CoreGraphics", "CoreFoundation", "Foundation", "AppKit", "IOKit")
@@ -21,13 +21,13 @@ package("blah")
         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"))
         io.replace("CMakeLists.txt", "if (NOT DEFINED BLAH_SDL2_LIBS)", "IF(FALSE)", {plain = true})
-        import("package.tools.cmake").build(package, configs, {buildir = "build", packagedeps = "libsdl"})
+        import("package.tools.cmake").build(package, configs, {buildir = "build", packagedeps = "libsdl2"})
         os.cp("include", package:installdir())
         os.trycp("build/*.a", package:installdir("lib"))
         os.trycp("build/*.so", package:installdir("lib"))
         os.trycp("build/*.dylib", package:installdir("lib"))
-        os.trycp("build/*/*.lib", package:installdir("lib"))
-        os.trycp("build/*/*.dll", package:installdir("bin"))
+        os.trycp("build/**.lib", package:installdir("lib"))
+        os.trycp("build/**.dll", package:installdir("bin"))
     end)
 
     on_test(function (package)

+ 5 - 5
packages/c/centurion/xmake.lua

@@ -28,8 +28,8 @@ package("centurion")
     add_includedirs("include", "include/SDL2")
 
     on_load(function (package)
-        package:add("deps", "libsdl", { configs = { shared = package:config("shared") } })
-        
+        package:add("deps", "libsdl2", { configs = { shared = package:config("shared") } })
+
         if not package:config("pragma_once") then
             package:add("defines", "CENTURION_NO_PRAGMA_ONCE")
         end
@@ -38,17 +38,17 @@ package("centurion")
         end
 
         if package:config("sdl_image") then
-            package:add("deps", "libsdl_image", { configs = { shared = package:config("shared") } })
+            package:add("deps", "libsdl2_image", { configs = { shared = package:config("shared") } })
         else
             package:add("defines", "CENTURION_NO_SDL_IMAGE")
         end
         if package:config("sdl_mixer") then
-            package:add("deps", "libsdl_mixer", { configs = { shared = package:config("shared") } })
+            package:add("deps", "libsdl2_mixer", { configs = { shared = package:config("shared") } })
         else
             package:add("defines", "CENTURION_NO_SDL_MIXER")
         end
         if package:config("sdl_ttf") then
-            package:add("deps", "libsdl_ttf", { configs = { shared = package:config("shared") } })
+            package:add("deps", "libsdl2_ttf", { configs = { shared = package:config("shared") } })
         else
             package:add("defines", "CENTURION_NO_SDL_TTF")
         end

+ 2 - 2
packages/c/cimgui/port/xmake.lua

@@ -14,7 +14,7 @@ if has_config("glfw") then
 end
 
 if has_config("sdl2") then
-    add_requires("libsdl")
+    add_requires("libsdl2")
 end
 
 if has_config("vulkan") then
@@ -63,7 +63,7 @@ target("cimgui")
             add_files("imgui/backends/imgui_impl_sdl.cpp")
             add_headerfiles("imgui/(backends/imgui_impl_sdl.h)")
         end
-        add_packages("libsdl")
+        add_packages("libsdl2")
     end
 
     if has_config("vulkan") then

+ 7 - 1
packages/c/cimgui/xmake.lua

@@ -25,9 +25,15 @@ package("cimgui")
 
     add_deps("luajit", {private = true})
 
+    on_check(function (package)
+        if package:is_arch("arm.*") then
+            raise("package(cimgui/arm64): unsupported arch, because it depends on luajit, we need to improve luajit first.")
+        end
+    end)
+
     on_load(function (package)
         if package:config("sdl2") then
-            package:add("deps", "libsdl")
+            package:add("deps", "libsdl2")
             package:add("defines", "CIMGUI_USE_SDL2")
         end
         if package:config("opengl2") then

+ 1 - 1
packages/m/magnum/xmake.lua

@@ -57,7 +57,7 @@ package("magnum")
             package:add("deps", "glfw")
         end
         if package:config("sdl2") then
-            package:add("deps", "libsdl", {configs = {sdlmain = false}})
+            package:add("deps", "libsdl2", {configs = {sdlmain = false}})
         end
         if package:config("glx") then
             package:add("deps", "libx11")

+ 5 - 5
packages/p/pdcurses/xmake.lua

@@ -14,18 +14,18 @@ package("pdcurses")
 
     on_load(function (package)
         if package:config("port") == "sdl2" then
-            package:add("deps", "libsdl")
+            package:add("deps", "libsdl2")
         else
             package:add("syslinks", "user32", "advapi32")
         end
     end)
-    
+
     on_install("linux", "macosx", "mingw", "windows", function (package)
         io.writefile("xmake.lua", [[
             add_rules("mode.debug", "mode.release")
             option("port", {description = "Set the target port."})
             if is_config("port", "sdl2") then
-                add_requires("libsdl")
+                add_requires("libsdl2")
             end
             target("pdcurses")
                 set_kind("$(kind)")
@@ -35,10 +35,10 @@ package("pdcurses")
                 if is_config("port", "wincon") then
                     add_defines("PDC_WIDE", "PDC_FORCE_UTF8")
                 end
-                add_packages("libsdl")
+                add_packages("libsdl2")
         ]])
         local configs = {}
-        if package:config("shared") then 
+        if package:config("shared") then
             configs.kind = "shared"
         end
         configs.port = package:config("port")

+ 7 - 7
packages/p/pdcursesmod/xmake.lua

@@ -20,9 +20,9 @@ package("pdcursesmod")
 
     on_load(function (package)
         if package:config("port") == "sdl2" then
-            package:add("deps", "libsdl")
+            package:add("deps", "libsdl2")
             if package:config("utf8") then
-                package:add("deps", "libsdl_ttf")
+                package:add("deps", "libsdl2_ttf")
             end
         end
         if package:config("utf8") then
@@ -32,7 +32,7 @@ package("pdcursesmod")
             package:add("defines", "PDC_DLL_BUILD")
         end
     end)
-    
+
     on_install("linux", "macosx", "mingw", "windows", function (package)
         io.writefile("xmake.lua", [[
             add_rules("mode.debug", "mode.release")
@@ -40,9 +40,9 @@ package("pdcursesmod")
             option("utf8", {description = "Treat all narrow characters as UTF-8."})
                 add_defines("PDC_WIDE", "PDC_FORCE_UTF8")
             if is_config("port", "sdl2") then
-                add_requires("libsdl")
+                add_requires("libsdl2")
                 if has_config("utf8") then
-                    add_requires("libsdl_ttf")
+                    add_requires("libsdl2_ttf")
                 end
             end
             target("pdcursesmod")
@@ -53,13 +53,13 @@ package("pdcursesmod")
                 if is_kind("shared") then
                     add_defines("PDC_DLL_BUILD")
                 end
-                add_packages("libsdl", "libsdl_ttf")
+                add_packages("libsdl2", "libsdl2_ttf")
                 if is_plat("windows", "mingw") then
                     add_syslinks("user32", "advapi32", "winmm")
                 end
         ]])
         local configs = {}
-        if package:config("shared") then 
+        if package:config("shared") then
             configs.kind = "shared"
         end
         configs.port = package:config("port")