flatpak: clean up and add comments
This commit is contained in:
parent
a07e870d85
commit
9ecb58bfcb
@ -1,7 +1,52 @@
|
|||||||
{ stdenv, fetchurl, autoreconfHook, docbook_xml_dtd_412, docbook_xml_dtd_42, docbook_xml_dtd_43, docbook_xsl, which, libxml2
|
{ stdenv
|
||||||
, gobject-introspection, gtk-doc, intltool, libxslt, pkgconfig, xmlto, appstream-glib, substituteAll, glibcLocales, yacc, xdg-dbus-proxy, p11-kit
|
, fetchurl
|
||||||
, bubblewrap, bzip2, dbus, glib, gpgme, json-glib, libarchive, libcap, libseccomp, coreutils, gettext, hicolor-icon-theme, fuse, nixosTests
|
, autoreconfHook
|
||||||
, libsoup, lzma, ostree, polkit, python3, systemd, xorg, valgrind, glib-networking, wrapGAppsHook, dconf, gsettings-desktop-schemas, librsvg }:
|
, 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 {
|
stdenv.mkDerivation rec {
|
||||||
pname = "flatpak";
|
pname = "flatpak";
|
||||||
@ -16,41 +61,91 @@ stdenv.mkDerivation rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
patches = [
|
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 {
|
(substituteAll {
|
||||||
src = ./fix-test-paths.patch;
|
src = ./fix-test-paths.patch;
|
||||||
inherit coreutils gettext glibcLocales;
|
inherit coreutils gettext glibcLocales;
|
||||||
hicolorIconTheme = hicolor-icon-theme;
|
hicolorIconTheme = hicolor-icon-theme;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
# Hardcode paths used by Flatpak itself.
|
||||||
(substituteAll {
|
(substituteAll {
|
||||||
src = ./fix-paths.patch;
|
src = ./fix-paths.patch;
|
||||||
p11 = p11-kit;
|
p11 = p11-kit;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
# Adapt paths exposed to sandbox for NixOS.
|
||||||
(substituteAll {
|
(substituteAll {
|
||||||
src = ./bubblewrap-paths.patch;
|
src = ./bubblewrap-paths.patch;
|
||||||
inherit (builtins) storeDir;
|
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
|
./respect-xml-catalog-files-var.patch
|
||||||
|
|
||||||
|
# Don’t hardcode flatpak binary path in launchers stored under user’s profile otherwise they will break after Flatpak update.
|
||||||
|
# https://github.com/NixOS/nixpkgs/issues/43581
|
||||||
./use-flatpak-from-path.patch
|
./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
|
./unset-env-vars.patch
|
||||||
|
|
||||||
|
# But we want the GDK_PIXBUF_MODULE_FILE from the wrapper affect the icon validator.
|
||||||
./validate-icon-pixbuf.patch
|
./validate-icon-pixbuf.patch
|
||||||
];
|
];
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
autoreconfHook libxml2 docbook_xml_dtd_412 docbook_xml_dtd_42 docbook_xml_dtd_43 docbook_xsl which gobject-introspection
|
autoreconfHook
|
||||||
gtk-doc intltool libxslt pkgconfig xmlto appstream-glib yacc wrapGAppsHook
|
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 = [
|
buildInputs = [
|
||||||
bubblewrap bzip2 dbus dconf glib gpgme json-glib libarchive libcap libseccomp
|
bubblewrap
|
||||||
libsoup lzma ostree polkit python3 systemd xorg.libXau fuse
|
bzip2
|
||||||
gsettings-desktop-schemas glib-networking
|
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
|
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";
|
NIX_LDFLAGS = "-lpthread";
|
||||||
|
|
||||||
@ -65,8 +160,8 @@ stdenv.mkDerivation rec {
|
|||||||
];
|
];
|
||||||
|
|
||||||
makeFlags = [
|
makeFlags = [
|
||||||
"installed_testdir=$(installedTests)/libexec/installed-tests/flatpak"
|
"installed_testdir=${placeholder "installedTests"}/libexec/installed-tests/flatpak"
|
||||||
"installed_test_metadir=$(installedTests)/share/installed-tests/flatpak"
|
"installed_test_metadir=${placeholder "installedTests"}/share/installed-tests/flatpak"
|
||||||
];
|
];
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
@ -82,7 +177,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "Linux application sandboxing and distribution framework";
|
description = "Linux application sandboxing and distribution framework";
|
||||||
homepage = https://flatpak.org/;
|
homepage = "https://flatpak.org/";
|
||||||
license = licenses.lgpl21;
|
license = licenses.lgpl21;
|
||||||
maintainers = with maintainers; [ jtojnar ];
|
maintainers = with maintainers; [ jtojnar ];
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user