2022-03-05 16:20:37 +00:00
|
|
|
{ lib
|
|
|
|
, acl
|
|
|
|
, autoreconfHook
|
|
|
|
, dbus
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
2021-12-06 16:07:01 +00:00
|
|
|
, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
, flatpak
|
|
|
|
, fuse
|
|
|
|
, geoclue2
|
2022-03-05 16:20:37 +00:00
|
|
|
, glib
|
|
|
|
, gsettings-desktop-schemas
|
2020-04-24 23:36:52 +00:00
|
|
|
, json-glib
|
2022-03-05 16:20:37 +00:00
|
|
|
, libportal
|
|
|
|
, libxml2
|
|
|
|
, nixosTests
|
|
|
|
, pipewire
|
|
|
|
, pkg-config
|
|
|
|
, stdenv
|
|
|
|
, substituteAll
|
2020-04-24 23:36:52 +00:00
|
|
|
, wrapGAppsHook
|
2022-03-05 16:20:37 +00:00
|
|
|
, enableGeoLocation ? true
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "xdg-desktop-portal";
|
2022-03-05 16:20:37 +00:00
|
|
|
version = "1.12.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "installedTests" ];
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "flatpak";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-03-05 16:20:37 +00:00
|
|
|
sha256 = "1fc3LXN6wp/zQw4HQ0Q99HUvBhynHrQi2p3s/08izuE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Hardcode paths used by x-d-p itself.
|
|
|
|
(substituteAll {
|
|
|
|
src = ./fix-paths.patch;
|
|
|
|
inherit flatpak;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
|
|
|
libxml2
|
2022-03-05 16:20:37 +00:00
|
|
|
pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
wrapGAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
acl
|
|
|
|
dbus
|
2022-03-05 16:20:37 +00:00
|
|
|
flatpak
|
2020-04-24 23:36:52 +00:00
|
|
|
fuse
|
2022-03-05 16:20:37 +00:00
|
|
|
glib
|
2020-04-24 23:36:52 +00:00
|
|
|
gsettings-desktop-schemas
|
|
|
|
json-glib
|
2022-03-05 16:20:37 +00:00
|
|
|
libportal
|
|
|
|
pipewire
|
|
|
|
] ++ lib.optionals enableGeoLocation [
|
|
|
|
geoclue2
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--enable-installed-tests"
|
2022-03-05 16:20:37 +00:00
|
|
|
] ++ lib.optionals (!enableGeoLocation) [
|
|
|
|
"--disable-geoclue"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"installed_testdir=${placeholder "installedTests"}/libexec/installed-tests/xdg-desktop-portal"
|
|
|
|
"installed_test_metadir=${placeholder "installedTests"}/share/installed-tests/xdg-desktop-portal"
|
|
|
|
];
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
tests = {
|
|
|
|
installedTests = nixosTests.installed-tests.xdg-desktop-portal;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Desktop integration portals for sandboxed apps";
|
2022-03-05 16:20:37 +00:00
|
|
|
license = licenses.lgpl2Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ jtojnar ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|