2021-05-20 23:08:51 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
2022-08-12 12:06:08 +00:00
|
|
|
, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
, meson
|
|
|
|
, ninja
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2022-01-26 04:04:25 +00:00
|
|
|
, gobject-introspection
|
|
|
|
, vala
|
|
|
|
, gi-docgen
|
2020-04-24 23:36:52 +00:00
|
|
|
, glib
|
2022-01-26 04:04:25 +00:00
|
|
|
, gtk3
|
|
|
|
, gtk4
|
|
|
|
, libsForQt5
|
|
|
|
, variant ? null
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2022-01-26 04:04:25 +00:00
|
|
|
assert variant == null || variant == "gtk3" || variant == "gtk4" || variant == "qt5";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2022-01-26 04:04:25 +00:00
|
|
|
pname = "libportal" + lib.optionalString (variant != null) "-${variant}";
|
2022-03-30 09:31:56 +00:00
|
|
|
version = "0.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
outputs = [ "out" "dev" ]
|
|
|
|
++ lib.optional (variant != "qt5") "devdoc";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "flatpak";
|
2022-01-26 04:04:25 +00:00
|
|
|
repo = "libportal";
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = version;
|
2022-03-30 09:31:56 +00:00
|
|
|
sha256 = "sha256-wDDE43UC6FBgPYLS+WWExeheURCH/3fCKu5oJg7GM+A=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
# TODO: remove on 0.7
|
2022-08-12 12:06:08 +00:00
|
|
|
patches = [
|
2022-08-21 13:32:41 +00:00
|
|
|
# https://github.com/flatpak/libportal/pull/107
|
2022-08-12 12:06:08 +00:00
|
|
|
(fetchpatch {
|
2022-08-21 13:32:41 +00:00
|
|
|
name = "check-presence-of-sys-vfs-h.patch";
|
|
|
|
url = "https://github.com/flatpak/libportal/commit/e91a5d2ceb494ca0dd67295736e671b0142c7540.patch";
|
|
|
|
sha256 = "sha256-uFyhlU2fJgW4z0I31fABdc+pimLFYkqM4lggSIFs1tw=";
|
2022-08-12 12:06:08 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
depsBuildBuild = [
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
meson
|
|
|
|
ninja
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config
|
2022-01-26 04:04:25 +00:00
|
|
|
gi-docgen
|
|
|
|
] ++ lib.optionals (variant != "qt5") [
|
|
|
|
gobject-introspection
|
|
|
|
vala
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
glib
|
2022-01-26 04:04:25 +00:00
|
|
|
] ++ lib.optionals (variant == "gtk3") [
|
|
|
|
gtk3
|
|
|
|
] ++ lib.optionals (variant == "gtk4") [
|
|
|
|
gtk4
|
|
|
|
] ++ lib.optionals (variant == "qt5") [
|
|
|
|
libsForQt5.qtbase
|
2023-05-24 13:37:59 +00:00
|
|
|
libsForQt5.qtx11extras
|
2022-01-26 04:04:25 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
mesonFlags = [
|
|
|
|
"-Dbackends=${lib.optionalString (variant != null) variant}"
|
|
|
|
"-Dvapi=${if variant != "qt5" then "true" else "false"}"
|
|
|
|
"-Dintrospection=${if variant != "qt5" then "true" else "false"}"
|
2023-05-24 13:37:59 +00:00
|
|
|
"-Ddocs=${if variant != "qt5" then "true" else "false"}" # requires introspection=true
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2022-01-26 04:04:25 +00:00
|
|
|
postFixup = ''
|
|
|
|
# Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
|
|
|
|
moveToOutput "share/doc" "$devdoc"
|
|
|
|
'';
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
# we don't have any binaries
|
|
|
|
dontWrapQtApps = true;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Flatpak portal library";
|
|
|
|
homepage = "https://github.com/flatpak/libportal";
|
2022-01-26 04:04:25 +00:00
|
|
|
license = licenses.lgpl3Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ jtojnar ];
|
2022-08-12 12:06:08 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|