entangle: Fix build with glib 2.82

https://hydra.nixos.org/build/274565015/nixlog/1

`pcre` is no longer needed as the comment longer applies.

`glib-2.0.pc` now has `libsysprof-capture-4` in `Requires.private` field.
Normally, this does not matter since we patch our `pkg-config` to ignore that
outside of static builds but `entangle` was using `pkgconf`, which is not patched.

Let’s switch to standard `pkg-config`.
This will also allow us to clean some more dependencies.

Unfortunately, this also reveals issue with an underspecified `gio-unix-2.0` dependency so we need to fix that.
This commit is contained in:
Jan Tojnar 2024-10-11 18:22:20 +08:00 committed by Bobby Rong
parent 5cf66dcca9
commit acf8f35b80
No known key found for this signature in database
2 changed files with 55 additions and 8 deletions

View File

@ -0,0 +1,48 @@
From 7f51ec77e1a35bbfb8ced3b7340818a72d859c0e Mon Sep 17 00:00:00 2001
From: Jan Tojnar <jtojnar@gmail.com>
Date: Mon, 14 Oct 2024 00:57:57 +0200
Subject: [PATCH] build: Add missing gio-unix-2.0 dependency
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
On Nix, we try to isolate dependencies more than usual and have an alternative interpretation of pkg-configs `Requires.private` field.
In this environment, Entangle fails to build because it has implicit dependency on gio-unix:
../src/frontend/entangle-camera-manager.c:28:10: fatal error: gio/gunixoutputstream.h: No such file or directory
28 | #include <gio/gunixoutputstream.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~
Lets add it explicitly.
---
meson.build | 1 +
src/frontend/meson.build | 1 +
2 files changed, 2 insertions(+)
diff --git a/meson.build b/meson.build
index 1510962..90873ef 100644
--- a/meson.build
+++ b/meson.build
@@ -33,6 +33,7 @@ add_global_arguments('-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_38', language :
glib_dep = dependency('glib-2.0', version: glib_min_version)
gio_dep = dependency('gio-2.0', version: glib_min_version)
+gio_unix_dep = dependency('gio-unix-2.0', version: glib_min_version)
gthread_dep = dependency('gthread-2.0', version: glib_min_version)
gmodule_dep = dependency('gmodule-2.0', version: glib_min_version)
gdk_pixbuf_dep = dependency('gdk-pixbuf-2.0', version: gdk_pixbuf_min_version)
diff --git a/src/frontend/meson.build b/src/frontend/meson.build
index 1ed9d75..81310c8 100644
--- a/src/frontend/meson.build
+++ b/src/frontend/meson.build
@@ -90,6 +90,7 @@ entangle_frontend_sources += entangle_frontend_enum_sources
entangle_frontend_deps = [
gthread_dep,
gmodule_dep,
+ gio_unix_dep,
gtk_dep,
gst_dep,
pango_dep,
--
2.46.0

View File

@ -9,7 +9,7 @@
ninja,
perl,
python3,
pkgconf,
pkg-config,
wrapGAppsHook3,
at-spi2-core,
dbus,
@ -33,13 +33,10 @@
libunwind,
libxkbcommon,
orc,
pcre,
pcre2,
udev,
util-linux,
xorg,
zstd,
cmake,
}:
stdenv.mkDerivation (finalAttrs: {
@ -60,6 +57,11 @@ stdenv.mkDerivation (finalAttrs: {
url = "https://gitlab.com/entangle/entangle/-/commit/54795d275a93e94331a614c8712740fcedbdd4f0.patch";
sha256 = "iEgqGjKa0xwSdctwvNdEV361l9nx+bz53xn3fuDgtzY=";
})
# Fix implicit dependency
# https://github.com/NixOS/nixpkgs/issues/36468
# https://gitlab.com/entangle/entangle/-/merge_requests/61
./0001-build-Add-missing-gio-unix-2.0-dependency.patch
];
nativeBuildInputs = [
@ -70,10 +72,9 @@ stdenv.mkDerivation (finalAttrs: {
ninja
perl # for pod2man and build scripts
python3 # for build scripts
pkgconf
pkg-config
wrapGAppsHook3
gobject-introspection
cmake
];
buildInputs =
@ -100,8 +101,6 @@ stdenv.mkDerivation (finalAttrs: {
libunwind
libxkbcommon
orc
pcre # required by libselinux before we USE_PCRE2
pcre2 # required by glib-2.0
udev
util-linux
zstd