improve libdir for meson (#430)

pull/433/head
ruki 4 years ago committed by GitHub
parent 512f77230b
commit c8ba13efdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      packages/b/bison/xmake.lua
  2. 2
      packages/f/fmt/xmake.lua
  3. 6
      packages/g/glib/xmake.lua
  4. 9
      packages/l/libmpdclient/xmake.lua
  5. 9
      packages/l/libxkbcommon/xmake.lua
  6. 6
      packages/w/wayland/xmake.lua

@ -1,5 +1,6 @@
package("bison")
set_kind("binary")
set_homepage("https://www.gnu.org/software/bison/")
set_description("A general-purpose parser generator.")
set_license("GPL-3.0")
@ -7,7 +8,10 @@ package("bison")
add_urls("http://ftp.gnu.org/gnu/bison/bison-$(version).tar.gz")
add_versions("3.7.4", "fbabc7359ccd8b4b36d47bfe37ebbce44805c052526d5558b95eda125d1677e2")
set_kind("binary")
if is_plat("linux") then
add_deps("m4")
end
on_install("macosx", "linux", function (package)
import("package.tools.autoconf").install(package)
os.rm(package:installdir("share", "doc"))

@ -11,6 +11,8 @@ package("fmt")
add_configs("header_only", {description = "Use header only version.", default = false, type = "boolean"})
add_extsources("brew::fmt")
on_load(function (package)
if package:config("header_only") then
package:add("defines", "FMT_HEADER_ONLY=1")

@ -30,13 +30,11 @@ package("glib")
"-Ddefault_library=static",
"-Dlibmount=false",
"-Dinstalled_tests=false"}
if is_plat("macosx") then
if package:is_plat("macosx") then
table.insert(configs, "-Diconv=native")
end
table.insert(configs, "-Dgio_module_dir=" .. path.join(package:installdir(), "lib/gio/modules"))
if is_plat("linux") then
table.insert(configs, "--libdir=" .. package:installdir("lib"))
end
table.insert(configs, "--libdir=lib")
io.gsub("meson.build", "subdir%('tests'%)", "")
io.gsub("meson.build", "subdir%('fuzzing'%)", "")
io.gsub("gio/meson.build", "subdir%('tests'%)", "")

@ -7,19 +7,12 @@ package("libmpdclient")
on_install("linux", function (package)
local configs = {}
table.insert(configs, "--libdir=lib")
table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static"))
import("package.tools.meson").install(package, configs)
os.cp("include", package:installdir())
os.cp("build_*/version.h", package:installdir() .. "/include/mpd")
os.rm(package:installdir() .. "/include/mpd/version.h.in")
if package:is_plat("linux") and package:is_arch("x86_64") then
if os.isdir(path.join(package:installdir(), "lib", "x86_64-linux-gnu")) then
package:add("linkdirs", "lib/x86_64-linux-gnu")
elseif os.isdir(path.join(package:installdir(), "lib64")) then
package:add("linkdirs", "lib64")
end
package:add("links", "mpdclient")
end
end)
on_test(function (package)

@ -20,15 +20,8 @@ package("libxkbcommon")
add_deps("meson")
on_install("linux", function (package)
package:addenv("PATH", "bin")
-- add links
local arch = package:is_arch("x86_64", "x64") and "x86_64" or "x86"
package:add("linkdirs", path.join("lib", arch .. "-linux-gnu"))
package:add("links", "xkbregistry", "xkbcommon")
os.mv(package:installdir("lib", arch .. "-linux-gnu", "pkgconfig"), package:installdir("lib"))
-- build
local configs = {"-Denable-docs=false", "-Dc_link_args=-lm"}
table.insert(configs, "--libdir=lib")
if package:config("x11") then
table.join2(configs, {"-Denable-wayland=false", "-Dxkb-config-root=/usr/share/X11/xkb", "-Dx-locale-root=/usr/share/X11/locale"})
else

@ -9,7 +9,7 @@ package("wayland")
add_resources("1.x", "protocols", "https://wayland.freedesktop.org/releases/wayland-protocols-1.20.tar.xz", "9782b7a1a863d82d7c92478497d13c758f52e7da4f197aa16443f73de77e4de7")
add_deps("meson", "libxml2", "libffi", "expat")
add_deps("meson", "libxml2", "libffi", "expat", "bison")
on_install("linux", function (package)
-- imports
@ -27,6 +27,7 @@ package("wayland")
-- build wayland
local configs = {"-Ddocumentation=false", "-Dc_link_args=-lm"}
table.insert(configs, "--libdir=lib")
local envs = meson.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))
@ -35,10 +36,7 @@ package("wayland")
meson.install(package, configs, {envs = envs})
-- add links
local arch = package:is_arch("x86_64", "x64") and "x86_64" or "x86"
package:add("linkdirs", path.join("lib", arch .. "-linux-gnu"))
package:add("links", "wayland-client", "wayland-server", "wayland-cursor", "wayland-egl")
os.mv(package:installdir("lib", arch .. "-linux-gnu", "pkgconfig"), package:installdir("lib"))
-- install wayland-protocols
local protocol = assert(package:resourcedir("protocols"), "wayland-protocols not found!")

Loading…
Cancel
Save