add package c-ares as well as some fixes (#124)

* add some versions for openssl

* switch sfml to build from source on windows

* fix tbb install issue

* add package c-ares

* try fix sfml on 32-bit mingw

* simplify openssl versions

* remove os.cp and addenv on windows
pull/126/head
Hoildkv 4 years ago committed by GitHub
parent 0ae67ebdbd
commit 99c88af3bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 46
      packages/c/c-ares/xmake.lua
  2. 12
      packages/o/openssl/xmake.lua
  3. 67
      packages/s/sfml/xmake.lua
  4. 14
      packages/t/tbb/xmake.lua

@ -0,0 +1,46 @@
package("c-ares")
set_homepage("https://c-ares.haxx.se/")
set_description("A C library for asynchronous DNS requests")
add_urls("https://c-ares.haxx.se/download/c-ares-$(version).tar.gz")
add_versions("1.16.1", "d08312d0ecc3bd48eee0a4cc0d2137c9f194e0a28de2028928c0f6cae85f86ce")
on_install("windows", function (package)
local configs = {"-f", "Makefile.msvc"}
local cfg = (package:config("shared") and "dll" or "lib") .. "-" .. (package:config("debug") and "debug" or "release")
table.insert(configs, "CFG=" .. cfg)
if package:config("vs_runtime"):startswith("MT") then
table.insert(configs, "RTLIBCFG=static")
end
import("package.tools.nmake").install(package, configs)
os.cp("include", package:installdir())
os.cp("lib", package:installdir())
if package:config("shared") then
package:addenv("PATH", "lib")
else
package:add("defines", "CARES_STATICLIB")
end
end)
on_install("macosx", "linux", function (package)
local configs = {}
if package:config("shared") then
table.insert(configs, "--enable-shared=yes")
table.insert(configs, "--enable-static=no")
else
table.insert(configs, "--enable-shared=no")
table.insert(configs, "--enable-static=yes")
end
if package:config("debug") then
table.insert(configs, "--enable-debug")
else
table.insert(configs, "--disable-debug")
end
import("package.tools.autoconf").install(package, configs)
end)
on_test(function (package)
assert(package:has_cfuncs("ares_library_init", {includes = "ares.h"}))
end)

@ -5,13 +5,15 @@ package("openssl")
add_urls("https://www.openssl.org/source/openssl-$(version).tar.gz", {alias = "home", excludes = "*/fuzz/*"})
add_urls("https://github.com/openssl/openssl/archive/OpenSSL_$(version).zip",
{alias = "github", version = function (version) return version:gsub("%.", "_") end, excludes = "*/fuzz/*"})
{alias = "github", version = function (version) return version:gsub("%.", "_") end, excludes = "*/fuzz/*"})
add_versions("home:1.1.1", "2836875a0f89c03d0fdf483941512613a50cfb421d6fd94b9f41d7279d586a3d")
add_versions("home:1.0.2", "8c48baf3babe0d505d16cfc0cf272589c66d3624264098213db0fb00034728e9")
add_versions("home:1.1.1h", "5c9ca8774bd7b03e5784f26ae9e9e6d749c9da2438545077e6b3d755a06595d9")
add_versions("home:1.1.0l", "74a2f756c64fd7386a29184dc0344f4831192d61dc2481a93a4c5dd727f41148")
add_versions("home:1.0.2u", "ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16")
add_versions("home:1.0.0", "1bbf9afc5a6215121ac094147d0a84178294fe4c3d0a231731038fd3717ba7ca")
add_versions("github:1.1.1", "7da8c193d3828a0cb4d866dc75622b2aac392971c3d656f7817fb84355290343")
add_versions("github:1.0.2", "b61942861405c634f86ca2b8dd1a34687e24b5036598d0fa971fac02405fdb1a")
add_versions("github:1.1.1h", "0a976b769bdb26470971a184f5263d0c3256152d5671ed7287cf17acc4698afc")
add_versions("github:1.1.0l", "a305d4af4b442ad61ba3d7e82905d09bfbd80424e132e10df4899d064aa47ce2")
add_versions("github:1.0.2u", "493f8b34574d0cf8598adbdec33c84b8a06f0617787c3710d20827c01291c09c")
add_versions("github:1.0.0", "9b67e5ad1a4234c1170ada75b66321e914da4f3ebaeaef6b28400173aaa6b378")
add_links("ssl", "crypto")

@ -4,13 +4,9 @@ package("sfml")
set_description("Simple and Fast Multimedia Library")
if is_plat("windows") then
if is_arch("x64") then
set_urls("https://www.sfml-dev.org/files/SFML-$(version)-windows-vc15-64-bit.zip")
add_versions("2.5.1", "3e807f7e810d6357ede35acd97615f1fe67b17028ff3d3d946328afb6104ab86")
elseif is_arch("x86") then
set_urls("https://www.sfml-dev.org/files/SFML-$(version)-windows-vc15-32-bit.zip")
add_versions("2.5.1", "9c7bef70ef481884756c9b52851c73caea11eeacb5cc83d03a3c157aee9e395f")
end
set_urls("https://www.sfml-dev.org/files/SFML-$(version)-sources.zip")
add_urls("https://github.com/SFML/SFML/releases/download/$(version)/SFML-$(version)-sources.zip")
add_versions("2.5.1", "bf1e0643acb92369b24572b703473af60bac82caf5af61e77c063b779471bb7f")
elseif is_plat("linux") then
if is_arch("x64", "x86_64") then
set_urls("https://www.sfml-dev.org/files/SFML-$(version)-linux-gcc-64-bit.tar.gz")
@ -25,7 +21,7 @@ package("sfml")
if is_arch("x64", "x86_64") then
set_urls("https://www.sfml-dev.org/files/SFML-$(version)-windows-gcc-7.3.0-mingw-64-bit.zip")
add_versions("2.5.1", "671e786f1af934c488cb22c634251c8c8bd441c709b4ef7bc6bbe227b2a28560")
elseif is_arch("x86") then
elseif is_arch("x86", "i386") then
set_urls("https://www.sfml-dev.org/files/SFML-$(version)-windows-gcc-7.3.0-mingw-32-bit.zip")
add_versions("2.5.1", "92d864c9c9094dc9d91e0006d66784f25ac900a8ee23c3f79db626de46a1d9d8")
end
@ -38,11 +34,12 @@ package("sfml")
add_configs("main", {description = "Link to the sfml-main library", default = true, type = "boolean"})
on_load("windows", "linux", "macosx", "mingw", function (package)
if package:is_plat("windows") then
package:add("deps", "cmake")
end
if not package:config("shared") then
package:add("defines", "SFML_STATIC")
if package:is_plat("windows") then
package:add("cxflags", "/MD")
end
end
local e = ""
@ -61,42 +58,64 @@ package("sfml")
end
if package:config("graphics") then
package:add("links", a .. "graphics" .. e)
if package:is_plat("windows", "mingw") then
package:add("syslinks", "freetype")
if package:is_plat("mingw") then
package:add("links", a .. "graphics" .. e)
package:add("links", "freetype")
end
end
if package:config("window") or package:config("graphics") then
package:add("links", a .. "window" .. e)
if package:is_plat("mingw") then
package:add("links", a .. "window" .. e)
end
if package:is_plat("windows", "mingw") then
package:add("syslinks", "opengl32", "gdi32", "user32", "advapi32")
end
end
if package:config("audio") then
package:add("links", a .. "audio" .. e)
if package:is_plat("windows", "mingw") then
package:add("syslinks", "openal32", "flac", "vorbisenc", "vorbisfile", "vorbis", "ogg")
if package:is_plat("mingw") then
package:add("links", a .. "audio" .. e)
package:add("links", "openal32", "flac", "vorbisenc", "vorbisfile", "vorbis", "ogg")
end
end
if package:config("network") then
package:add("links", a .. "network" .. e)
if package:is_plat("mingw") then
package:add("links", a .. "network" .. e)
end
if package:is_plat("windows", "mingw") then
package:add("syslinks", "ws2_32")
end
end
package:add("links", a .. "system" .. e)
if package:is_plat("mingw") then
package:add("links", a .. "system" .. e)
package:add("links", main_module)
end
if package:is_plat("windows", "mingw") then
package:add("syslinks", "winmm")
if package:config("main") then
package:add("links", main_module)
end
end)
on_install("windows", function (package)
local configs = {"-DSFML_BUILD_DOC=OFF", "-DSFML_BUILD_EXAMPLES=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
if package:config("shared") then
table.insert(configs, "-DBUILD_SHARED_LIBS=ON")
else
table.insert(configs, "-DBUILD_SHARED_LIBS=OFF")
if package:config("vs_runtime"):startswith("MT") then
table.insert(configs, "-DSFML_USE_STATIC_STD_LIBS=ON")
end
end
table.insert(configs, "-DSFML_BUILD_AUDIO=" .. (package:config("audio") and "ON" or "OFF"))
table.insert(configs, "-DSFML_BUILD_GRAPHICS=" .. (package:config("graphics") and "ON" or "OFF"))
table.insert(configs, "-DSFML_BUILD_WINDOW=" .. (package:config("window") and "ON" or "OFF"))
table.insert(configs, "-DSFML_BUILD_NETWORK=" .. (package:config("network") and "ON" or "OFF"))
import("package.tools.cmake").install(package, configs)
end)
on_install("windows", "linux", "macosx", "mingw", function (package)
on_install("linux", "macosx", "mingw", function (package)
os.cp("lib", package:installdir())
os.cp("include", package:installdir())
if package:is_plat("windows", "mingw") then
if package:is_plat("mingw") then
os.cp("bin/*", package:installdir("lib"), {rootdir = "bin"})
end
end)

@ -41,12 +41,18 @@ package("tbb")
on_install("windows", function (package)
os.cp("tbb/include", package:installdir())
local prefix = ""
if package:is_arch("x64", "x86_64") then
os.cp("tbb/lib/intel64/vc14/**", package:installdir("lib"))
os.cp("tbb/bin/intel64/vc14/**", package:installdir("bin"))
prefix = "intel64/vc14"
else
os.cp("tbb/lib/ia32/vc14/**", package:installdir("lib"))
os.cp("tbb/bin/ia32/vc14/**", package:installdir("bin"))
prefix = "ia32/vc14"
end
if package:config("debug") then
os.cp("tbb/lib/" .. prefix .. "/*_debug.*", package:installdir("lib"))
os.cp("tbb/bin/" .. prefix .. "/*_debug.*", package:installdir("bin"))
else
os.cp("tbb/lib/" .. prefix .. "/**|*_debug.*", package:installdir("lib"))
os.cp("tbb/bin/" .. prefix .. "/**|*_debug.*", package:installdir("bin"))
end
package:addenv("PATH", "bin")
end)

Loading…
Cancel
Save