From 471a7eeb46b6795dc1d3f998946dd90b98cd35a4 Mon Sep 17 00:00:00 2001 From: Kelvin Zhang Date: Sat, 25 Dec 2021 00:02:50 -0500 Subject: [PATCH] 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. --- packages/l/libxml2/xmake.lua | 11 ++++++++++- packages/u/util-linux/xmake.lua | 6 +++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/l/libxml2/xmake.lua b/packages/l/libxml2/xmake.lua index 8521f9dac..67f84157a 100644 --- a/packages/l/libxml2/xmake.lua +++ b/packages/l/libxml2/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 diff --git a/packages/u/util-linux/xmake.lua b/packages/u/util-linux/xmake.lua index 5110a3143..43f14b71d 100644 --- a/packages/u/util-linux/xmake.lua +++ b/packages/u/util-linux/xmake.lua @@ -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"))