2020-04-24 23:36:52 +00:00
|
|
|
|
{ stdenv
|
|
|
|
|
, fetchurl
|
2020-08-20 17:08:02 +00:00
|
|
|
|
, fetchpatch
|
|
|
|
|
, autoconf
|
|
|
|
|
, automake
|
|
|
|
|
, libtool
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, docbook_xml_dtd_412
|
|
|
|
|
, docbook_xml_dtd_42
|
|
|
|
|
, docbook_xml_dtd_43
|
2020-08-20 17:08:02 +00:00
|
|
|
|
, docbook-xsl-nons
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, which
|
|
|
|
|
, libxml2
|
|
|
|
|
, gobject-introspection
|
|
|
|
|
, gtk-doc
|
|
|
|
|
, intltool
|
|
|
|
|
, libxslt
|
2020-08-20 17:08:02 +00:00
|
|
|
|
, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, xmlto
|
|
|
|
|
, appstream-glib
|
|
|
|
|
, substituteAll
|
|
|
|
|
, yacc
|
|
|
|
|
, xdg-dbus-proxy
|
|
|
|
|
, p11-kit
|
|
|
|
|
, bubblewrap
|
|
|
|
|
, bzip2
|
|
|
|
|
, dbus
|
|
|
|
|
, glib
|
|
|
|
|
, gpgme
|
|
|
|
|
, json-glib
|
|
|
|
|
, libarchive
|
|
|
|
|
, libcap
|
|
|
|
|
, libseccomp
|
|
|
|
|
, coreutils
|
|
|
|
|
, socat
|
|
|
|
|
, gettext
|
|
|
|
|
, hicolor-icon-theme
|
|
|
|
|
, shared-mime-info
|
|
|
|
|
, desktop-file-utils
|
|
|
|
|
, gtk3
|
|
|
|
|
, fuse
|
|
|
|
|
, nixosTests
|
|
|
|
|
, libsoup
|
|
|
|
|
, lzma
|
2020-08-20 17:08:02 +00:00
|
|
|
|
, zstd
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, ostree
|
|
|
|
|
, polkit
|
|
|
|
|
, python3
|
|
|
|
|
, systemd
|
|
|
|
|
, xorg
|
|
|
|
|
, valgrind
|
|
|
|
|
, glib-networking
|
|
|
|
|
, wrapGAppsHook
|
|
|
|
|
, dconf
|
|
|
|
|
, gsettings-desktop-schemas
|
|
|
|
|
, librsvg
|
|
|
|
|
}:
|
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
pname = "flatpak";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
version = "1.8.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
# TODO: split out lib once we figure out what to do with triggerdir
|
2020-08-20 17:08:02 +00:00
|
|
|
|
outputs = [ "out" "dev" "man" "doc" "devdoc" "installedTests" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
|
url = "https://github.com/flatpak/flatpak/releases/download/${version}/${pname}-${version}.tar.xz";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
sha256 = "eSZiXffCKCpe4aizwxevU9QKZjsbxrGKLch0fiZQhbA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
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;
|
2020-08-20 17:08:02 +00:00
|
|
|
|
inherit coreutils gettext socat gtk3;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
smi = shared-mime-info;
|
|
|
|
|
dfu = desktop-file-utils;
|
|
|
|
|
hicolorIconTheme = hicolor-icon-theme;
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
# Hardcode paths used by Flatpak itself.
|
|
|
|
|
(substituteAll {
|
|
|
|
|
src = ./fix-paths.patch;
|
|
|
|
|
p11kit = "${p11-kit.dev}/bin/p11-kit";
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
# Adapt paths exposed to sandbox for NixOS.
|
|
|
|
|
(substituteAll {
|
|
|
|
|
src = ./bubblewrap-paths.patch;
|
|
|
|
|
inherit (builtins) storeDir;
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
# Allow gtk-doc to find schemas using XML_CATALOG_FILES environment variable.
|
|
|
|
|
# Patch taken from gtk-doc expression.
|
|
|
|
|
./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
|
|
|
|
|
|
|
|
|
|
# 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
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
|
|
# Fix `flatpak/test-oci-registry@{user,system}.wrap.test` installed tests.
|
|
|
|
|
# https://github.com/flatpak/flatpak/pull/3762
|
|
|
|
|
(fetchpatch {
|
|
|
|
|
url = "https://github.com/flatpak/flatpak/commit/c1447dadecd50f384b6d11dac18b014245267d00.patch";
|
|
|
|
|
sha256 = "UAA/wGr8/aMbx5MV+8Ilro2kgKkx2QOn88lDUjCgeDA=";
|
|
|
|
|
})
|
2020-04-24 23:36:52 +00:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2020-08-20 17:08:02 +00:00
|
|
|
|
autoconf
|
|
|
|
|
automake
|
|
|
|
|
libtool
|
2020-04-24 23:36:52 +00:00
|
|
|
|
libxml2
|
2020-08-20 17:08:02 +00:00
|
|
|
|
# TODO: replace with docbook_xml_dtd_45 https://github.com/flatpak/flatpak/pull/3760
|
2020-04-24 23:36:52 +00:00
|
|
|
|
docbook_xml_dtd_412
|
|
|
|
|
docbook_xml_dtd_42
|
|
|
|
|
docbook_xml_dtd_43
|
2020-08-20 17:08:02 +00:00
|
|
|
|
docbook-xsl-nons
|
2020-04-24 23:36:52 +00:00
|
|
|
|
which
|
|
|
|
|
gobject-introspection
|
|
|
|
|
gtk-doc
|
|
|
|
|
intltool
|
|
|
|
|
libxslt
|
2020-08-20 17:08:02 +00:00
|
|
|
|
pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
|
xmlto
|
|
|
|
|
appstream-glib
|
|
|
|
|
yacc
|
|
|
|
|
wrapGAppsHook
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
|
bubblewrap
|
|
|
|
|
bzip2
|
|
|
|
|
dbus
|
|
|
|
|
dconf
|
|
|
|
|
gpgme
|
|
|
|
|
json-glib
|
|
|
|
|
libarchive
|
|
|
|
|
libcap
|
|
|
|
|
libseccomp
|
|
|
|
|
libsoup
|
|
|
|
|
lzma
|
2020-08-20 17:08:02 +00:00
|
|
|
|
# zstd # TODO: broken paths in .pc file
|
2020-04-24 23:36:52 +00:00
|
|
|
|
polkit
|
|
|
|
|
python3
|
|
|
|
|
systemd
|
|
|
|
|
xorg.libXau
|
|
|
|
|
fuse
|
|
|
|
|
gsettings-desktop-schemas
|
|
|
|
|
glib-networking
|
|
|
|
|
librsvg # for flatpak-validate-icon
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
# Required by flatpak.pc
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
|
glib
|
|
|
|
|
ostree
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
|
valgrind
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
# TODO: some issues with temporary files
|
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
|
|
NIX_LDFLAGS = "-lpthread";
|
|
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
|
"--with-system-bubblewrap=${bubblewrap}/bin/bwrap"
|
|
|
|
|
"--with-system-dbus-proxy=${xdg-dbus-proxy}/bin/xdg-dbus-proxy"
|
|
|
|
|
"--with-dbus-config-dir=${placeholder "out"}/share/dbus-1/system.d"
|
|
|
|
|
"--localstatedir=/var"
|
2020-08-20 17:08:02 +00:00
|
|
|
|
"--enable-gtk-doc"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
"--enable-installed-tests"
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
|
"installed_testdir=${placeholder "installedTests"}/libexec/installed-tests/flatpak"
|
|
|
|
|
"installed_test_metadir=${placeholder "installedTests"}/share/installed-tests/flatpak"
|
|
|
|
|
];
|
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
|
postPatch = let
|
|
|
|
|
vsc-py = python3.withPackages (pp: [
|
|
|
|
|
pp.pyparsing
|
|
|
|
|
]);
|
|
|
|
|
in ''
|
2020-04-24 23:36:52 +00:00
|
|
|
|
patchShebangs buildutil
|
|
|
|
|
patchShebangs tests
|
2020-08-20 17:08:02 +00:00
|
|
|
|
PATH=${stdenv.lib.makeBinPath [vsc-py]}:$PATH patchShebangs --build variant-schema-compiler/variant-schema-compiler
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
|
# TODO: remove the condition once autogen.sh is shipped in the tarball
|
|
|
|
|
# https://github.com/flatpak/flatpak/pull/3761
|
|
|
|
|
if [[ -f autogen.sh ]]; then
|
|
|
|
|
NOCONFIGURE=1 ./autogen.sh
|
|
|
|
|
else
|
|
|
|
|
autoreconf --install --force --verbose
|
|
|
|
|
fi
|
2020-04-24 23:36:52 +00:00
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
|
tests = {
|
|
|
|
|
installedTests = nixosTests.installed-tests.flatpak;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
|
description = "Linux application sandboxing and distribution framework";
|
|
|
|
|
homepage = "https://flatpak.org/";
|
|
|
|
|
license = licenses.lgpl21;
|
|
|
|
|
maintainers = with maintainers; [ jtojnar ];
|
|
|
|
|
platforms = platforms.linux;
|
|
|
|
|
};
|
|
|
|
|
}
|