Skip to content

Commit

Permalink
Replace all existing libsdl deps to libsdl2
Browse files Browse the repository at this point in the history
  • Loading branch information
SirLynix committed Feb 6, 2025
1 parent 62d9241 commit bf8b77a
Show file tree
Hide file tree
Showing 17 changed files with 51 additions and 51 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
8 changes: 4 additions & 4 deletions packages/c/centurion/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ 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")
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
2 changes: 1 addition & 1 deletion 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 Down
2 changes: 1 addition & 1 deletion packages/f/fluidsynth/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ package("fluidsynth")
libsndfile = "libsndfile",
openmp = "openmp",
readline = "readline",
sdl2 = "libsdl"
sdl2 = "libsdl2"
}
for config, info in pairs(configdeps) do
if package:config(config) then
Expand Down
8 changes: 4 additions & 4 deletions packages/i/imgui/port/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ if has_config("glad") then
end

if has_config("sdl2_renderer") then
add_requires("libsdl >=2.0.17")
add_requires("libsdl2 >=2.0.17")
elseif has_config("sdl2") then
add_requires("libsdl")
add_requires("libsdl2")
end

if has_config("vulkan") then
Expand Down Expand Up @@ -105,7 +105,7 @@ target("imgui")
add_files("backends/imgui_impl_sdl.cpp")
add_headerfiles("(backends/imgui_impl_sdl.h)")
end
add_packages("libsdl")
add_packages("libsdl2")
end

if has_config("sdl2_renderer") then
Expand All @@ -116,7 +116,7 @@ target("imgui")
add_files("backends/imgui_impl_sdlrenderer.cpp")
add_headerfiles("(backends/imgui_impl_sdlrenderer.h)")
end
add_packages("libsdl")
add_packages("libsdl2")
end

if has_config("vulkan") then
Expand Down
4 changes: 2 additions & 2 deletions packages/i/imgui/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ package("imgui")
end
end
if package:config("sdl2_no_renderer") then
package:add("deps", "libsdl")
package:add("deps", "libsdl2")
end
if package:config("sdl2_renderer") then
package:add("deps", "libsdl >=2.0.17")
package:add("deps", "libsdl2 >=2.0.17")
end
if package:config("vulkan") then
package:add("deps", "vulkansdk")
Expand Down
2 changes: 1 addition & 1 deletion packages/j/johnnyengine/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ 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)
import("package.tools.xmake").install(package, {kind = (package:config("shared") and "shared" or "static")})
Expand Down
8 changes: 4 additions & 4 deletions packages/l/libsdl2_gfx/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@ package("libsdl2_gfx")
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") }})
end)

on_install("windows|x86", "windows|x64", "macosx", "linux", function(package)
io.writefile("xmake.lua", [[
add_rules("mode.debug", "mode.release")
if is_kind("shared") then
add_requires("libsdl", {configs = {shared = true}})
add_requires("libsdl2", {configs = {shared = true}})
else
add_requires("libsdl")
add_requires("libsdl2")
end
target("SDL2_gfx")
set_kind("$(kind)")
add_files("*.c")
add_headerfiles("*.h", {prefixdir = "SDL2"})
add_packages("libsdl")
add_packages("libsdl2")
add_rules("utils.install.pkgconfig_importfiles")
if is_plat("windows") and is_kind("shared") then
add_defines("DLL_EXPORT")
Expand Down
10 changes: 5 additions & 5 deletions packages/l/libsdl2_image/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ package("libsdl2_image")
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") }})
end)

on_install(function (package)
Expand All @@ -53,10 +53,10 @@ target_link_libraries(SDL2_image PRIVATE ${SDL2_LIBRARY})
local configs = {"-DSDL2IMAGE_SAMPLES=OFF", "-DSDL2IMAGE_TESTS=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"))
local libsdl = package:dep("libsdl")
if libsdl and not libsdl:is_system() then
table.insert(configs, "-DSDL2_DIR=" .. libsdl:installdir())
local fetchinfo = libsdl:fetch()
local libsdl2 = package:dep("libsdl2")
if libsdl2 and not libsdl2:is_system() then
table.insert(configs, "-DSDL2_DIR=" .. libsdl2:installdir())
local fetchinfo = libsdl2:fetch()
if fetchinfo then
for _, dir in ipairs(fetchinfo.includedirs or fetchinfo.sysincludedirs) do
if os.isfile(path.join(dir, "SDL_version.h")) then
Expand Down
10 changes: 5 additions & 5 deletions packages/l/libsdl2_mixer/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ package("libsdl2_mixer")
end

on_load(function (package)
package:add("deps", "libsdl", { configs = { shared = package:config("shared") }})
package:add("deps", "libsdl2", { configs = { shared = package:config("shared") }})
end)

on_install(function (package)
Expand Down Expand Up @@ -58,10 +58,10 @@ target_link_libraries(SDL2_mixer PRIVATE ${SDL2_LIBRARY})
}
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"))
local libsdl = package:dep("libsdl")
if libsdl and not libsdl:is_system() then
table.insert(configs, "-DSDL2_DIR=" .. libsdl:installdir())
local fetchinfo = libsdl:fetch()
local libsdl2 = package:dep("libsdl2")
if libsdl2 and not libsdl2:is_system() then
table.insert(configs, "-DSDL2_DIR=" .. libsdl2:installdir())
local fetchinfo = libsdl2:fetch()
if fetchinfo then
for _, dir in ipairs(fetchinfo.includedirs or fetchinfo.sysincludedirs) do
if os.isfile(path.join(dir, "SDL_version.h")) then
Expand Down
10 changes: 5 additions & 5 deletions packages/l/libsdl2_net/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ package("libsdl2_net")
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") }})
end)

on_install(function (package)
Expand All @@ -47,10 +47,10 @@ target_link_libraries(SDL2_net PRIVATE ${SDL2_LIBRARY})
local configs = {"-DSDL2NET_SAMPLES=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"))
local libsdl = package:dep("libsdl")
if libsdl and not libsdl:is_system() then
table.insert(configs, "-DSDL2_DIR=" .. libsdl:installdir())
local fetchinfo = libsdl:fetch()
local libsdl2 = package:dep("libsdl2")
if libsdl2 and not libsdl2:is_system() then
table.insert(configs, "-DSDL2_DIR=" .. libsdl2:installdir())
local fetchinfo = libsdl2:fetch()
if fetchinfo then
for _, dir in ipairs(fetchinfo.includedirs or fetchinfo.sysincludedirs) do
if os.isfile(path.join(dir, "SDL_version.h")) then
Expand Down
10 changes: 5 additions & 5 deletions packages/l/libsdl2_ttf/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ package("libsdl2_ttf")
end

on_load(function (package)
package:add("deps", "libsdl", { configs = { shared = package:config("shared") }})
package:add("deps", "libsdl2", { configs = { shared = package:config("shared") }})
end)

on_install(function (package)
Expand All @@ -50,10 +50,10 @@ target_link_libraries(SDL2_ttf PRIVATE ${SDL2_LIBRARY})
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, "-DSDL2TTF_VENDORED=OFF")
local libsdl = package:dep("libsdl")
if libsdl and not libsdl:is_system() then
table.insert(configs, "-DSDL2_DIR=" .. libsdl:installdir())
local fetchinfo = libsdl:fetch()
local libsdl2 = package:dep("libsdl2")
if libsdl2 and not libsdl2:is_system() then
table.insert(configs, "-DSDL2_DIR=" .. libsdl2:installdir())
local fetchinfo = libsdl2:fetch()
if fetchinfo then
for _, dir in ipairs(fetchinfo.includedirs or fetchinfo.sysincludedirs) do
if os.isfile(path.join(dir, "SDL_version.h")) then
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
2 changes: 1 addition & 1 deletion packages/o/openscenegraph/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package("openscenegraph")
dcmtk = "DCMTK",
ffmpeg = "FFmpeg",
glib = "GLIB",
libsdl = "SDL2",
libsdl2 = "SDL2",
nvtt = "NVTT"}
for config, dep in pairs(configdeps) do
add_configs(config, {description = "Enable the " .. config .. " plugin.", default = false, type = "boolean"})
Expand Down
6 changes: 3 additions & 3 deletions packages/p/pdcurses/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ 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
Expand All @@ -25,7 +25,7 @@ package("pdcurses")
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,7 +35,7 @@ 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
Expand Down
10 changes: 5 additions & 5 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 @@ -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")
Expand All @@ -53,7 +53,7 @@ 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
Expand Down

0 comments on commit bf8b77a

Please sign in to comment.