about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/xdg-desktop-portal/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-12-01 19:00:09 +0100
committerAlyssa Ross <hi@alyssa.is>2023-12-01 19:00:09 +0100
commit9e9b07490d5bab5d115c66b80bdb10ff0c11ed8d (patch)
tree4368f9e4cb2d5b93a956c085337e45cb70f1e331 /nixpkgs/pkgs/development/libraries/xdg-desktop-portal/default.nix
parenta9cbfb6941b47d6f50129e6e36927882392daed7 (diff)
parent2344fe1da14cb08b0c18743b207995f9b8597915 (diff)
downloadnixlib-9e9b07490d5bab5d115c66b80bdb10ff0c11ed8d.tar
nixlib-9e9b07490d5bab5d115c66b80bdb10ff0c11ed8d.tar.gz
nixlib-9e9b07490d5bab5d115c66b80bdb10ff0c11ed8d.tar.bz2
nixlib-9e9b07490d5bab5d115c66b80bdb10ff0c11ed8d.tar.lz
nixlib-9e9b07490d5bab5d115c66b80bdb10ff0c11ed8d.tar.xz
nixlib-9e9b07490d5bab5d115c66b80bdb10ff0c11ed8d.tar.zst
nixlib-9e9b07490d5bab5d115c66b80bdb10ff0c11ed8d.zip
Merge https://github.com/NixOS/nixpkgs
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/xdg-desktop-portal/default.nix')
-rw-r--r--nixpkgs/pkgs/development/libraries/xdg-desktop-portal/default.nix59
1 files changed, 44 insertions, 15 deletions
diff --git a/nixpkgs/pkgs/development/libraries/xdg-desktop-portal/default.nix b/nixpkgs/pkgs/development/libraries/xdg-desktop-portal/default.nix
index 2cadab4a6742..e760151f216a 100644
--- a/nixpkgs/pkgs/development/libraries/xdg-desktop-portal/default.nix
+++ b/nixpkgs/pkgs/development/libraries/xdg-desktop-portal/default.nix
@@ -1,11 +1,12 @@
 { lib
-, acl
-, autoreconfHook
-, dbus
 , fetchFromGitHub
 , flatpak
 , fuse3
 , bubblewrap
+, docbook_xml_dtd_412
+, docbook_xml_dtd_43
+, docbook_xsl
+, docutils
 , systemdMinimal
 , geoclue2
 , glib
@@ -13,6 +14,8 @@
 , json-glib
 , libportal
 , libxml2
+, meson
+, ninja
 , nixosTests
 , pipewire
 , gdk-pixbuf
@@ -22,12 +25,13 @@
 , stdenv
 , runCommand
 , wrapGAppsHook
+, xmlto
 , enableGeoLocation ? true
 }:
 
 stdenv.mkDerivation (finalAttrs: {
   pname = "xdg-desktop-portal";
-  version = "1.16.0";
+  version = "1.18.2";
 
   outputs = [ "out" "installedTests" ];
 
@@ -35,7 +39,7 @@ stdenv.mkDerivation (finalAttrs: {
     owner = "flatpak";
     repo = "xdg-desktop-portal";
     rev = finalAttrs.version;
-    sha256 = "sha256-5VNauinTvZrSaQzyP/quL/3p2RPcTJUDLscEQMJpvYA=";
+    hash = "sha256-Pd5IKrVp/OOE10Ozy4R3XbubVc6iz0znG+YB0Uu+68E=";
   };
 
   patches = [
@@ -46,18 +50,31 @@ stdenv.mkDerivation (finalAttrs: {
       substitute "${flatpak.icon-validator-patch}" "$out" \
         --replace "/icon-validator/validate-icon.c" "/src/validate-icon.c"
     '')
+
+    # Allow installing installed tests to a separate output.
+    ./installed-tests-path.patch
+
+    # `XDG_DESKTOP_PORTAL_DIR` originally was used for upstream tests. But we are making use
+    # of this in the NixOS module, this actually blocks any configs from being loaded since
+    # configs are not expected to be placed in a portal implementation or even under the
+    # `share/xdg-desktop-portal/portals/` path.
+    ./separate-env-for-portal-config.patch
   ];
 
   nativeBuildInputs = [
-    autoreconfHook
+    docbook_xml_dtd_412
+    docbook_xml_dtd_43
+    docbook_xsl
+    docutils # for rst2man
     libxml2
+    meson
+    ninja
     pkg-config
     wrapGAppsHook
+    xmlto
   ];
 
   buildInputs = [
-    acl
-    dbus
     flatpak
     fuse3
     bubblewrap
@@ -80,17 +97,28 @@ stdenv.mkDerivation (finalAttrs: {
     geoclue2
   ];
 
-  configureFlags = [
-    "--enable-installed-tests"
-  ] ++ lib.optionals (!enableGeoLocation) [
-    "--disable-geoclue"
+  nativeCheckInputs = [
+    python3.pkgs.pytest
+    python3.pkgs.python-dbusmock
+    python3.pkgs.pygobject3
+    python3.pkgs.dbus-python
   ];
 
-  makeFlags = [
-    "installed_testdir=${placeholder "installedTests"}/libexec/installed-tests/xdg-desktop-portal"
-    "installed_test_metadir=${placeholder "installedTests"}/share/installed-tests/xdg-desktop-portal"
+  mesonFlags = [
+    "--sysconfdir=/etc"
+    "-Dinstalled-tests=true"
+    "-Dinstalled_test_prefix=${placeholder "installedTests"}"
+  ] ++ lib.optionals (!enableGeoLocation) [
+    "-Dgeoclue=disabled"
   ];
 
+  doCheck = true;
+
+  preCheck = ''
+    # For test_trash_file
+    export HOME=$(mktemp -d)
+  '';
+
   passthru = {
     tests = {
       installedTests = nixosTests.installed-tests.xdg-desktop-portal;
@@ -104,6 +132,7 @@ stdenv.mkDerivation (finalAttrs: {
 
   meta = with lib; {
     description = "Desktop integration portals for sandboxed apps";
+    homepage = "https://flatpak.github.io/xdg-desktop-portal/";
     license = licenses.lgpl2Plus;
     maintainers = with maintainers; [ jtojnar ];
     platforms = platforms.linux;