wayland: support bsd (#4333)

* wayland: support bsd

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* remove test code

---------

Co-authored-by: Jérôme Leclercq <lynix680@gmail.com>
pull/4345/head
M 8 months ago committed by GitHub
parent d3aced0ce1
commit 3bbfb16d12
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      packages/e/expat/xmake.lua
  2. 5
      packages/p/pkg-config/xmake.lua
  3. 35
      packages/w/wayland/xmake.lua

@ -1,5 +1,4 @@
package("expat")
set_homepage("https://libexpat.github.io")
set_description("XML 1.0 parser")
set_license("MIT")
@ -18,13 +17,14 @@ package("expat")
add_configs("char_type", {description = "Character type to use", default = "char", type = "string", values = {"char", "ushort", "wchar_t"}})
add_deps("cmake")
on_load("windows", function (package)
if not package:config("shared") then
package:add("defines", "XML_STATIC")
end
end)
on_install("windows", "linux", "macosx", "android", "mingw", "cross", function (package)
on_install("windows", "linux", "macosx", "android", "mingw", "cross", "bsd", function (package)
local configs = {"-DEXPAT_BUILD_EXAMPLES=OFF", "-DEXPAT_BUILD_TESTS=OFF", "-DEXPAT_BUILD_DOCS=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
table.insert(configs, "-DEXPAT_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))

@ -1,5 +1,4 @@
package("pkg-config")
set_kind("binary")
set_homepage("https://freedesktop.org/wiki/Software/pkg-config/")
set_description("A helper tool used when compiling applications and libraries.")
@ -19,7 +18,9 @@ package("pkg-config")
if is_host("macosx") then
table.insert(pcpath, "/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/" .. macos.version():major() .. '.' .. macos.version():minor())
end
import("package.tools.autoconf").install(package, {"--disable-debug", "--disable-host-tool", "--with-internal-glib", ["with-pc-path"] = table.concat(pcpath, ':')})
-- see https://gitlab.freedesktop.org/pkg-config/pkg-config/-/issues/81
local opt = {cflags = "-Wno-int-conversion"}
import("package.tools.autoconf").install(package, {"--disable-werror", "--disable-compile-warnings", "--disable-debug", "--disable-host-tool", "--with-internal-glib", ["with-pc-path"] = table.concat(pcpath, ':')}, opt)
end)
on_test(function (package)

@ -3,12 +3,14 @@ package("wayland")
set_description("Wayland is a protocol for a compositor to talk to its clients as well as a C library implementation of that protocol.")
set_license("MIT")
add_urls("https://wayland.freedesktop.org/releases/wayland-$(version).tar.xz")
add_urls("https://gitlab.freedesktop.org/wayland/wayland/-/releases/$(version)/downloads/wayland-$(version).tar.xz")
add_versions("1.18.0", "4675a79f091020817a98fd0484e7208c8762242266967f55a67776936c2e294d")
add_versions("1.19.0", "baccd902300d354581cd5ad3cc49daa4921d55fb416a5883e218750fef166d15")
add_versions("1.23.0", "05b3e1574d3e67626b5974f862f36b5b427c7ceeb965cb36a4e6c2d342e45ab2")
add_resources("1.18.0", "protocols", "https://wayland.freedesktop.org/releases/wayland-protocols-1.20.tar.xz", "9782b7a1a863d82d7c92478497d13c758f52e7da4f197aa16443f73de77e4de7")
add_resources("1.19.0", "protocols", "https://wayland.freedesktop.org/releases/wayland-protocols-1.21.tar.xz", "b99945842d8be18817c26ee77dafa157883af89268e15f4a5a1a1ff3ffa4cde5")
add_resources("1.23.0", "protocols", "https://gitlab.freedesktop.org/wayland/wayland-protocols/-/releases/1.36/downloads/wayland-protocols-1.36.tar.xz", "71fd4de05e79f9a1ca559fac30c1f8365fa10346422f9fe795f74d77b9ef7e92")
if is_plat("linux") then
add_extsources("apt::libwayland-dev", "pacman::wayland")
@ -16,10 +18,13 @@ package("wayland")
add_deps("meson", "ninja >=1.8.2", "libxml2", "libffi", "expat", "bison", "pkg-config")
on_install("linux", function (package)
if is_plat("bsd") then
add_deps("epoll-shim")
end
on_install("linux", "bsd", function (package)
-- imports
import("package.tools.meson")
import("package.tools.autoconf")
import("lib.detect.find_file")
-- set environment variables
@ -42,15 +47,23 @@ package("wayland")
-- install wayland-protocols
local protocol = assert(package:resourcedir("protocols"), "wayland-protocols not found!")
local configfile = find_file("configure.ac", path.join(protocol, "**"))
os.cd(path.directory(configfile))
local buildfile = find_file("meson.build", path.join(protocol, "**"))
if buildfile then
os.cd(path.directory(buildfile))
meson.install(package, {"-Dtests=false"}, {envs = envs})
else
import("package.tools.autoconf")
local configfile = assert(find_file("configure.ac", path.join(protocol, "**")))
os.cd(path.directory(configfile))
envs = autoconf.buildenvs(package)
envs.LD_LIBRARY_PATH = path.joinenv(table.join(LD_LIBRARY_PATH, envs.LD_LIBRARY_PATH))
envs.PKG_CONFIG_PATH = path.joinenv(table.join(PKG_CONFIG_PATH, envs.PKG_CONFIG_PATH))
envs.ACLOCAL_PATH = path.joinenv(table.join(ACLOCAL_PATH, envs.ACLOCAL_PATH))
envs.ACLOCAL = ACLOCAL
autoconf.install(package, {}, {envs = envs})
envs = autoconf.buildenvs(package)
envs.LD_LIBRARY_PATH = path.joinenv(table.join(LD_LIBRARY_PATH, envs.LD_LIBRARY_PATH))
envs.PKG_CONFIG_PATH = path.joinenv(table.join(PKG_CONFIG_PATH, envs.PKG_CONFIG_PATH))
envs.ACLOCAL_PATH = path.joinenv(table.join(ACLOCAL_PATH, envs.ACLOCAL_PATH))
envs.ACLOCAL = ACLOCAL
autoconf.install(package, {}, {envs = envs})
end
end)
on_test(function (package)

Loading…
Cancel
Save