Browse Source

update gdk-pixbuf (#2877)

Hoildkv 1 year ago
parent
commit
7df93f9fee
1 changed files with 27 additions and 25 deletions
  1. 27 25
      packages/g/gdk-pixbuf/xmake.lua

+ 27 - 25
packages/g/gdk-pixbuf/xmake.lua

@@ -1,52 +1,54 @@
 package("gdk-pixbuf")
 package("gdk-pixbuf")
 
 
-    set_homepage("https://gitlab.gnome.org/GNOME/gdk-pixbuf")
+    set_homepage("https://docs.gtk.org/gdk-pixbuf/")
     set_description("GdkPixbuf is a library that loads image data in various formats and stores it as linear buffers in memory. The buffers can then be scaled, composited, modified, saved, or rendered.")
     set_description("GdkPixbuf is a library that loads image data in various formats and stores it as linear buffers in memory. The buffers can then be scaled, composited, modified, saved, or rendered.")
-    set_license("LGPL-2.0")
+    set_license("LGPL-2.1")
 
 
-    add_urls("https://github.com/GNOME/gdk-pixbuf/archive/refs/tags/$(version).tar.gz",
-             "https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/archive/$(version)/gdk-pixbuf-$(version).tar.gz",
+    add_urls("https://download.gnome.org/sources/gdk-pixbuf/$(version).tar.xz", {alias = "home", version = function (version)
+        return format("%d.%d/gdk-pixbuf-%s", version:major(), version:minor(), version)
+    end})
+    add_urls("https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/archive/$(version)/gdk-pixbuf-$(version).tar.gz",
              "https://gitlab.gnome.org/GNOME/gdk-pixbuf.git")
              "https://gitlab.gnome.org/GNOME/gdk-pixbuf.git")
+    add_versions("home:2.42.10", "ee9b6c75d13ba096907a2e3c6b27b61bcd17f5c7ebeab5a5b439d2f2e39fe44b")
+    add_versions("home:2.42.6", "c4a6b75b7ed8f58ca48da830b9fa00ed96d668d3ab4b1f723dcf902f78bde77f")
+
+    add_patches("2.42.6", path.join(os.scriptdir(), "patches", "2.42.6", "macosx.patch"), "ad2705a5a9aa4b90fb4588bb567e95f5d82fccb6a5d463cd07462180e2e418eb")
 
 
-    add_versions("2.42.6", "c4f3a84a04bc7c5f4fbd97dce7976ab648c60628f72ad4c7b79edce2bbdb494d")
     add_includedirs("include", "include/gdk-pixbuf-2.0")
     add_includedirs("include", "include/gdk-pixbuf-2.0")
 
 
     add_deps("meson", "ninja")
     add_deps("meson", "ninja")
-    add_deps("libpng", "libjpeg")
-    if is_plat("macosx") then
+    add_deps("libpng", "libjpeg-turbo", "libtiff", "glib", "pcre2")
+    if is_plat("windows") then
+        add_syslinks("iphlpapi", "dnsapi")
+        add_deps("pkgconf", "libintl")
+    elseif is_plat("macosx") then
         add_frameworks("Foundation", "CoreFoundation", "AppKit")
         add_frameworks("Foundation", "CoreFoundation", "AppKit")
         add_extsources("brew::gdk-pixbuf")
         add_extsources("brew::gdk-pixbuf")
         add_syslinks("resolv")
         add_syslinks("resolv")
-        add_patches("2.42.6", path.join(os.scriptdir(), "patches", "2.42.6", "macosx.patch"), "ad2705a5a9aa4b90fb4588bb567e95f5d82fccb6a5d463cd07462180e2e418eb")
     elseif is_plat("linux") then
     elseif is_plat("linux") then
         add_extsources("pacman::gdk-pixbuf2")
         add_extsources("pacman::gdk-pixbuf2")
     end
     end
 
 
-    on_load(function (package)
-        if package:config("shared") then
-            -- fix gobject conflict error: assertion failed: (type == G_TYPE_CHAR)
-            package:add("deps", "glib", {configs = {shared = true}})
-        else
-            package:add("deps", "glib")
-        end
-    end)
+    on_install("windows", "macosx", "linux", function (package)
+        io.gsub("meson.build", "subdir%('tests'%)", "")
+        io.gsub("meson.build", "subdir%('fuzzing'%)", "")
+        io.gsub("meson.build", "subdir%('docs'%)", "")
 
 
-    on_install("macosx", "linux", function (package)
         local configs = {"-Dman=false",
         local configs = {"-Dman=false",
+                         "-Ddocs=false",
                          "-Dgtk_doc=false",
                          "-Dgtk_doc=false",
-                         "-Dpng=true",
-                         "-Dtiff=true",
+                         "-Dpng=enabled",
+                         "-Dtiff=enabled",
+                         "-Djpeg=enabled",
                          "-Dnative_windows_loaders=false",
                          "-Dnative_windows_loaders=false",
+                         "-Dbuiltin_loaders=all",
                          "-Dgio_sniffing=false",
                          "-Dgio_sniffing=false",
                          "-Drelocatable=true",
                          "-Drelocatable=true",
-                         "-Djpeg=true",
+                         "-Dintrospection=disabled",
+                         "-Dtests=false",
                          "-Dinstalled_tests=false"}
                          "-Dinstalled_tests=false"}
-        table.insert(configs, "-Ddebug=" .. (package:debug() and "true" or "false"))
         table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static"))
         table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static"))
-        io.gsub("meson.build", "subdir%('tests'%)", "")
-        io.gsub("meson.build", "subdir%('fuzzing'%)", "")
-        io.gsub("meson.build", "subdir%('docs'%)", "")
-        import("package.tools.meson").install(package, configs, {packagedeps = {"libpng", "libjpeg", "glib"}})
+        import("package.tools.meson").install(package, configs, {packagedeps = {"libjpeg-turbo", "libpng", "libtiff", "glib", "pcre2", "libintl"}})
     end)
     end)
 
 
     on_test(function (package)
     on_test(function (package)