From 838817db4c844f45b16b9f56b55272b68196076e Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Fri, 16 Jan 2026 17:22:06 -0500 Subject: [PATCH] new blfs: sys-apps/xdg-desktop-portal-1.20.3 --- sys-apps/xdg-desktop-portal-1.20.3.PKGBUILD | 62 +++++++++++ ...top-portal-1.20.0-optional-gstreamer.patch | 104 ++++++++++++++++++ 2 files changed, 166 insertions(+) create mode 100644 sys-apps/xdg-desktop-portal-1.20.3.PKGBUILD create mode 100644 sys-apps/xdg-desktop-portal-1.20.3/xdg-desktop-portal-1.20.0-optional-gstreamer.patch diff --git a/sys-apps/xdg-desktop-portal-1.20.3.PKGBUILD b/sys-apps/xdg-desktop-portal-1.20.3.PKGBUILD new file mode 100644 index 0000000..6b33bd0 --- /dev/null +++ b/sys-apps/xdg-desktop-portal-1.20.3.PKGBUILD @@ -0,0 +1,62 @@ +pkgname=xdg-desktop-portal +pkgver=1.20.3 +pkgdesc="Desktop integration portal" +homepage="https://flatpak.github.io/xdg-desktop-portal/ https://github.com/flatpak/xdg-desktop-portal" +depends=( + fuse:3 + gcc + gdk-pixbuf + glib:2 + glibc + json-glib + pipewire + systemd +) +makedepends=(meson) +license=("LGPL-2.1") +_patches=("${pkgname}-1.20.0-optional-gstreamer.patch") +_patch_sums=("c5bc6278630df40c61904eb7315f1888ae7502e74de9f8978e27df2acf79fe5ea6887b92d99a38849057ec65f7d8750bf59568ad530ad878f81c63123dc1677c") +sources=("${pkgname}-${pkgver}.tar.xz" + "${_patches[@]}" +) +urls=("https://github.com/flatpak/${pkgname}/releases/download/${pkgver}/${sources[0]}" + "${_patches[@]}" +) +sha512sums=("e3da40bb102f7a391b062baa5517460b47e653f10412237aebb9d32b375db51bee3e365cabd5cb2d9059f2f52cfa5b7bf364555ee1ff892d97e61841ddbc870e" + "${_patch_sums[@]}" +) + +src_prepare() { + tar -xf ${distdir}/${sources[0]} --strip-components=1 + for _patch in ${_patches[@]}; do + patch -p1 -i ${filedir}/${_patch} + done +} + +src_build() { + local meson_args=( + --prefix=/usr + --buildtype=release + --wrap-mode=nodownload + -D python.bytecompile=1 + -D flatpak-interfaces=disabled + -D geoclue=disabled + -D gudev=disabled + -D sandboxed-image-validation=disabled + -D sandboxed-sound-validation=disabled + -D systemd=enabled + -D documentation=disabled + -D datarootdir="/usr/share" + -D man-pages=enabled + -D installed-tests=false + -D tests=disabled + ) + meson setup build "${meson_args[@]}" + meson compile -C build +} + +src_install() { + meson install -C build --destdir "$pkgdir" +} + +# vim:ft=sh syn=sh et sw=2: diff --git a/sys-apps/xdg-desktop-portal-1.20.3/xdg-desktop-portal-1.20.0-optional-gstreamer.patch b/sys-apps/xdg-desktop-portal-1.20.3/xdg-desktop-portal-1.20.0-optional-gstreamer.patch new file mode 100644 index 0000000..e89844a --- /dev/null +++ b/sys-apps/xdg-desktop-portal-1.20.3/xdg-desktop-portal-1.20.0-optional-gstreamer.patch @@ -0,0 +1,104 @@ +https://bugs.gentoo.org/951611 +https://bugs.gentoo.org/951609 +https://github.com/flatpak/xdg-desktop-portal/issues/1650 +https://github.com/flint2/gentoo/blob/7c8a4b4deb84826f20a7c8af1a0f125cd4942b4a/sys-apps/xdg-desktop-portal/files/xdg-desktop-portal-1.20.0-disable-gstreamer.patch + +gstreamer is searched for unconditionally, but we don't have gstreamer-pbutils +packaged yet, so that's a problem. Make it conditional for now (as it ought +to be upstream either way if they're going to have an option for it). +--- a/meson.build ++++ b/meson.build +@@ -112,7 +112,7 @@ gio_unix_dep = dependency('gio-unix-2.0') + json_glib_dep = dependency('json-glib-1.0') + fuse3_dep = dependency('fuse3', version: '>= 3.10.0') + gdk_pixbuf_dep = dependency('gdk-pixbuf-2.0') +-gst_pbutils_dep = dependency('gstreamer-pbutils-1.0') ++gst_pbutils_dep = dependency('gstreamer-pbutils-1.0', required: get_option('sandboxed-sound-validation')) + geoclue_dep = dependency( + 'libgeoclue-2.0', + version: '>= 2.5.2', +@@ -122,8 +122,8 @@ pipewire_dep = dependency('libpipewire-0.3', version: '>= 0.2.90') + libsystemd_dep = dependency('libsystemd', required: get_option('systemd')) + gudev_dep = dependency('gudev-1.0', required: get_option('gudev')) + umockdev_dep = dependency('umockdev-1.0', required: get_option('tests')) +- +-gst_inspect = find_program('gst-inspect-1.0', required: false) ++gst_inspect = find_program('gst-inspect-1.0', required: get_option('sandboxed-sound-validation')) ++have_gst_inspect = gst_inspect.found() + if gst_inspect.found() + have_wav_parse = run_command( + gst_inspect, 'wavparse', '--exists', +@@ -132,6 +132,7 @@ if gst_inspect.found() + else + have_wav_parse = false + endif ++ + if have_wav_parse + config_h.set('HAVE_WAV_PARSE', 1) + endif +@@ -224,7 +225,7 @@ enable_tests = get_option('tests') \ + .require(python.found() and python.language_version().version_compare('>=3.9'), + error_message: 'Python version >=3.9 is required') \ + .require(umockdev_dep.found()) \ +- .require(have_wav_parse, ++ .require(not have_wav_parse and not get_option('sandboxed-sound-validation').allowed(), + error_message: 'gst-inspect and the wavparse plugins are required') \ + .allowed() + +--- a/src/meson.build ++++ b/src/meson.build +@@ -206,14 +206,16 @@ if bwrap.found() + validate_sound_c_args += '-DHELPER="@0@"'.format(bwrap.full_path()) + endif + +-xdp_validate_sound = executable( +- 'xdg-desktop-portal-validate-sound', +- 'validate-sound.c', +- dependencies: [gst_pbutils_dep], +- c_args: validate_sound_c_args, +- install: true, +- install_dir: libexecdir, +-) ++if gst_inspect.found() ++ xdp_validate_sound = executable( ++ 'xdg-desktop-portal-validate-sound', ++ 'validate-sound.c', ++ dependencies: [gst_pbutils_dep], ++ c_args: validate_sound_c_args, ++ install: true, ++ install_dir: libexecdir, ++ ) ++endif + + configure_file( + input: 'xdg-desktop-portal-rewrite-launchers.service.in', +--- a/tests/meson.build ++++ b/tests/meson.build +@@ -94,7 +94,6 @@ pytest_files = [ + 'test_inhibit.py', + 'test_inputcapture.py', + 'test_location.py', +- 'test_notification.py', + 'test_openuri.py', + 'test_permission_store.py', + 'test_print.py', +@@ -122,7 +121,6 @@ template_files = [ + 'templates/__init__.py', + 'templates/inputcapture.py', + 'templates/lockdown.py', +- 'templates/notification.py', + 'templates/print.py', + 'templates/remotedesktop.py', + 'templates/screenshot.py', +@@ -131,6 +129,11 @@ template_files = [ + 'templates/wallpaper.py', + ] + ++if have_gst_inspect ++ template_files += ['templates/notification.py'] ++ pytest_files += ['test_notification.py'] ++endif ++ + foreach pytest_file : pytest_files + testname = pytest_file.replace('.py', '').replace('test_', '') + test(