2017-10-02 14:40:26 +01:00
|
|
|
{ stdenv, fetchurl, autoreconfHook, docbook_xml_dtd_412, docbook_xml_dtd_42, docbook_xml_dtd_43, docbook_xsl, which, libxml2
|
2018-07-17 21:11:16 +01:00
|
|
|
, gobjectIntrospection, gtk-doc, intltool, libxslt, pkgconfig, xmlto, appstream-glib, substituteAll, glibcLocales, yacc
|
|
|
|
, bubblewrap, bzip2, dbus, glib, gpgme, json-glib, libarchive, libcap, libseccomp, coreutils, python2, hicolor-icon-theme
|
|
|
|
, libsoup, lzma, ostree, polkit, python3, systemd, xorg, valgrind, glib-networking, makeWrapper, gnome3 }:
|
2017-10-02 14:40:26 +01:00
|
|
|
|
|
|
|
let
|
2018-07-15 18:12:14 +01:00
|
|
|
version = "0.99.3";
|
2018-07-22 03:03:24 +01:00
|
|
|
desktop_schemas = gnome3.gsettings-desktop-schemas;
|
2017-10-02 14:40:26 +01:00
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
name = "flatpak-${version}";
|
|
|
|
|
|
|
|
outputs = [ "out" "man" "doc" "installedTests" ];
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/flatpak/flatpak/releases/download/${version}/${name}.tar.xz";
|
2018-07-15 18:12:14 +01:00
|
|
|
sha256 = "0wd6ix1qyz8wmjkfrmr6j99gwywqs7ak1ilsn1ljp72g2z449ayk";
|
2017-10-02 14:40:26 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./fix-test-paths.patch;
|
|
|
|
inherit coreutils python2 glibcLocales;
|
|
|
|
hicolorIconTheme = hicolor-icon-theme;
|
|
|
|
})
|
|
|
|
# patch taken from gtk_doc
|
|
|
|
./respect-xml-catalog-files-var.patch
|
2018-07-19 09:52:59 +01:00
|
|
|
./use-flatpak-from-path.patch
|
2017-10-02 14:40:26 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook libxml2 docbook_xml_dtd_412 docbook_xml_dtd_42 docbook_xml_dtd_43 docbook_xsl which gobjectIntrospection
|
2018-07-17 21:11:16 +01:00
|
|
|
gtk-doc intltool libxslt pkgconfig xmlto appstream-glib yacc makeWrapper
|
2017-10-02 14:40:26 +01:00
|
|
|
] ++ stdenv.lib.optionals doCheck checkInputs;
|
|
|
|
|
|
|
|
buildInputs = [
|
2018-07-17 21:11:16 +01:00
|
|
|
bubblewrap bzip2 dbus glib gpgme json-glib libarchive libcap libseccomp
|
|
|
|
libsoup lzma ostree polkit python3 systemd xorg.libXau
|
2017-10-02 14:40:26 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [ valgrind ];
|
|
|
|
|
|
|
|
doCheck = false; # TODO: some issues with temporary files
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--with-system-bubblewrap=${bubblewrap}/bin/bwrap"
|
|
|
|
"--localstatedir=/var"
|
|
|
|
"--enable-installed-tests"
|
|
|
|
];
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"installed_testdir=$(installedTests)/libexec/installed-tests/flatpak"
|
|
|
|
"installed_test_metadir=$(installedTests)/share/installed-tests/flatpak"
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs buildutil
|
|
|
|
patchShebangs tests
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
wrapProgram $out/bin/flatpak \
|
2018-07-17 21:11:16 +01:00
|
|
|
--prefix GIO_EXTRA_MODULES : "${glib-networking.out}/lib/gio/modules" \
|
2017-10-02 14:40:26 +01:00
|
|
|
--prefix XDG_DATA_DIRS : "${desktop_schemas}/share/gsettings-schemas/${desktop_schemas.name}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|