Add extsources to libsdl (#599)

* Add extsources to libsdl

* Update xmake.lua
pull/608/head
ImperatorS79 4 years ago committed by GitHub
parent 6acf7687f9
commit 67314da9ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      packages/l/libsdl/xmake.lua
  2. 4
      packages/l/libsdl_gfx/xmake.lua
  3. 4
      packages/l/libsdl_image/xmake.lua
  4. 4
      packages/l/libsdl_mixer/xmake.lua
  5. 4
      packages/l/libsdl_net/xmake.lua
  6. 4
      packages/l/libsdl_ttf/xmake.lua

@ -2,6 +2,15 @@ package("libsdl")
set_homepage("https://www.libsdl.org/")
set_description("Simple DirectMedia Layer")
if is_plat("mingw") and is_subhost("msys") then
add_extsources("pacman::SDL2")
elseif is_plat("linux") then
add_extsources("pacman::sdl2", "apt::libsdl2-dev")
elseif is_plat("macosx") then
add_extsources("brew::sdl2")
end
set_license("zlib")
if is_plat("windows", "mingw") then
@ -121,10 +130,13 @@ package("libsdl")
local cflags = {}
if package:is_plat("linux") then
for _, depname in ipairs({"libxext", "libx11", "xorgproto"}) do
local dep = package:dep(depname):fetch()
local dep = package:dep(depname)
if dep then
for _, includedir in ipairs(dep.includedirs or dep.sysincludedirs) do
table.join2(cflags, "-I" .. includedir)
local depfetch = dep:fetch()
if depfetch then
for _, includedir in ipairs(depfetch.includedirs or depfetch.sysincludedirs) do
table.join2(cflags, "-I" .. includedir)
end
end
end
end

@ -17,7 +17,9 @@ package("libsdl_gfx")
add_versions("1.0.4", "63e0e01addedc9df2f85b93a248f06e8a04affa014a835c2ea34bfe34e576262")
end
if is_plat("linux") then
if is_plat("mingw") and is_subhost("msys") then
add_extsources("pacman::SDL2_gfx")
elseif is_plat("linux") then
add_extsources("pacman::sdl2_gfx", "apt::libsdl2-gfx-dev")
elseif is_plat("macosx") then
add_extsources("brew::sdl2_gfx")

@ -11,7 +11,9 @@ package("libsdl_image")
add_versions("2.0.5", "eee0927d1e7819d57c623fe3e2b3c6761c77c474fe9bc425e8674d30ac049b1c")
end
if is_plat("linux") then
if is_plat("mingw") and is_subhost("msys") then
add_extsources("pacman::SDL2_image")
elseif is_plat("linux") then
add_extsources("pacman::sdl2_image", "apt::libsdl2-image-dev")
elseif is_plat("macosx") then
add_extsources("brew::sdl2_image")

@ -11,7 +11,9 @@ package("libsdl_mixer")
add_versions("2.0.4", "9affb8c7bf6fbffda0f6906bfb99c0ea50dca9b188ba9e15be90042dc03c5ded")
end
if is_plat("linux") then
if is_plat("mingw") and is_subhost("msys") then
add_extsources("pacman::SDL2_mixer")
elseif is_plat("linux") then
add_extsources("pacman::sdl2_mixer", "apt::libsdl2-mixer-dev")
elseif is_plat("macosx") then
add_extsources("brew::sdl2_mixer")

@ -11,7 +11,9 @@ package("libsdl_net")
add_versions("2.0.1", "52031ed9d08a5eb1eda40e9a0409248bf532dde5e8babff5780ef1925657d59f")
end
if is_plat("linux") then
if is_plat("mingw") and is_subhost("msys") then
add_extsources("pacman::SDL2_net")
elseif is_plat("linux") then
add_extsources("pacman::sdl2_net", "apt::libsdl2-net-dev")
elseif is_plat("macosx") then
add_extsources("brew::sdl2_net")

@ -11,7 +11,9 @@ package("libsdl_ttf")
add_versions("2.0.15", "cdb72b5b1c3b27795fa128af36f369fee5d3e38a96c350855da0b81880555dbc")
end
if is_plat("linux") then
if is_plat("mingw") and is_subhost("msys") then
add_extsources("pacman::SDL2_ttf")
elseif is_plat("linux") then
add_extsources("pacman::sdl2_ttf", "apt::libsdl2-ttf-dev")
elseif is_plat("macosx") then
add_extsources("brew::sdl2_ttf")

Loading…
Cancel
Save