|
|
@ -2,14 +2,7 @@ package("libsdl_image") |
|
|
|
|
|
|
|
|
|
|
|
set_homepage("http://www.libsdl.org/projects/SDL_image/") |
|
|
|
set_homepage("http://www.libsdl.org/projects/SDL_image/") |
|
|
|
set_description("Simple DirectMedia Layer image loading library") |
|
|
|
set_description("Simple DirectMedia Layer image loading library") |
|
|
|
|
|
|
|
set_license("zlib") |
|
|
|
if is_plat("windows", "mingw") then |
|
|
|
|
|
|
|
set_urls("https://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-$(version)-VC.zip") |
|
|
|
|
|
|
|
add_versions("2.0.5", "a180f9b75c4d3fbafe02af42c42463cc7bc488e763cfd1ec2ffb75678b4387ac") |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
set_urls("https://www.libsdl.org/projects/SDL_image/release/SDL2_image-$(version).zip") |
|
|
|
|
|
|
|
add_versions("2.0.5", "eee0927d1e7819d57c623fe3e2b3c6761c77c474fe9bc425e8674d30ac049b1c") |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if is_plat("mingw") and is_subhost("msys") then |
|
|
|
if is_plat("mingw") and is_subhost("msys") then |
|
|
|
add_extsources("pacman::SDL2_image") |
|
|
|
add_extsources("pacman::SDL2_image") |
|
|
@ -19,18 +12,39 @@ package("libsdl_image") |
|
|
|
add_extsources("brew::sdl2_image") |
|
|
|
add_extsources("brew::sdl2_image") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if is_plat("windows", "mingw") then |
|
|
|
|
|
|
|
set_urls("https://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-$(version)-VC.zip") |
|
|
|
|
|
|
|
add_urls("https://github.com/libsdl-org/SDL_image/releases/download/release-$(version)/SDL2_image-devel-$(version)-VC.zip") |
|
|
|
|
|
|
|
add_versions("2.0.5", "a180f9b75c4d3fbafe02af42c42463cc7bc488e763cfd1ec2ffb75678b4387ac") |
|
|
|
|
|
|
|
add_versions("2.6.0", "e8953ec28e689fdef7805d0dc6913b8038dc6e250fe340929e459f367e2e75fa") |
|
|
|
|
|
|
|
add_versions("2.6.1", "b431347d039081b3ec065670d3037f106c8683f11491c45776cde7e69965a5f3") |
|
|
|
|
|
|
|
add_versions("2.6.2", "f510a58b03ce2b74a68d4e6733c47c1931813ab1736e533ad576f4cecb3a8a4d") |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
set_urls("https://www.libsdl.org/projects/SDL_image/release/SDL2_image-$(version).zip") |
|
|
|
|
|
|
|
add_urls("https://github.com/libsdl-org/SDL_image/releases/download/release-$(version)/SDL2_image-$(version).zip") |
|
|
|
|
|
|
|
add_versions("2.0.5", "eee0927d1e7819d57c623fe3e2b3c6761c77c474fe9bc425e8674d30ac049b1c") |
|
|
|
|
|
|
|
add_versions("2.6.0", "2252cdfd5be73cefaf727edc39c2ef3b7682e797acbd3126df117e925d46aaf6") |
|
|
|
|
|
|
|
add_versions("2.6.1", "cbfea63a46715c63a1db9e41617e550749a95ffd33ef9bd5ba6e58b2bdca6ed3") |
|
|
|
|
|
|
|
add_versions("2.6.2", "efe3c229853d0d40c35e5a34c3f532d5d9728f0abc623bc62c962bcef8754205") |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
if is_plat("macosx") then |
|
|
|
if is_plat("macosx") then |
|
|
|
add_frameworks("CoreFoundation", "CoreGraphics", "ImageIO", "CoreServices") |
|
|
|
add_frameworks("CoreFoundation", "CoreGraphics", "ImageIO", "CoreServices") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
if is_plat("macosx", "linux") then |
|
|
|
|
|
|
|
add_deps("automake", "autoconf") |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
add_deps("libsdl") |
|
|
|
add_deps("libsdl") |
|
|
|
|
|
|
|
|
|
|
|
add_links("SDL2_image") |
|
|
|
add_links("SDL2_image") |
|
|
|
add_includedirs("include", "include/SDL2") |
|
|
|
add_includedirs("include", "include/SDL2") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
on_load("macosx", "linux", function (package) |
|
|
|
|
|
|
|
if package:version():ge("2.6") then |
|
|
|
|
|
|
|
package:add("deps", "cmake") |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
package:add("deps", "automake", "autoconf") |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end) |
|
|
|
|
|
|
|
|
|
|
|
on_install("windows", "mingw", function (package) |
|
|
|
on_install("windows", "mingw", function (package) |
|
|
|
local arch = package:arch() |
|
|
|
local arch = package:arch() |
|
|
|
if package:is_plat("mingw") then |
|
|
|
if package:is_plat("mingw") then |
|
|
@ -42,22 +56,27 @@ package("libsdl_image") |
|
|
|
end) |
|
|
|
end) |
|
|
|
|
|
|
|
|
|
|
|
on_install("macosx", "linux", function (package) |
|
|
|
on_install("macosx", "linux", function (package) |
|
|
|
local configs = {} |
|
|
|
if package:version():ge("2.6") then |
|
|
|
if package:config("shared") then |
|
|
|
local configs = {"-DSDL_TEST=OFF"} |
|
|
|
table.insert(configs, "--enable-shared=yes") |
|
|
|
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) |
|
|
|
else |
|
|
|
table.insert(configs, "-DSDL_STATIC=" .. (package:config("shared") and "OFF" or "ON")) |
|
|
|
table.insert(configs, "--enable-shared=no") |
|
|
|
table.insert(configs, "-DSDL_SHARED=" .. (package:config("shared") and "ON" or "OFF")) |
|
|
|
end |
|
|
|
if libsdl and not libsdl:is_system() then |
|
|
|
if package:is_plat("linux") and package:config("pic") ~= false then |
|
|
|
table.insert(configs, "-DSDL2_DIR=" .. libsdl:installdir()) |
|
|
|
table.insert(configs, "--with-pic") |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
import("package.tools.cmake").install(package, configs) |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
local configs = {} |
|
|
|
|
|
|
|
table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) |
|
|
|
|
|
|
|
table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes")) |
|
|
|
local libsdl = package:dep("libsdl") |
|
|
|
local libsdl = package:dep("libsdl") |
|
|
|
if libsdl and not libsdl:is_system() then |
|
|
|
if libsdl and not libsdl:is_system() then |
|
|
|
table.insert(configs, "--with-sdl-prefix=" .. libsdl:installdir()) |
|
|
|
table.insert(configs, "--with-sdl-prefix=" .. libsdl:installdir()) |
|
|
|
end |
|
|
|
end |
|
|
|
io.replace("Makefile.am", "noinst_PROGRAMS = showimage", "") |
|
|
|
io.replace("Makefile.am", "noinst_PROGRAMS = showimage.-\n", "\n") |
|
|
|
os.rm("./configure") |
|
|
|
os.rm("./configure") |
|
|
|
import("package.tools.autoconf").install(package, configs) |
|
|
|
import("package.tools.autoconf").install(package, configs) |
|
|
|
|
|
|
|
end |
|
|
|
end) |
|
|
|
end) |
|
|
|
|
|
|
|
|
|
|
|
on_test(function (package) |
|
|
|
on_test(function (package) |
|
|
|