make glib optional for cairo (#3022)

* make glib optional for cairo

* not asserting libiconv on linux clang
pull/3026/head
Hoildkv 11 months ago committed by GitHub
parent 90a56cf5ae
commit a2ecf6453a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      packages/c/cairo/xmake.lua
  2. 4
      packages/g/gtk4/xmake.lua
  3. 2
      packages/l/libiconv/xmake.lua
  4. 4
      packages/p/pango/xmake.lua

@ -15,9 +15,10 @@ package("cairo")
add_configs("freetype", {description = "Enable freetype support.", default = true, type = "boolean"})
add_configs("fontconfig", {description = "Enable fontconfig support.", default = true, type = "boolean"})
add_configs("xlib", {description = "Enable x11 surface backend.", default = is_plat("linux"), type = "boolean"})
add_configs("glib", {description = "Enable glib dependency.", default = false, type = "boolean"})
add_deps("meson", "ninja")
add_deps("libpng", "pixman", "zlib", "glib")
add_deps("libpng", "pixman", "zlib")
if is_plat("windows") then
add_deps("pkgconf", "libintl")
elseif is_plat("macosx") then
@ -51,6 +52,9 @@ package("cairo")
if package:config("xlib") then
package:add("deps", "libx11", "libxrender", "libxext")
end
if package:config("glib") then
package:add("deps", "glib")
end
end)
on_install("windows|x64", "windows|x86", "macosx", "linux", function (package)
@ -63,12 +67,12 @@ package("cairo")
"-Dgtk2-utils=disabled",
"-Dpng=enabled",
"-Dzlib=enabled",
"-Dglib=enabled"
}
table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static"))
table.insert(configs, "-Dfreetype=" .. (package:config("freetype") and "enabled" or "disabled"))
table.insert(configs, "-Dfontconfig=" .. (package:config("fontconfig") and "enabled" or "disabled"))
table.insert(configs, "-Dxlib=" .. (package:config("xlib") and "enabled" or "disabled"))
table.insert(configs, "-Dglib=" .. (package:config("glib") and "enabled" or "disabled"))
io.replace("meson.build", "subdir('fuzzing')", "", {plain = true})
io.replace("meson.build", "subdir('docs')", "", {plain = true})
io.replace("meson.build", "'CoreFoundation'", "'CoreFoundation', 'Foundation'", {plain = true})

@ -24,8 +24,8 @@ package("gtk4")
end
add_deps("meson", "ninja")
add_deps("glib", "pango", "cairo", "gdk-pixbuf", "libepoxy", "graphene", "fribidi", "pcre2")
add_deps("harfbuzz", {configs = {glib = true}})
add_deps("glib", "pango", "gdk-pixbuf", "libepoxy", "graphene", "fribidi", "pcre2")
add_deps("harfbuzz", "cairo", {configs = {glib = true}})
if is_plat("linux") then
add_deps("libdrm")
add_deps("libiconv")

@ -21,7 +21,7 @@ package("libiconv")
on_fetch("macosx", "linux", function (package, opt)
if opt.system then
if package:is_plat("linux") then
if package:is_plat("linux") and package:has_tool("cc", "gcc", "gxx") then
return {} -- on linux libiconv is already a part of glibc
else
return package:find_package("system::iconv", {includes = "iconv.h"})

@ -10,8 +10,8 @@ package("pango")
add_versions("1.50.3", "4a8b0cf33d5f9ecaa9cd99dd72703d5c4c53bc58df64dd9538493bb4356ab691")
add_deps("meson", "ninja")
add_deps("fontconfig", "freetype", "fribidi", "cairo", "glib", "pcre2")
add_deps("harfbuzz", {configs = {glib = true}})
add_deps("fontconfig", "freetype", "fribidi", "glib", "pcre2")
add_deps("harfbuzz", "cairo", {configs = {glib = true}})
if is_plat("windows") then
add_deps("libintl")
elseif is_plat("macosx") then

Loading…
Cancel
Save