Add ext source for util-linux (#792)

* Add ext source for util-linux

* Make libxml2 work with system libiconv

Don't hard code installdir(). When using system libiconv, there isn't a
installdir.
pull/794/head
Kelvin Zhang 3 years ago committed by GitHub
parent b254ca3363
commit 471a7eeb46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      packages/l/libxml2/xmake.lua
  2. 6
      packages/u/util-linux/xmake.lua

@ -104,7 +104,16 @@ package("libxml2")
table.insert(configs, "--enable-static=yes")
end
if package:config("iconv") then
table.insert(configs, "--with-iconv=" .. package:dep("libiconv"):installdir())
local iconvdir
local iconv = package:dep("libiconv"):fetch()
if iconv then
iconvdir = table.wrap(iconv.sysincludedirs or iconv.includedirs)[1]
end
if iconvdir then
table.insert(configs, "--with-iconv=" .. path.directory(iconvdir))
else
table.insert(configs, "--with-iconv")
end
else
table.insert(configs, "--without-iconv")
end

@ -11,7 +11,9 @@ package("util-linux")
add_patches("2.36.2", path.join(os.scriptdir(), "patches", "2.36.2", "includes.patch"), "7274762cac2810b5f0d17ecb5ac69c7069e7ff2b880df663b7072628df0867f3")
if not is_plat("macosx") then
if is_plat("macosx") then
add_extsources("brew::util-linux")
else
add_deps("ncurses", "zlib")
end
@ -42,8 +44,6 @@ package("util-linux")
"--disable-silent-rules",
"--without-python",
"--without-systemd",
"--enable-static=yes",
"--enable-shared=no",
"--with-bashcompletiondir=" .. package:installdir("share/bash-completion")}
table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))

Loading…
Cancel
Save