Skip to content

Commit

Permalink
rename libsdl2 deps
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Feb 8, 2025
1 parent 5d5247a commit 8622df1
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions packages/b/blah/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -21,7 +21,7 @@ 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"))
Expand Down
10 changes: 5 additions & 5 deletions packages/c/centurion/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions packages/c/cimgui/port/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions packages/c/cimgui/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ package("cimgui")

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
Expand All @@ -49,7 +49,7 @@ package("cimgui")
end
end)

on_install("windows|x64", "windows|x86", "linux", "macosx", function (package)
on_install("windows|x64", "windows|x86", "linux|!arm64", "macosx|!arm64", function (package)
os.vrun("git -c core.fsmonitor=false submodule foreach --recursive git checkout " .. package:config("imgui"))

local envs = {}
Expand Down
4 changes: 2 additions & 2 deletions packages/j/johnnyengine/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ package("johnnyengine")
add_versions("1.0.1", "53c11b827bea6fe30f9bca27adbd712eec85a0853c0402407930bae78ad54a8f")
add_patches("1.0.1", path.join(os.scriptdir(), "patches", "1.0.1", "win32_shared_fix.patch"), "fbe22cb5a9f0485982c7755936d14de6da3ce80a42394d48946b14b922847611")

add_deps("glew", "libsdl", "libsdl_ttf", "libsdl_mixer", "libsdl_gfx", "box2d", "assimp", "stb", "tmxparser")
add_deps("glew", "libsdl2", "libsdl2_ttf", "libsdl2_mixer", "libsdl2_gfx", "box2d", "assimp", "stb", "tmxparser")

on_install("windows", "linux", "macosx", function (package)
on_install("windows|x86", "windows|x64", "linux", "macosx", function (package)
import("package.tools.xmake").install(package, {kind = (package:config("shared") and "shared" or "static")})
end)

Expand Down
2 changes: 1 addition & 1 deletion packages/m/magnum/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
10 changes: 5 additions & 5 deletions packages/p/pdcurses/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)")
Expand All @@ -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")
Expand Down
14 changes: 7 additions & 7 deletions packages/p/pdcursesmod/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,17 +32,17 @@ 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")
option("port", {description = "Set the target port."})
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")
Expand All @@ -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")
Expand Down

0 comments on commit 8622df1

Please sign in to comment.