flatpak: clean up and add comments

This commit is contained in:
Jan Tojnar 2020-02-07 22:55:16 +01:00 committed by worldofpeace
parent a07e870d85
commit 9ecb58bfcb

View File

@ -1,7 +1,52 @@
{ stdenv, fetchurl, autoreconfHook, docbook_xml_dtd_412, docbook_xml_dtd_42, docbook_xml_dtd_43, docbook_xsl, which, libxml2
, gobject-introspection, gtk-doc, intltool, libxslt, pkgconfig, xmlto, appstream-glib, substituteAll, glibcLocales, yacc, xdg-dbus-proxy, p11-kit
, bubblewrap, bzip2, dbus, glib, gpgme, json-glib, libarchive, libcap, libseccomp, coreutils, gettext, hicolor-icon-theme, fuse, nixosTests
, libsoup, lzma, ostree, polkit, python3, systemd, xorg, valgrind, glib-networking, wrapGAppsHook, dconf, gsettings-desktop-schemas, librsvg }:
{ stdenv
, fetchurl
, autoreconfHook
, docbook_xml_dtd_412
, docbook_xml_dtd_42
, docbook_xml_dtd_43
, docbook_xsl
, which
, libxml2
, gobject-introspection
, gtk-doc
, intltool
, libxslt
, pkgconfig
, xmlto
, appstream-glib
, substituteAll
, glibcLocales
, yacc
, xdg-dbus-proxy
, p11-kit
, bubblewrap
, bzip2
, dbus
, glib
, gpgme
, json-glib
, libarchive
, libcap
, libseccomp
, coreutils
, gettext
, hicolor-icon-theme
, fuse
, nixosTests
, libsoup
, lzma
, ostree
, polkit
, python3
, systemd
, xorg
, valgrind
, glib-networking
, wrapGAppsHook
, dconf
, gsettings-desktop-schemas
, librsvg
}:
stdenv.mkDerivation rec {
pname = "flatpak";
@ -16,41 +61,91 @@ stdenv.mkDerivation rec {
};
patches = [
# Hardcode paths used by tests and change test runtime generation to use files from Nix store.
# https://github.com/flatpak/flatpak/issues/1460
(substituteAll {
src = ./fix-test-paths.patch;
inherit coreutils gettext glibcLocales;
hicolorIconTheme = hicolor-icon-theme;
})
# Hardcode paths used by Flatpak itself.
(substituteAll {
src = ./fix-paths.patch;
p11 = p11-kit;
})
# Adapt paths exposed to sandbox for NixOS.
(substituteAll {
src = ./bubblewrap-paths.patch;
inherit (builtins) storeDir;
})
# patch taken from gtk_doc
# Allow gtk-doc to find schemas using XML_CATALOG_FILES environment variable.
# Patch taken from gtk-doc expression.
./respect-xml-catalog-files-var.patch
# Dont hardcode flatpak binary path in launchers stored under users profile otherwise they will break after Flatpak update.
# https://github.com/NixOS/nixpkgs/issues/43581
./use-flatpak-from-path.patch
# Nix environment hacks should not leak into the apps.
# https://github.com/NixOS/nixpkgs/issues/53441
./unset-env-vars.patch
# But we want the GDK_PIXBUF_MODULE_FILE from the wrapper affect the icon validator.
./validate-icon-pixbuf.patch
];
nativeBuildInputs = [
autoreconfHook libxml2 docbook_xml_dtd_412 docbook_xml_dtd_42 docbook_xml_dtd_43 docbook_xsl which gobject-introspection
gtk-doc intltool libxslt pkgconfig xmlto appstream-glib yacc wrapGAppsHook
autoreconfHook
libxml2
docbook_xml_dtd_412
docbook_xml_dtd_42
docbook_xml_dtd_43
docbook_xsl
which
gobject-introspection
gtk-doc
intltool
libxslt
pkgconfig
xmlto
appstream-glib
yacc
wrapGAppsHook
];
buildInputs = [
bubblewrap bzip2 dbus dconf glib gpgme json-glib libarchive libcap libseccomp
libsoup lzma ostree polkit python3 systemd xorg.libXau fuse
gsettings-desktop-schemas glib-networking
bubblewrap
bzip2
dbus
dconf
glib
gpgme
json-glib
libarchive
libcap
libseccomp
libsoup
lzma
ostree
polkit
python3
systemd
xorg.libXau
fuse
gsettings-desktop-schemas
glib-networking
librsvg # for flatpak-validate-icon
];
checkInputs = [ valgrind ];
checkInputs = [
valgrind
];
doCheck = false; # TODO: some issues with temporary files
# TODO: some issues with temporary files
doCheck = false;
NIX_LDFLAGS = "-lpthread";
@ -65,8 +160,8 @@ stdenv.mkDerivation rec {
];
makeFlags = [
"installed_testdir=$(installedTests)/libexec/installed-tests/flatpak"
"installed_test_metadir=$(installedTests)/share/installed-tests/flatpak"
"installed_testdir=${placeholder "installedTests"}/libexec/installed-tests/flatpak"
"installed_test_metadir=${placeholder "installedTests"}/share/installed-tests/flatpak"
];
postPatch = ''
@ -82,7 +177,7 @@ stdenv.mkDerivation rec {
meta = with stdenv.lib; {
description = "Linux application sandboxing and distribution framework";
homepage = https://flatpak.org/;
homepage = "https://flatpak.org/";
license = licenses.lgpl21;
maintainers = with maintainers; [ jtojnar ];
platforms = platforms.linux;