44 flatpak ,
55 fuse3 ,
66 bubblewrap ,
7- docbook_xml_dtd_412 ,
8- docbook_xml_dtd_43 ,
9- docbook_xsl ,
107 docutils ,
118 systemdMinimal ,
129 geoclue2 ,
1310 glib ,
1411 gsettings-desktop-schemas ,
1512 json-glib ,
16- libportal ,
17- libxml2 ,
1813 meson ,
1914 ninja ,
2015 nixosTests ,
2621 pkg-config ,
2722 stdenv ,
2823 runCommand ,
29- wrapGAppsHook3 ,
30- xmlto ,
24+ wrapGAppsNoGuiHook ,
3125 bash ,
26+ dbus ,
27+ gst_all_1 ,
28+ libgudev ,
29+ umockdev ,
30+ substituteAll ,
3231 enableGeoLocation ? true ,
3332 enableSystemd ? true ,
3433} :
3534
3635stdenv . mkDerivation ( finalAttrs : {
3736 pname = "xdg-desktop-portal" ;
38- version = "1.18.4 " ;
37+ version = "1.20.0 " ;
3938
4039 outputs = [
4140 "out"
@@ -45,18 +44,23 @@ stdenv.mkDerivation (finalAttrs: {
4544 src = fetchFromGitHub {
4645 owner = "flatpak" ;
4746 repo = "xdg-desktop-portal" ;
48- rev = finalAttrs . version ;
49- hash = "sha256-o+aO7uGewDPrtgOgmp/CE2uiqiBLyo07pVCFrtlORFQ =" ;
47+ tag = finalAttrs . version ;
48+ hash = "sha256-FHMa8fTr8qNEM5WptuMjMs/XOsvmFxi8pDaCrwJ3/ww =" ;
5049 } ;
5150
5251 patches = [
5352 # The icon validator copied from Flatpak needs to access the gdk-pixbuf loaders
5453 # in the Nix store and cannot bind FHS paths since those are not available on NixOS.
55- ( runCommand "icon-validator.patch" { } ''
56- # Flatpak uses a different path
57- substitute "${ flatpak . icon-validator-patch } " "$out" \
58- --replace "/icon-validator/validate-icon.c" "/src/validate-icon.c"
59- '' )
54+ ( substituteAll {
55+ src = ./fix-icon-validation.patch ;
56+ inherit ( builtins ) storeDir ;
57+ } )
58+
59+ # Same for the sound validator, except the gdk-pixbuf part.
60+ ( substituteAll {
61+ src = ./fix-sound-validation.patch ;
62+ inherit ( builtins ) storeDir ;
63+ } )
6064
6165 # Allow installing installed tests to a separate output.
6266 ./installed-tests-path.patch
@@ -68,23 +72,14 @@ stdenv.mkDerivation (finalAttrs: {
6872
6973 # test tries to read /proc/cmdline, which is not intended to be accessible in the sandbox
7074 ./trash-test.patch
71-
72- # Install files required to be in XDG_DATA_DIR of the installed tests
73- # Merged PR https://github.com/flatpak/xdg-desktop-portal/pull/1444
74- ./installed-tests-share.patch
7575 ] ;
7676
7777 nativeBuildInputs = [
78- docbook_xml_dtd_412
79- docbook_xml_dtd_43
80- docbook_xsl
8178 docutils # for rst2man
82- libxml2
8379 meson
8480 ninja
8581 pkg-config
86- wrapGAppsHook3
87- xmlto
82+ wrapGAppsNoGuiHook
8883 ] ;
8984
9085 buildInputs =
@@ -95,19 +90,14 @@ stdenv.mkDerivation (finalAttrs: {
9590 glib
9691 gsettings-desktop-schemas
9792 json-glib
98- libportal
9993 pipewire
94+ gst_all_1 . gst-plugins-base
95+ libgudev
96+ umockdev
10097
10198 # For icon validator
10299 gdk-pixbuf
103100 librsvg
104-
105- # For document-fuse installed test.
106- ( python3 . withPackages (
107- pp : with pp ; [
108- pygobject3
109- ]
110- ) )
111101 bash
112102 ]
113103 ++ lib . optionals enableGeoLocation [
@@ -118,25 +108,37 @@ stdenv.mkDerivation (finalAttrs: {
118108 ] ;
119109
120110 nativeCheckInputs = [
111+ dbus
112+ gdk-pixbuf
113+ gst_all_1 . gstreamer
114+ gst_all_1 . gst-plugins-good
121115 gobject-introspection
122- python3 . pkgs . pytest
123- python3 . pkgs . python-dbusmock
124- python3 . pkgs . pygobject3
125- python3 . pkgs . dbus-python
116+
117+ # NB: this Python is used both for build-time tests
118+ # and for installed (VM) tests, so it includes dependencies
119+ # for both
120+ ( python3 . withPackages ( ps : [
121+ ps . pytest
122+ ps . python-dbusmock
123+ ps . pygobject3
124+ ps . dbus-python
125+ ] ) )
126+ umockdev
126127 ] ;
127128
128129 mesonFlags =
129130 [
130131 "--sysconfdir=/etc"
131132 "-Dinstalled-tests=true"
132133 "-Dinstalled_test_prefix=${ placeholder "installedTests" } "
134+ "-Ddocumentation=disabled" # pulls in a whole lot of extra stuff
133135 ( lib . mesonEnable "systemd" enableSystemd )
134136 ]
135137 ++ lib . optionals ( ! enableGeoLocation ) [
136138 "-Dgeoclue=disabled"
137139 ]
138140 ++ lib . optionals ( ! finalAttrs . finalPackage . doCheck ) [
139- "-Dpytest =disabled"
141+ "-Dtests =disabled"
140142 ] ;
141143
142144 strictDeps = true ;
@@ -148,13 +150,8 @@ stdenv.mkDerivation (finalAttrs: {
148150 substituteInPlace meson.build \
149151 --replace-fail "find_program('bwrap'" "find_program('${ lib . getExe bubblewrap } '"
150152
151- # Disable test failing with libportal 0.9.0
152- ${
153- assert ( lib . versionOlder finalAttrs . version "1.20.0" ) ;
154- "# TODO: Remove when updating to x-d-p 1.20.0"
155- }
156- substituteInPlace tests/test-portals.c \
157- --replace-fail 'g_test_add_func ("/portal/notification/bad-arg", test_notification_bad_arg);' ""
153+ patchShebangs src/generate-method-info.py
154+ patchShebangs tests/run-test.sh
158155 '' ;
159156
160157 preCheck = ''
@@ -165,42 +162,29 @@ stdenv.mkDerivation (finalAttrs: {
165162 # be flaky. Let's disable those downstream as hydra exhibits similar
166163 # flakes:
167164 # https://github.com/NixOS/nixpkgs/pull/270085#issuecomment-1840053951
168- export TEST_IN_CI=1
169- '' ;
165+ export XDP_TEST_IN_CI=1
170166
171- postFixup =
172- let
173- documentFuse = "${ placeholder "installedTests" } /libexec/installed-tests/xdg-desktop-portal/test-document-fuse.py" ;
174- testPortals = "${ placeholder "installedTests" } /libexec/installed-tests/xdg-desktop-portal/test-portals" ;
175-
176- in
177- ''
178- if [ -x '${ documentFuse } ' ] ; then
179- wrapGApp '${ documentFuse } '
180- wrapGApp '${ testPortals } '
181- # (xdg-desktop-portal:995): xdg-desktop-portal-WARNING **: 21:21:55.673: Failed to get GeoClue client: Timeout was reached
182- # xdg-desktop-portal:ERROR:../tests/location.c:22:location_cb: 'res' should be TRUE
183- # https://github.com/flatpak/xdg-desktop-portal/blob/1d6dfb57067dec182b546dfb60c87aa3452c77ed/tests/location.c#L21
184- rm $installedTests/share/installed-tests/xdg-desktop-portal/test-portals-location.test
185- fi
186- '' ;
167+ # need to set this ourselves, because the tests will set LD_PRELOAD=libumockdev-preload.so,
168+ # which can't be found because it's not in default rpath
169+ export LD_PRELOAD=${ lib . getLib umockdev } /lib/libumockdev-preload.so
170+ '' ;
187171
188172 passthru = {
189173 tests = {
190174 installedTests = nixosTests . installed-tests . xdg-desktop-portal ;
191175
192176 validate-icon = runCommand "test-icon-validation" { } ''
193- ${ finalAttrs . finalPackage } /libexec/xdg-desktop-portal-validate-icon --sandbox 512 512 ${ ../../../applications/audio/zynaddsubfx/ZynLogo.svg } > "$out"
177+ ${ finalAttrs . finalPackage } /libexec/xdg-desktop-portal-validate-icon --ruleset=desktop -- sandbox --path= ${ ../../../applications/audio/zynaddsubfx/ZynLogo.svg } > "$out"
194178 grep format=svg "$out"
195179 '' ;
196180 } ;
197181 } ;
198182
199- meta = with lib ; {
183+ meta = {
200184 description = "Desktop integration portals for sandboxed apps" ;
201- homepage = "https://flatpak.github.io/xdg-desktop-portal/ " ;
202- license = licenses . lgpl2Plus ;
203- maintainers = with maintainers ; [ jtojnar ] ;
204- platforms = platforms . linux ;
185+ homepage = "https://flatpak.github.io/xdg-desktop-portal" ;
186+ license = lib . licenses . lgpl2Plus ;
187+ maintainers = with lib . maintainers ; [ jtojnar ] ;
188+ platforms = lib . platforms . linux ;
205189 } ;
206190} )
0 commit comments