1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-26 15:41:40 +00:00

flatpak: init at 0.11.7

This commit is contained in:
Jan Tojnar 2017-10-02 15:40:26 +02:00
parent 6db7f92cc2
commit 215dcb7285
No known key found for this signature in database
GPG key ID: 7FAB2A15F7A607A4
4 changed files with 135 additions and 0 deletions

View file

@ -0,0 +1,74 @@
{ stdenv, fetchurl, autoreconfHook, docbook_xml_dtd_412, docbook_xml_dtd_42, docbook_xml_dtd_43, docbook_xsl, which, libxml2
, 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, xlibs, valgrind, glib_networking, makeWrapper, gnome3 }:
let
version = "0.11.7";
desktop_schemas = gnome3.gsettings_desktop_schemas;
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";
sha256 = "1vq4j7v68lp4fsvpas1bcsx1z4snpj0mkbq2mi00kx3jb48z768h";
};
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
];
nativeBuildInputs = [
autoreconfHook libxml2 docbook_xml_dtd_412 docbook_xml_dtd_42 docbook_xml_dtd_43 docbook_xsl which gobjectIntrospection
gtk_doc intltool libxslt pkgconfig xmlto appstream-glib yacc makeWrapper
] ++ stdenv.lib.optionals doCheck checkInputs;
buildInputs = [
bubblewrap bzip2 dbus glib gpgme json_glib libarchive libcap libseccomp
libsoup lzma ostree polkit python3 systemd xlibs.libXau
];
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 \
--prefix GIO_EXTRA_MODULES : "${glib_networking.out}/lib/gio/modules" \
--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;
};
}

View file

@ -0,0 +1,46 @@
--- a/tests/libtest.sh
+++ b/tests/libtest.sh
@@ -322,7 +322,7 @@
# running installed-tests: assume we know what we're doing
:
elif ! "$FLATPAK_BWRAP" --unshare-ipc --unshare-net --unshare-pid \
- --ro-bind / / /bin/true > bwrap-result 2>&1; then
+ --ro-bind / / @coreutils@/bin/true > bwrap-result 2>&1; then
sed -e 's/^/# /' < bwrap-result
echo "1..0 # SKIP Cannot run bwrap"
exit 0
@@ -330,7 +330,7 @@
}
skip_without_python2 () {
- if ! test -f /usr/bin/python2 || ! /usr/bin/python2 -c "import sys; sys.exit(0 if sys.version_info >= (2, 7) else 1)" ; then
+ if ! test -f @python2@/bin/python2 || ! @python2@/bin/python2 -c "import sys; sys.exit(0 if sys.version_info >= (2, 7) else 1)" ; then
echo "1..0 # SKIP this test requires /usr/bin/python2 (2.7) support"
exit 0
fi
@@ -350,12 +350,12 @@
export DBUS_SESSION_BUS_ADDRESS="$(cat dbus-session-bus-address)"
DBUS_SESSION_BUS_PID="$(cat dbus-session-bus-pid)"
-if ! /bin/kill -0 "$DBUS_SESSION_BUS_PID"; then
+if ! @coreutils@/bin/kill -0 "$DBUS_SESSION_BUS_PID"; then
assert_not_reached "Failed to start dbus-daemon"
fi
cleanup () {
- /bin/kill $DBUS_SESSION_BUS_PID ${FLATPAK_HTTP_PID:-}
+ @coreutils@/bin/kill $DBUS_SESSION_BUS_PID ${FLATPAK_HTTP_PID:-}
gpg-connect-agent --homedir "${FL_GPG_HOMEDIR}" killagent /bye || true
fusermount -u $XDG_RUNTIME_DIR/doc || :
if test -n "${TEST_SKIP_CLEANUP:-}"; then
--- a/tests/testlibrary.c
+++ b/tests/testlibrary.c
@@ -378,7 +378,7 @@
{
gint exit_code = 0;
char *argv[] = { (char *)bwrap, "--unshare-ipc", "--unshare-net",
- "--unshare-pid", "--ro-bind", "/", "/", "/bin/true", NULL };
+ "--unshare-pid", "--ro-bind", "/", "/", "@coreutils@/bin/true", NULL };
g_autofree char *argv_str = g_strjoinv (" ", argv);
g_test_message ("Spawning %s", argv_str);
g_spawn_sync (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL, &exit_code, &error);

View file

@ -0,0 +1,13 @@
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -40,8 +40,8 @@
[
AC_REQUIRE([JH_PATH_XML_CATALOG],[JH_PATH_XML_CATALOG(,[:])])dnl
AC_MSG_CHECKING([for ifelse([$2],,[$1],[$2]) in XML catalog])
- if $jh_found_xmlcatalog && \
- AC_RUN_LOG([$XMLCATALOG --noout "$XML_CATALOG_FILE" "$1" >&2]); then
+ # empty argument forces libxml to use XML_CATALOG_FILES variable
+ if AC_RUN_LOG([$XMLCATALOG --noout "" "$1" >&2]); then
AC_MSG_RESULT([found])
ifelse([$3],,,[$3
])dnl

View file

@ -2297,6 +2297,8 @@ with pkgs;
flashbench = callPackage ../os-specific/linux/flashbench { };
flatpak = callPackage ../development/libraries/flatpak { };
figlet = callPackage ../tools/misc/figlet { };
file = callPackage ../tools/misc/file { };