vcpkg icon indicating copy to clipboard operation
vcpkg copied to clipboard

[gdk-pixbuf] jpeg and tiff support windows

Open dg0yt opened this issue 1 year ago • 6 comments

Amends https://github.com/microsoft/vcpkg/pull/38033. Fixes #38360.

dg0yt avatar Apr 23 '24 18:04 dg0yt

FTR gazebo is already completely broken and has zero successful builds in vcpkg CI in the last 30 days. Before #38033 this was explicit in ci.baseline. With #38033, windows was hidden behind wrongly preventing gdk-pixbuf to build.

dg0yt avatar Apr 24 '24 09:04 dg0yt

hmm a) add gtk:x64-windows=pass (or gtkmm) in ci baseline b) don't know if removing supports here is correct. (Hmm after checking native_windows_loaders is false so this is ok. )

Neumann-A avatar Apr 25 '24 11:04 Neumann-A

#38033 should not have been merged...

a) add gtk:x64-windows=pass (or gtkmm) in ci baseline

Yes, like before #38033.

b) don't know if removing supports here is correct.

Removing, as before #38033.

dg0yt avatar Apr 25 '24 13:04 dg0yt

And the gtk fehler log is ... interesting.

dg0yt avatar Apr 25 '24 13:04 dg0yt

a) add gtk:x64-windows=pass (or gtkmm) in ci baseline

Yes, like before #38033.

Actually gtk:x64-windows-static-md=fail.

dg0yt avatar Apr 25 '24 14:04 dg0yt

libjpeg-turbo was added by #38033. I admit that I didn't check if it is required for jpeg support on windows. But it is the default deps of tiff.

The net change from before #38033 over #38272 and #38369 (this PR):

diff --git a/ports/gdk-pixbuf/portfile.cmake b/ports/gdk-pixbuf/portfile.cmake
index 4f95131b61..aaf43a1f02 100644
--- a/ports/gdk-pixbuf/portfile.cmake
+++ b/ports/gdk-pixbuf/portfile.cmake
@@ -19,6 +19,24 @@ else()
     list(APPEND OPTIONS -Dintrospection=disabled)
 endif()
 
+if("png" IN_LIST FEATURES)
+    list(APPEND OPTIONS -Dpng=enabled)
+else()
+    list(APPEND OPTIONS -Dpng=disabled)
+endif()
+
+if("tiff" IN_LIST FEATURES)
+    list(APPEND OPTIONS -Dtiff=enabled)
+else()
+    list(APPEND OPTIONS -Dtiff=disabled)
+endif()
+
+if("jpeg" IN_LIST FEATURES)
+    list(APPEND OPTIONS -Djpeg=enabled)
+else()
+    list(APPEND OPTIONS -Djpeg=disabled)
+endif()
+
 if(CMAKE_HOST_WIN32 AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
     set(GIR_TOOL_DIR ${CURRENT_INSTALLED_DIR})
 else()
@@ -34,9 +52,6 @@ vcpkg_configure_meson(
         -Dman=false                 # Whether to generate man pages (requires xlstproc)
         -Dgtk_doc=false             # Whether to generate the API reference (requires GTK-Doc)
         -Ddocs=false
-        -Dpng=enabled               # Enable PNG loader (requires libpng)
-        -Dtiff=enabled              # Enable TIFF loader (requires libtiff), disabled on Windows if "native_windows_loaders" is used
-        -Djpeg=enabled              # Enable JPEG loader (requires libjpeg), disabled on Windows if "native_windows_loaders" is used
         -Drelocatable=true          # Whether to enable application bundle relocation support
         -Dtests=false
         -Dinstalled_tests=false
@@ -74,4 +89,4 @@ vcpkg_copy_tools(TOOL_NAMES ${TOOL_NAMES} AUTO_CLEAN)
 
 file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
 
-file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
diff --git a/ports/gdk-pixbuf/vcpkg.json b/ports/gdk-pixbuf/vcpkg.json
index 88634b7ced..59bce94f6b 100644
--- a/ports/gdk-pixbuf/vcpkg.json
+++ b/ports/gdk-pixbuf/vcpkg.json
@@ -1,28 +1,34 @@
 {
   "name": "gdk-pixbuf",
   "version": "2.42.10",
-  "port-version": 3,
+  "port-version": 6,
   "description": "Image loading library.",
   "homepage": "https://gitlab.gnome.org/GNOME/gdk-pixbuf",
   "license": "LGPL-2.1-or-later",
   "supports": "!xbox",
   "dependencies": [
-    "gettext",
+    {
+      "name": "gettext",
+      "host": true,
+      "features": [
+        "tools"
+      ]
+    },
+    "gettext-libintl",
     "glib",
     {
       "name": "glib",
       "host": true
     },
-    "libpng",
-    {
-      "name": "tiff",
-      "default-features": false
-    },
     {
       "name": "vcpkg-tool-meson",
       "host": true
-    },
-    "zlib"
+    }
+  ],
+  "default-features": [
+    "jpeg",
+    "png",
+    "tiff"
   ],
   "features": {
     "introspection": {
@@ -30,6 +36,27 @@
       "dependencies": [
         "gobject-introspection"
       ]
+    },
+    "jpeg": {
+      "description": "Enable JPEG loader (requires libjpeg)",
+      "dependencies": [
+        "libjpeg-turbo"
+      ]
+    },
+    "png": {
+      "description": "Enable PNG loader (requires libpng)",
+      "dependencies": [
+        "libpng"
+      ]
+    },
+    "tiff": {
+      "description": "Enable TIFF loader (requires libtiff)",
+      "dependencies": [
+        {
+          "name": "tiff",
+          "default-features": false
+        }
+      ]
     }
   }
 }
diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt
index 5308a02d04..818fb22fc3 100644
--- a/scripts/ci.baseline.txt
+++ b/scripts/ci.baseline.txt
@@ -362,8 +362,8 @@ gamenetworkingsockets:x64-android=fail
 # gazebo is broken due it depend on old ports that already in the new versions.
 # There is an open PR that try to fix that.
 gazebo:x64-windows=fail
-gazebo:x64-linux=fail
 gazebo:x86-windows=fail
+gazebo:x64-linux=fail
 gdk-pixbuf:arm-neon-android=fail
 gdk-pixbuf:arm64-android=fail
 gdk-pixbuf:x64-android=fail

dg0yt avatar Apr 25 '24 14:04 dg0yt