<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>248727</bug_id>
          
          <creation_ts>2022-12-03 17:30:04 -0800</creation_ts>
          <short_desc>gdesktopappinfo.h not excluded on macOS</short_desc>
          <delta_ts>2022-12-22 14:29:24 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>Other</version>
          <rep_platform>Mac (Apple Silicon)</rep_platform>
          <op_sys>macOS 13</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>echassiers.09-regards</reporter>
          <assigned_to name="Michael Catanzaro">mcatanzaro</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1916529</commentid>
    <comment_count>0</comment_count>
    <who name="">echassiers.09-regards</who>
    <bug_when>2022-12-03 17:30:04 -0800</bug_when>
    <thetext>After dropping libnotify in 2.38.0, we now have

#include &lt;gio/gdesktopappinfo.h&gt;

in Source/WebKit/UIProcess/Notifications/glib/NotificationService.cpp.

This prevents WebKitGTK from being built on macOS, where gdesktopappinfo.h is not available.

A quick fix would be to simply wrap the affected parts with #ifndef __APPLE__.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1916725</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-12-05 10:29:11 -0800</bug_when>
    <thetext>Please test this:

diff --git a/Source/WebKit/UIProcess/Notifications/glib/NotificationService.cpp b/Source/WebKit/UIProcess/Notifications/glib/NotificationService.cpp
index 61e4c5e50cb8..0b34a2041193 100644
--- a/Source/WebKit/UIProcess/Notifications/glib/NotificationService.cpp
+++ b/Source/WebKit/UIProcess/Notifications/glib/NotificationService.cpp
@@ -31,7 +31,6 @@
 #include &lt;WebCore/NotificationResources.h&gt;
 #include &lt;WebCore/RefPtrCairo.h&gt;
 #include &lt;cairo.h&gt;
-#include &lt;gio/gdesktopappinfo.h&gt;
 #include &lt;gio/gio.h&gt;
 #include &lt;glib/gi18n-lib.h&gt;
 #include &lt;mutex&gt;
@@ -51,6 +50,10 @@
 #include &lt;WebCore/GtkVersioning.h&gt;
 #endif
 
+#if OS(UNIX)
+#include &lt;gio/gdesktopappinfo.h&gt;
+#endif
+
 namespace WebKit {
 
 static const Seconds s_dbusCallTimeout = 20_ms;
@@ -293,6 +296,7 @@ void NotificationService::processCapabilities(GVariant* variant)
 
 static const char* applicationIcon(const char* applicationID)
 {
+#if OS(UNIX)
     static std::optional&lt;CString&gt; appIcon;
     if (!appIcon) {
         appIcon = [applicationID]() -&gt; CString {
@@ -330,6 +334,9 @@ static const char* applicationIcon(const char* applicationID)
     }
 
     return appIcon-&gt;data();
+#else
+    return { };
+#endif
 }
 
 bool NotificationService::showNotification(const WebNotification&amp; notification, const RefPtr&lt;WebCore::NotificationResources&gt;&amp; resources)


If that works for you, I&apos;ll submit a merge request.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1916726</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-12-05 10:33:41 -0800</bug_when>
    <thetext>Actually wait, that contains an error. Sec...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1916730</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-12-05 11:06:25 -0800</bug_when>
    <thetext>OK, indeed this one particular header is special... unlike the rest of gio-unix-2.0, gdesktopappinfo really is specifically excluded from macOS. Odd.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1916731</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-12-05 11:08:57 -0800</bug_when>
    <thetext>So here&apos;s a second attempt. Try this. If it works, I&apos;ll create a pull request.

diff --git a/Source/WebKit/UIProcess/Notifications/glib/NotificationService.cpp b/Source/WebKit/UIProcess/Notifications/glib/NotificationService.cpp
index 61e4c5e50cb8..820c02e9afeb 100644
--- a/Source/WebKit/UIProcess/Notifications/glib/NotificationService.cpp
+++ b/Source/WebKit/UIProcess/Notifications/glib/NotificationService.cpp
@@ -31,7 +31,6 @@
 #include &lt;WebCore/NotificationResources.h&gt;
 #include &lt;WebCore/RefPtrCairo.h&gt;
 #include &lt;cairo.h&gt;
-#include &lt;gio/gdesktopappinfo.h&gt;
 #include &lt;gio/gio.h&gt;
 #include &lt;glib/gi18n-lib.h&gt;
 #include &lt;mutex&gt;
@@ -51,6 +50,10 @@
 #include &lt;WebCore/GtkVersioning.h&gt;
 #endif
 
+#if OS(UNIX) &amp;&amp; !OS(DARWIN)
+#include &lt;gio/gdesktopappinfo.h&gt;
+#endif
+
 namespace WebKit {
 
 static const Seconds s_dbusCallTimeout = 20_ms;
@@ -294,6 +297,7 @@ void NotificationService::processCapabilities(GVariant* variant)
 static const char* applicationIcon(const char* applicationID)
 {
     static std::optional&lt;CString&gt; appIcon;
+#if OS(UNIX) &amp;&amp; !OS(DARWIN)
     if (!appIcon) {
         appIcon = [applicationID]() -&gt; CString {
             if (!applicationID)
@@ -328,6 +332,7 @@ static const char* applicationIcon(const char* applicationID)
             return { };
         }();
     }
+#endif // OS(UNIX) &amp;&amp; !OS(DARWIN)
 
     return appIcon-&gt;data();
 }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1916756</commentid>
    <comment_count>5</comment_count>
    <who name="">echassiers.09-regards</who>
    <bug_when>2022-12-05 13:20:08 -0800</bug_when>
    <thetext>It works. Thanks!

There are still some errors preventing the build, but I guess that deserves a new issue?

[6035/6040] Generating WebKit2WebExtension-4.0.gir
In file included from /private/tmp/nix-build-webkitgtk-2.38.2+abi=4.0.drv-0/webkitgtk-2.38.2/g-ir-cpp-76gq265z.c:6:
In file included from /private/tmp/nix-build-webkitgtk-2.38.2+abi=4.0.drv-0/webkitgtk-2.38.2/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/webkitdom.h:24:
In file included from /private/tmp/nix-build-webkitgtk-2.38.2+abi=4.0.drv-0/webkitgtk-2.38.2/build/WebKit2Gtk/Headers/webkit2gtk-webextension/webkitdom/WebKitDOMAttr.h:28:
/private/tmp/nix-build-webkitgtk-2.38.2+abi=4.0.drv-0/webkitgtk-2.38.2/build/WebKit2Gtk/Headers/webkit2gtk-webextension/webkitdom/WebKitDOMNode.h:28:10: fatal error: &apos;jsc/jsc.h&apos; file not found
#include &lt;jsc/jsc.h&gt;

[6036/6040] Generating WebKit2-4.0.gir
In file included from /private/tmp/nix-build-webkitgtk-2.38.2+abi=4.0.drv-0/webkitgtk-2.38.2/g-ir-cpp-5z6p65h8.c:35:
/private/tmp/nix-build-webkitgtk-2.38.2+abi=4.0.drv-0/webkitgtk-2.38.2/Source/WebKit/UIProcess/API/gtk/WebKitJavascriptResult.h:27:10: fatal error: &apos;JavaScriptCore/JSBase.h&apos; file not found
#include &lt;JavaScriptCore/JSBase.h&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1916769</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-12-05 13:48:27 -0800</bug_when>
    <thetext>(In reply to echassiers.09-regards from comment #5)
&gt; There are still some errors preventing the build, but I guess that deserves
&gt; a new issue?

A separate bug would probably be better, but up to you. For the include directory issues, you&apos;ll need to provide a patch yourself unfortunately, since those errors really need to be fixed by the person encountering them. Good luck.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1916774</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-12-05 13:55:26 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/7162</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1921508</commentid>
    <comment_count>8</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2022-12-22 14:29:21 -0800</bug_when>
    <thetext>Committed 258260@main (1446ba237462): &lt;https://commits.webkit.org/258260@main&gt;

Reviewed commits have been landed. Closing PR #7162 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>