Explorar o código

libsdl: Add support of x11 and wayland on FreeBSD (#4452)

* libsdl: Add support of x11 and wayland on FreeBSD

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* Try to add BSD support for x11

* Update xmake.lua

* Update xmake.lua
Jérôme Leclercq hai 1 ano
pai
achega
faff95e7f3

+ 1 - 3
packages/l/libpthread-stubs/xmake.lua

@@ -1,5 +1,4 @@
 package("libpthread-stubs")
-
     set_homepage("https://www.x.org/")
     set_description("X.Org: pthread-stubs.pc")
 
@@ -10,7 +9,7 @@ package("libpthread-stubs")
 
     add_deps("pkg-config")
 
-    on_install("macosx", "linux", function (package)
+    on_install("macosx", "linux", "bsd", function (package)
         import("package.tools.autoconf").install(package)
     end)
 
@@ -18,4 +17,3 @@ package("libpthread-stubs")
         local envs = {PKG_CONFIG_PATH = path.join(package:installdir(), "lib", "pkgconfig")}
         os.vrunv("pkg-config", {"--exists", "pthread-stubs"}, {envs = envs})
     end)
-

+ 6 - 6
packages/l/libsdl/xmake.lua

@@ -1,6 +1,7 @@
 package("libsdl")
     set_homepage("https://www.libsdl.org/")
     set_description("Simple DirectMedia Layer")
+    set_license("zlib")
 
     if is_plat("mingw") and is_subhost("msys") then
         add_extsources("pacman::SDL2")
@@ -10,11 +11,10 @@ package("libsdl")
         add_extsources("brew::sdl2")
     end
 
-    set_license("zlib")
-
     add_urls("https://www.libsdl.org/release/SDL2-$(version).zip",
              "https://github.com/libsdl-org/SDL/releases/download/release-$(version)/SDL2-$(version).zip", { alias = "archive" })
     add_urls("https://github.com/libsdl-org/SDL.git", { alias = "github" })
+
     add_versions("archive:2.0.8", "e6a7c71154c3001e318ba7ed4b98582de72ff970aca05abc9f45f7cbdc9088cb")
     add_versions("archive:2.0.12", "476e84d6fcbc499cd1f4a2d3fd05a924abc165b5d0e0d53522c9604fe5a021aa")
     add_versions("archive:2.0.14", "2c1e870d74e13dfdae870600bfcb6862a5eab4ea5b915144aff8d75a0f9bf046")
@@ -80,7 +80,7 @@ package("libsdl")
         add_configs("sdlmain", {description = "Use SDL_main entry point", default = true, type = "boolean"})
     end
 
-    if is_plat("linux") then
+    if is_plat("linux", "bsd") then
         add_configs("x11", {description = "Enables X11 support (requires it on the system)", default = true, type = "boolean"})
         add_configs("wayland", {description = "Enables Wayland support", default = true, type = "boolean"})
 
@@ -104,10 +104,10 @@ package("libsdl")
             package:add("defines", "SDL_MAIN_HANDLED")
         end
         package:add("components", "lib")
-        if package:is_plat("linux") and (package:config("x11") or package:config("with_x")) then
+        if package:is_plat("linux", "bsd") and (package:config("x11") or package:config("with_x")) then
             package:add("deps", "libxext", {private = true})
         end
-        if package:is_plat("linux") and package:config("wayland") then
+        if package:is_plat("linux", "bsd") and package:config("wayland") then
             package:add("deps", "wayland", {private = true})
         end
     end)
@@ -207,7 +207,7 @@ package("libsdl")
         table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
         table.insert(configs, "-DSDL_TEST=OFF")
         local opt
-        if package:is_plat("linux", "cross") then
+        if package:is_plat("linux", "bsd", "cross") then
             local includedirs = {}
             for _, depname in ipairs({"libxext", "libx11", "xorgproto"}) do
                 local dep = package:dep(depname)

+ 6 - 4
packages/l/libx11/xmake.lua

@@ -1,5 +1,4 @@
 package("libx11")
-
     set_homepage("https://www.x.org/")
     set_description("X.Org: Core X11 protocol client library")
 
@@ -11,15 +10,18 @@ package("libx11")
     add_versions("1.8.7", "793ebebf569f12c864b77401798d38814b51790fce206e01a431e5feb982e20b")
 
     if is_plat("linux") then
-        add_syslinks("dl")
         add_extsources("apt::libx11-dev", "pacman::libx11")
     elseif is_plat("macosx") then
         add_extsources("brew::libx11")
     end
 
+    if is_plat("linux", "bsd") then
+        add_syslinks("dl")
+    end
+
     add_configs("shared", {description = "Build shared library.", default = true, type = "boolean"})
 
-    if is_plat("macosx", "linux") then
+    if is_plat("macosx", "linux", "bsd") then
         add_deps("pkg-config", "util-macros", "xtrans", "libxcb", "xorgproto")
     end
     if is_plat("macosx") then
@@ -27,7 +29,7 @@ package("libx11")
         add_deps("gnu-sed")
     end
 
-    on_install("macosx", "linux", function (package)
+    on_install("macosx", "linux", "bsd", function (package)
         local configs = {"--sysconfdir=" .. package:installdir("etc"),
                          "--localstatedir=" .. package:installdir("var"),
                          "--disable-dependency-tracking",

+ 2 - 2
packages/l/libxau/xmake.lua

@@ -11,11 +11,11 @@ package("libxau")
         add_extsources("apt::libxau-dev", "pacman::libxau")
     end
 
-    if is_plat("macosx", "linux") then
+    if is_plat("macosx", "linux", "bsd") then
         add_deps("pkg-config", "util-macros", "xorgproto")
     end
 
-    on_install("macosx", "linux", function (package)
+    on_install("macosx", "linux", "bsd", function (package)
         local configs = {"--sysconfdir=" .. package:installdir("etc"),
                          "--localstatedir=" .. package:installdir("var"),
                          "--disable-dependency-tracking",

+ 2 - 2
packages/l/libxcb/xmake.lua

@@ -46,7 +46,7 @@ package("libxcb")
         add_extsources("apt::libxcb1-dev", "pacman::libxcb")
     end
 
-    if is_plat("macosx", "linux") then
+    if is_plat("macosx", "linux", "bsd") then
         add_deps("pkg-config", "python 3.x", {kind = "binary"})
         add_deps("xcb-proto", "libpthread-stubs", "libxau", "libxdmcp")
     end
@@ -59,7 +59,7 @@ package("libxcb")
         end
     end)
 
-    on_install("macosx", "linux", function (package)
+    on_install("macosx", "linux", "bsd", function (package)
         local configs = {"--sysconfdir=" .. package:installdir("etc"),
                          "--localstatedir=" .. package:installdir("var"),
                          "--disable-dependency-tracking",

+ 2 - 3
packages/l/libxdmcp/xmake.lua

@@ -1,5 +1,4 @@
 package("libxdmcp")
-
     set_homepage("https://www.x.org/")
     set_description("X.Org: X Display Manager Control Protocol library")
 
@@ -11,11 +10,11 @@ package("libxdmcp")
         add_extsources("apt::libxdmcp-dev", "pacman::libxmdcp")
     end
 
-    if is_plat("macosx", "linux") then
+    if is_plat("macosx", "linux", "bsd") then
         add_deps("pkg-config", "xorgproto")
     end
 
-    on_install("macosx", "linux", function (package)
+    on_install("macosx", "linux", "bsd", function (package)
         local configs = {"--sysconfdir=" .. package:installdir("etc"),
                          "--localstatedir=" .. package:installdir("var"),
                          "--disable-dependency-tracking",

+ 2 - 3
packages/l/libxext/xmake.lua

@@ -1,5 +1,4 @@
 package("libxext")
-
     set_homepage("https://www.x.org/")
     set_description("X.Org: Library for common extensions to the X11 protocol")
 
@@ -11,11 +10,11 @@ package("libxext")
         add_extsources("apt::libxext-dev")
     end
 
-    if is_plat("macosx", "linux") then
+    if is_plat("macosx", "linux", "bsd") then
         add_deps("pkg-config", "libx11", "xorgproto")
     end
 
-    on_install("macosx", "linux", function (package)
+    on_install("macosx", "linux", "bsd", function (package)
         local configs = {"--sysconfdir=" .. package:installdir("etc"),
                          "--localstatedir=" .. package:installdir("var"),
                          "--disable-dependency-tracking",

+ 1 - 2
packages/u/util-macros/xmake.lua

@@ -1,5 +1,4 @@
 package("util-macros")
-
     set_homepage("https://www.x.org/")
     set_description("X.Org: Set of autoconf macros used to build other xorg packages")
 
@@ -14,7 +13,7 @@ package("util-macros")
 
     add_deps("pkg-config")
 
-    on_install("macosx", "linux", function (package)
+    on_install("macosx", "linux", "bsd", function (package)
         local configs = {"--sysconfdir=" .. package:installdir("etc"),
                          "--localstatedir=" .. package:installdir("var")}
         import("package.tools.autoconf").install(package, configs)

+ 2 - 3
packages/x/xcb-proto/xmake.lua

@@ -1,5 +1,4 @@
 package("xcb-proto")
-
     set_homepage("https://www.x.org/")
     set_description("X.Org: XML-XCB protocol descriptions for libxcb code generation")
 
@@ -10,11 +9,11 @@ package("xcb-proto")
     add_versions("1.14.1", "85cd21e9d9fbc341d0dbf11eace98d55d7db89fda724b0e598855fcddf0944fd")
     add_versions("1.16.0", "d9c7f010b1105fc3858bf07b5169b2dd8e7493c6652b1fe45f3321d874f291d7")
 
-    if is_plat("macosx", "linux") then
+    if is_plat("macosx", "linux", "bsd") then
         add_deps("pkg-config", "python 3.x", {kind = "binary"})
     end
 
-    on_install("macosx", "linux", function (package)
+    on_install("macosx", "linux", "bsd", function (package)
         local configs = {"--sysconfdir=" .. package:installdir("etc"),
                          "--localstatedir=" .. package:installdir("var"),
                          "--disable-silent-rules",

+ 2 - 3
packages/x/xorgproto/xmake.lua

@@ -1,5 +1,4 @@
 package("xorgproto")
-
     set_kind("library", {headeronly = true})
     set_homepage("https://www.x.org/")
     set_description("X.Org: Protocol Headers")
@@ -13,11 +12,11 @@ package("xorgproto")
         add_extsources("apt::x11proto-dev", "pkgconfig::xproto")
     end
 
-    if is_plat("macosx", "linux") then
+    if is_plat("macosx", "linux", "bsd") then
         add_deps("pkg-config", "util-macros")
     end
 
-    on_install("macosx", "linux", function (package)
+    on_install("macosx", "linux", "bsd", function (package)
         local configs = {"--sysconfdir=" .. package:installdir("etc"),
                          "--localstatedir=" .. package:installdir("var"),
                          "--disable-dependency-tracking",

+ 2 - 3
packages/x/xtrans/xmake.lua

@@ -1,5 +1,4 @@
 package("xtrans")
-
     set_homepage("https://www.x.org/")
     set_description("X.Org: X Network Transport layer shared code")
 
@@ -11,11 +10,11 @@ package("xtrans")
         add_extsources("apt::xtrans-dev", "pacman::xtrans")
     end
 
-    if is_plat("macosx", "linux") then
+    if is_plat("macosx", "linux", "bsd") then
         add_deps("pkg-config", "util-macros", "xorgproto")
     end
 
-    on_install("macosx", "linux", function (package)
+    on_install("macosx", "linux", "bsd", function (package)
         local configs = {"--sysconfdir=" .. package:installdir("etc"),
                          "--localstatedir=" .. package:installdir("var"),
                          "--disable-dependency-tracking",