Browse Source

Add ext sources for glib/libffi (#784)

Kelvin Zhang 3 years ago
parent
commit
bf625027f3
2 changed files with 6 additions and 1 deletions
  1. 3 1
      packages/g/glib/xmake.lua
  2. 3 0
      packages/l/libffi/xmake.lua

+ 3 - 1
packages/g/glib/xmake.lua

@@ -26,15 +26,17 @@ package("glib")
     if is_plat("macosx") then
     if is_plat("macosx") then
         add_syslinks("iconv")
         add_syslinks("iconv")
         add_frameworks("Foundation", "CoreFoundation")
         add_frameworks("Foundation", "CoreFoundation")
+        add_extsources("brew::glib")
     elseif is_plat("linux") then
     elseif is_plat("linux") then
         add_syslinks("pthread", "dl")
         add_syslinks("pthread", "dl")
+        add_extsources("apt::libglib2.0-dev")
     end
     end
 
 
     if on_fetch then
     if on_fetch then
         on_fetch("macosx", "linux", function (package, opt)
         on_fetch("macosx", "linux", function (package, opt)
             if opt.system and package.find_package then
             if opt.system and package.find_package then
                 local result
                 local result
-                for _, name in ipairs({"gobject-2.0", "glib-2.0"}) do
+                for _, name in ipairs({"gobject-2.0", "glib-2.0", "gio-2.0", "gmodule-2.0", "gthread-2.0"}) do
                     local pkginfo = package.find_package and package:find_package("pkgconfig::" .. name, opt)
                     local pkginfo = package.find_package and package:find_package("pkgconfig::" .. name, opt)
                     if pkginfo then
                     if pkginfo then
                         if not result then
                         if not result then

+ 3 - 0
packages/l/libffi/xmake.lua

@@ -11,8 +11,11 @@ package("libffi")
 
 
     if is_plat("linux") then
     if is_plat("linux") then
         add_extsources("apt::libffi-dev")
         add_extsources("apt::libffi-dev")
+    elseif is_plat("macosx") then
+        add_extsources("brew::libffi")
     end
     end
 
 
+
     on_load("macosx", "linux", "iphoneos", function (package)
     on_load("macosx", "linux", "iphoneos", function (package)
         if package:gitref() then
         if package:gitref() then
             package:add("deps", "autoconf", "automake", "libtool")
             package:add("deps", "autoconf", "automake", "libtool")