nixpkgs/pkgs/development/libraries/libportal/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

71 lines
1.5 KiB
Nix
Raw Normal View History

2021-05-14 15:50:43 +02:00
{ stdenv
, lib
2020-02-07 06:51:27 +01:00
, fetchFromGitHub
, meson
, ninja
, pkg-config
, gobject-introspection
, vala
, gi-docgen
2020-02-07 06:51:27 +01:00
, glib
, gtk3
, gtk4
, libsForQt5
, variant ? null
2020-02-07 06:51:27 +01:00
}:
assert variant == null || variant == "gtk3" || variant == "gtk4" || variant == "qt5";
2020-02-07 06:51:27 +01:00
stdenv.mkDerivation rec {
pname = "libportal" + lib.optionalString (variant != null) "-${variant}";
2022-03-22 11:05:58 +01:00
version = "0.6";
2020-02-07 06:51:27 +01:00
outputs = [ "out" "dev" "devdoc" ];
src = fetchFromGitHub {
owner = "flatpak";
repo = "libportal";
2020-02-07 06:51:27 +01:00
rev = version;
2022-03-22 11:05:58 +01:00
sha256 = "sha256-wDDE43UC6FBgPYLS+WWExeheURCH/3fCKu5oJg7GM+A=";
2020-02-07 06:51:27 +01:00
};
nativeBuildInputs = [
meson
ninja
pkg-config
gi-docgen
] ++ lib.optionals (variant != "qt5") [
gobject-introspection
vala
2020-02-07 06:51:27 +01:00
];
propagatedBuildInputs = [
glib
] ++ lib.optionals (variant == "gtk3") [
gtk3
] ++ lib.optionals (variant == "gtk4") [
gtk4
] ++ lib.optionals (variant == "qt5") [
libsForQt5.qtbase
];
mesonFlags = [
"-Dbackends=${lib.optionalString (variant != null) variant}"
"-Dvapi=${if variant != "qt5" then "true" else "false"}"
"-Dintrospection=${if variant != "qt5" then "true" else "false"}"
2020-02-07 06:51:27 +01:00
];
postFixup = ''
# Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
moveToOutput "share/doc" "$devdoc"
'';
meta = with lib; {
2020-02-07 06:51:27 +01:00
description = "Flatpak portal library";
homepage = "https://github.com/flatpak/libportal";
license = licenses.lgpl3Plus;
2020-02-07 06:51:27 +01:00
maintainers = with maintainers; [ jtojnar ];
platforms = platforms.linux;
};
}