<?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>300382</bug_id>
          
          <creation_ts>2025-10-08 01:34:23 -0700</creation_ts>
          <short_desc>[WPE] Build regression after libsoup2 removal breaks third-party pkg-config discovery</short_desc>
          <delta_ts>2025-10-08 05:28:34 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WPE WebKit</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=300163</see_also>
          <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 name="Pablo Saavedra">psaavedra</reporter>
          <assigned_to name="Pablo Saavedra">psaavedra</assigned_to>
          <cc>bugs-noreply</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2149412</commentid>
    <comment_count>0</comment_count>
    <who name="Pablo Saavedra">psaavedra</who>
    <bug_when>2025-10-08 01:34:23 -0700</bug_when>
    <thetext>**Description:**
A recent commit that removed libsoup2 support has caused a build regression that prevents third-party applications from building against WPEWebKit using `pkg-config`.

Commit is:
```
Author: Adrian Perez de Castro &lt;aperez@igalia.com&gt;
Date:   Tue Oct 7 07:18:51 2025 -0700

[GTK] Remove support for building against libsoup2
https://bugs.webkit.org/show_bug.cgi?id=300163

Canonical link: https://commits.webkit.org/301131@main
```

This change removed the definition of the `SOUP_API_VERSION` variable from the CMake build system, as seen in this diff:

```diff
--- a/Source/cmake/OptionsWPE.cmake
+++ b/Source/cmake/OptionsWPE.cmake
@@ -165,25 +166,14 @@
 endif ()
 
 if (ENABLE_WPE_1_1_API)
-    set(SOUP_MINIMUM_VERSION 3.0.0)
-    set(SOUP_API_VERSION 3.0)
     set(WPE_API_VERSION 1.1)
     set(WPE_API_MAJOR_VERSION 1)
-    set(ENABLE_SERVER_PRECONNECT ON)
     SET_AND_EXPOSE_TO_BUILD(ENABLE_2022_GLIB_API OFF)
 else ()
-    set(SOUP_MINIMUM_VERSION 3.0.0)
-    set(SOUP_API_VERSION 3.0)
     set(WPE_API_VERSION 2.0)
     set(WPE_API_MAJOR_VERSION 2)
-    set(ENABLE_SERVER_PRECONNECT ON)
     SET_AND_EXPOSE_TO_BUILD(ENABLE_2022_GLIB_API ON)
 endif ()
-find_package(LibSoup ${SOUP_MINIMUM_VERSION} REQUIRED)
-
-if (NOT LibSoup_FOUND)
-    message(FATAL_ERROR &quot;libsoup 3 is required.&quot;)
-endif ()
```

However, multiple `pkg-config` (`.pc.in`) and TOML (`.toml.in`) template files were not updated and still reference the now-undefined `@SOUP_API_VERSION@` variable. This results in malformed `.pc` files being generated.

```
Source/WebKit/gtk/gtk3-webkitgtk.toml.in:dependencies = [&quot;GObject-2.0&quot;, &quot;Gio-2.0&quot;, &quot;Gtk-@GTK_API_VERSION@.0&quot;, &quot;Soup-@SOUP_API_VERSION@&quot;]
Source/WebKit/gtk/gtk3-webkitgtk.toml.in:[dependencies.&quot;Soup-@SOUP_API_VERSION@&quot;]
Source/WebKit/gtk/gtk3-webkitgtk.toml.in:docs_url = &quot;https://gnome.pages.gitlab.gnome.org/libsoup/libsoup-@SOUP_API_VERSION@&quot;
Source/WebKit/gtk/webkitgtk-web-process-extension.pc.in:Requires: glib-2.0 @GTK_PC_NAME@ libsoup-@SOUP_API_VERSION@ javascriptcoregtk-@WEBKITGTK_API_VERSION@
Source/WebKit/gtk/webkitgtk-web-process-extension.toml.in:dependencies = [&quot;GObject-2.0&quot;, &quot;Gio-2.0&quot;, &quot;Soup-@SOUP_API_VERSION@&quot;]
Source/WebKit/gtk/webkitgtk-web-process-extension.toml.in:[dependencies.&quot;Soup-@SOUP_API_VERSION@&quot;]
Source/WebKit/gtk/webkitgtk-web-process-extension.toml.in:docs_url = &quot;https://gnome.pages.gitlab.gnome.org/libsoup/libsoup-@SOUP_API_VERSION@&quot;
Source/WebKit/gtk/webkitgtk.pc.in:Requires: glib-2.0 @GTK_PC_NAME@ libsoup-@SOUP_API_VERSION@ javascriptcoregtk-@WEBKITGTK_API_VERSION@
Source/WebKit/gtk/gtk4-webkitgtk.toml.in:dependencies = [&quot;GObject-2.0&quot;, &quot;Gio-2.0&quot;, &quot;Gtk-@GTK_API_VERSION@.0&quot;, &quot;Soup-@SOUP_API_VERSION@&quot;]
Source/WebKit/gtk/gtk4-webkitgtk.toml.in:[dependencies.&quot;Soup-@SOUP_API_VERSION@&quot;]
Source/WebKit/gtk/gtk4-webkitgtk.toml.in:docs_url = &quot;https://gnome.pages.gitlab.gnome.org/libsoup/libsoup-@SOUP_API_VERSION@&quot;
Source/WebKit/wpe/wpewebkit.toml.in:dependencies = [&quot;GObject-2.0&quot;, &quot;Gio-2.0&quot;, &quot;Soup-@SOUP_API_VERSION@&quot;]
Source/WebKit/wpe/wpewebkit.toml.in:[dependencies.&quot;Soup-@SOUP_API_VERSION@&quot;]
Source/WebKit/wpe/wpewebkit.toml.in:docs_url = &quot;https://gnome.pages.gitlab.gnome.org/libsoup/libsoup-@SOUP_API_VERSION@&quot;
Source/WebKit/wpe/wpe-web-process-extension.pc.in:Requires: glib-2.0 libsoup-@SOUP_API_VERSION@ wpe-1.0
Source/WebKit/wpe/wpe-webkit-uninstalled.pc.in:Requires: glib-2.0 libsoup-@SOUP_API_VERSION@ wpe-1.0 @WPE_PLATFORM_PC_UNINSTALLED_REQUIRES@
Source/WebKit/wpe/wpe-web-process-extension.toml.in:dependencies = [&quot;GObject-2.0&quot;, &quot;Gio-2.0&quot;, &quot;Soup-@SOUP_API_VERSION@&quot;]
Source/WebKit/wpe/wpe-web-process-extension.toml.in:[dependencies.&quot;Soup-@SOUP_API_VERSION@&quot;]
Source/WebKit/wpe/wpe-web-process-extension.toml.in:docs_url = &quot;https://gnome.pages.gitlab.gnome.org/libsoup/libsoup-@SOUP_API_VERSION@&quot;
Source/WebKit/wpe/wpe-webkit.pc.in:Requires: glib-2.0 libsoup-@SOUP_API_VERSION@ wpe-1.0 @WPE_PLATFORM_PC_REQUIRES@
Source/WebKit/wpe/wpe-web-process-extension-uninstalled.pc.in:Requires: glib-2.0 libsoup-@SOUP_API_VERSION@ wpe-1.0
```

**Steps to Reproduce:**

1. Build WebKit at a revision after commit `301131@main`.
2. Attempt to build a third-party application against the installed WebKit using Meson and `pkg-config`. For example, with this `meson.build` file:
   ```meson
   project(&apos;foo-launcher&apos;, &apos;c&apos;,
     version: &apos;1.0&apos;,
     default_options: [&apos;c_std=gnu11&apos;])
   
   webkit2_dep = dependency(&apos;wpe-webkit-2.0&apos;)
   
   executable(&apos;foo-launcher&apos;,
     &apos;main.c&apos;,
     dependencies: [webkit2_dep])
   ```
3. The build fails during the dependency lookup phase.

**Actual Results:**
The Meson build system fails with the following error because the generated `wpe-webkit-2.0.pc` file contains an invalid requirement for `libsoup-`:

```
| Run-time dependency wpe-webkit-2.0 found: NO
| 
| ../git/meson.build:7:14: ERROR: Dependency lookup for wpe-webkit-2.0 with method &apos;pkgconfig&apos; failed: Could not generate cflags for wpe-webkit-2.0:
| Package libsoup- was not found in the pkg-config search path.
| Perhaps you should add the directory containing `libsoup-.pc&apos;
| to the PKG_CONFIG_PATH environment variable
| Package &apos;libsoup-&apos;, required by &apos;wpe-webkit-2.0&apos;, not found
```

**Expected Results:**

The build should successfully find the `libsoup-3.0` dependency  from `wpe-webkit-2.0` and compile the third-party application.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2149413</commentid>
    <comment_count>1</comment_count>
    <who name="Pablo Saavedra">psaavedra</who>
    <bug_when>2025-10-08 01:44:23 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/52002</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2149437</commentid>
    <comment_count>2</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2025-10-08 05:28:32 -0700</bug_when>
    <thetext>Committed 301201@main (bc743a3f24a0): &lt;https://commits.webkit.org/301201@main&gt;

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

    </bug>

</bugzilla>