2020-02-07 21:55:16 +00:00
|
|
|
|
{ stdenv
|
|
|
|
|
, fetchurl
|
2020-03-31 01:54:31 +01:00
|
|
|
|
, autoreconfHook
|
2020-02-07 21:55:16 +00:00
|
|
|
|
, 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
|
2020-02-08 05:28:43 +00:00
|
|
|
|
, socat
|
2020-02-07 21:55:16 +00:00
|
|
|
|
, gettext
|
|
|
|
|
, hicolor-icon-theme
|
2020-02-08 05:28:43 +00:00
|
|
|
|
, shared-mime-info
|
|
|
|
|
, desktop-file-utils
|
|
|
|
|
, gtk3
|
2020-02-07 21:55:16 +00:00
|
|
|
|
, fuse
|
|
|
|
|
, nixosTests
|
|
|
|
|
, libsoup
|
|
|
|
|
, lzma
|
|
|
|
|
, ostree
|
|
|
|
|
, polkit
|
|
|
|
|
, python3
|
|
|
|
|
, systemd
|
|
|
|
|
, xorg
|
|
|
|
|
, valgrind
|
|
|
|
|
, glib-networking
|
|
|
|
|
, wrapGAppsHook
|
|
|
|
|
, dconf
|
|
|
|
|
, gsettings-desktop-schemas
|
|
|
|
|
, librsvg
|
|
|
|
|
}:
|
2017-10-02 14:40:26 +01:00
|
|
|
|
|
2018-11-16 17:00:58 +00:00
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
pname = "flatpak";
|
2020-03-30 15:36:30 +01:00
|
|
|
|
version = "1.6.3";
|
2017-10-02 14:40:26 +01:00
|
|
|
|
|
2018-09-06 10:38:09 +01:00
|
|
|
|
# TODO: split out lib once we figure out what to do with triggerdir
|
2020-02-18 00:14:10 +00:00
|
|
|
|
outputs = [ "out" "dev" "man" "doc" "installedTests" ];
|
2017-10-02 14:40:26 +01:00
|
|
|
|
|
|
|
|
|
src = fetchurl {
|
2018-11-16 17:00:58 +00:00
|
|
|
|
url = "https://github.com/flatpak/flatpak/releases/download/${version}/${pname}-${version}.tar.xz";
|
2020-03-30 15:36:30 +01:00
|
|
|
|
sha256 = "17s8nqdxd4xdy7ag9bw06adxccha78jmlsa3zpqnl3qh92pg0hji";
|
2017-10-02 14:40:26 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
patches = [
|
2020-02-07 21:55:16 +00:00
|
|
|
|
# Hardcode paths used by tests and change test runtime generation to use files from Nix store.
|
|
|
|
|
# https://github.com/flatpak/flatpak/issues/1460
|
2017-10-02 14:40:26 +01:00
|
|
|
|
(substituteAll {
|
|
|
|
|
src = ./fix-test-paths.patch;
|
2020-02-08 05:28:43 +00:00
|
|
|
|
inherit coreutils gettext glibcLocales socat gtk3;
|
|
|
|
|
smi = shared-mime-info;
|
|
|
|
|
dfu = desktop-file-utils;
|
2017-10-02 14:40:26 +01:00
|
|
|
|
hicolorIconTheme = hicolor-icon-theme;
|
|
|
|
|
})
|
2020-02-07 21:55:16 +00:00
|
|
|
|
|
|
|
|
|
# Hardcode paths used by Flatpak itself.
|
2018-09-06 10:38:09 +01:00
|
|
|
|
(substituteAll {
|
|
|
|
|
src = ./fix-paths.patch;
|
2020-02-18 16:48:24 +00:00
|
|
|
|
p11kit = "${p11-kit.dev}/bin/p11-kit";
|
2018-09-06 10:38:09 +01:00
|
|
|
|
})
|
2020-02-07 21:55:16 +00:00
|
|
|
|
|
|
|
|
|
# Adapt paths exposed to sandbox for NixOS.
|
2019-03-19 04:57:43 +00:00
|
|
|
|
(substituteAll {
|
|
|
|
|
src = ./bubblewrap-paths.patch;
|
|
|
|
|
inherit (builtins) storeDir;
|
|
|
|
|
})
|
2020-02-07 21:55:16 +00:00
|
|
|
|
|
|
|
|
|
# Allow gtk-doc to find schemas using XML_CATALOG_FILES environment variable.
|
|
|
|
|
# Patch taken from gtk-doc expression.
|
2017-10-02 14:40:26 +01:00
|
|
|
|
./respect-xml-catalog-files-var.patch
|
2020-02-07 21:55:16 +00:00
|
|
|
|
|
|
|
|
|
# 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
|
2018-07-19 09:52:59 +01:00
|
|
|
|
./use-flatpak-from-path.patch
|
2020-02-07 21:55:16 +00:00
|
|
|
|
|
|
|
|
|
# Nix environment hacks should not leak into the apps.
|
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/53441
|
2019-04-16 03:47:23 +01:00
|
|
|
|
./unset-env-vars.patch
|
2020-02-07 21:55:16 +00:00
|
|
|
|
|
|
|
|
|
# But we want the GDK_PIXBUF_MODULE_FILE from the wrapper affect the icon validator.
|
2019-06-14 12:56:06 +01:00
|
|
|
|
./validate-icon-pixbuf.patch
|
2017-10-02 14:40:26 +01:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2020-03-31 01:54:31 +01:00
|
|
|
|
autoreconfHook
|
2020-02-07 21:55:16 +00:00
|
|
|
|
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
|
2018-09-06 10:38:09 +01:00
|
|
|
|
];
|
2017-10-02 14:40:26 +01:00
|
|
|
|
|
|
|
|
|
buildInputs = [
|
2020-02-07 21:55:16 +00:00
|
|
|
|
bubblewrap
|
|
|
|
|
bzip2
|
|
|
|
|
dbus
|
|
|
|
|
dconf
|
|
|
|
|
gpgme
|
|
|
|
|
json-glib
|
|
|
|
|
libarchive
|
|
|
|
|
libcap
|
|
|
|
|
libseccomp
|
|
|
|
|
libsoup
|
|
|
|
|
lzma
|
|
|
|
|
polkit
|
|
|
|
|
python3
|
|
|
|
|
systemd
|
|
|
|
|
xorg.libXau
|
|
|
|
|
fuse
|
|
|
|
|
gsettings-desktop-schemas
|
|
|
|
|
glib-networking
|
2019-06-15 06:15:01 +01:00
|
|
|
|
librsvg # for flatpak-validate-icon
|
2017-10-02 14:40:26 +01:00
|
|
|
|
];
|
|
|
|
|
|
2020-02-17 23:32:35 +00:00
|
|
|
|
# Required by flatpak.pc
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
|
glib
|
|
|
|
|
ostree
|
|
|
|
|
];
|
|
|
|
|
|
2020-02-07 21:55:16 +00:00
|
|
|
|
checkInputs = [
|
|
|
|
|
valgrind
|
|
|
|
|
];
|
2017-10-02 14:40:26 +01:00
|
|
|
|
|
2020-02-07 21:55:16 +00:00
|
|
|
|
# TODO: some issues with temporary files
|
|
|
|
|
doCheck = false;
|
2017-10-02 14:40:26 +01:00
|
|
|
|
|
2019-10-30 01:29:30 +00:00
|
|
|
|
NIX_LDFLAGS = "-lpthread";
|
2019-01-04 19:33:50 +00:00
|
|
|
|
|
2017-10-02 14:40:26 +01:00
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
|
"--with-system-bubblewrap=${bubblewrap}/bin/bwrap"
|
2018-09-06 10:38:09 +01:00
|
|
|
|
"--with-system-dbus-proxy=${xdg-dbus-proxy}/bin/xdg-dbus-proxy"
|
2019-10-13 13:03:25 +01:00
|
|
|
|
"--with-dbus-config-dir=${placeholder "out"}/share/dbus-1/system.d"
|
2017-10-02 14:40:26 +01:00
|
|
|
|
"--localstatedir=/var"
|
|
|
|
|
"--enable-installed-tests"
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
makeFlags = [
|
2020-02-07 21:55:16 +00:00
|
|
|
|
"installed_testdir=${placeholder "installedTests"}/libexec/installed-tests/flatpak"
|
|
|
|
|
"installed_test_metadir=${placeholder "installedTests"}/share/installed-tests/flatpak"
|
2017-10-02 14:40:26 +01:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
|
patchShebangs buildutil
|
|
|
|
|
patchShebangs tests
|
|
|
|
|
'';
|
|
|
|
|
|
2019-11-07 13:38:31 +00:00
|
|
|
|
passthru = {
|
|
|
|
|
tests = {
|
|
|
|
|
installedTests = nixosTests.installed-tests.flatpak;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2017-10-02 14:40:26 +01:00
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
|
description = "Linux application sandboxing and distribution framework";
|
2020-02-07 21:55:16 +00:00
|
|
|
|
homepage = "https://flatpak.org/";
|
2017-10-02 14:40:26 +01:00
|
|
|
|
license = licenses.lgpl21;
|
|
|
|
|
maintainers = with maintainers; [ jtojnar ];
|
|
|
|
|
platforms = platforms.linux;
|
|
|
|
|
};
|
|
|
|
|
}
|