flatpak: 1.12.7 → 1.14.0

https://github.com/flatpak/flatpak/compare/1.12.7...1.14.0

Co-Authored-By: Jan Tojnar <jtojnar@gmail.com>
This commit is contained in:
Bobby Rong 2022-09-21 12:28:25 +08:00 committed by Jan Tojnar
parent 9121a522fd
commit d80a32db1e
3 changed files with 68 additions and 53 deletions

View file

@ -11,14 +11,15 @@
, libxslt , libxslt
, pkg-config , pkg-config
, xmlto , xmlto
, appstream-glib
, substituteAll , substituteAll
, runCommand , runCommand
, bison , bison
, xdg-dbus-proxy , xdg-dbus-proxy
, p11-kit , p11-kit
, appstream
, bubblewrap , bubblewrap
, bzip2 , bzip2
, curl
, dbus , dbus
, glib , glib
, gpgme , gpgme
@ -33,9 +34,8 @@
, shared-mime-info , shared-mime-info
, desktop-file-utils , desktop-file-utils
, gtk3 , gtk3
, fuse , fuse3
, nixosTests , nixosTests
, libsoup
, xz , xz
, zstd , zstd
, ostree , ostree
@ -54,14 +54,14 @@
stdenv.mkDerivation (finalAttrs: { stdenv.mkDerivation (finalAttrs: {
pname = "flatpak"; pname = "flatpak";
version = "1.12.7"; version = "1.14.0";
# TODO: split out lib once we figure out what to do with triggerdir # TODO: split out lib once we figure out what to do with triggerdir
outputs = [ "out" "dev" "man" "doc" "devdoc" "installedTests" ]; outputs = [ "out" "dev" "man" "doc" "devdoc" "installedTests" ];
src = fetchurl { src = fetchurl {
url = "https://github.com/flatpak/flatpak/releases/download/${finalAttrs.version}/flatpak-${finalAttrs.version}.tar.xz"; url = "https://github.com/flatpak/flatpak/releases/download/${finalAttrs.version}/flatpak-${finalAttrs.version}.tar.xz";
sha256 = "sha256-bbUqUxzieCgqx+v7mfZqC7PsyvROhkhEwslcHuW6kxY="; # Taken from https://github.com/flatpak/flatpak/releases/ sha256 = "sha256-jidpc3cOok3fJZetSuzTa5g5PmvekeSOF0OqymfyeBU="; # Taken from https://github.com/flatpak/flatpak/releases/
}; };
patches = [ patches = [
@ -89,6 +89,10 @@ stdenv.mkDerivation (finalAttrs: {
# https://github.com/NixOS/nixpkgs/issues/53441 # https://github.com/NixOS/nixpkgs/issues/53441
./unset-env-vars.patch ./unset-env-vars.patch
# Do not clear XDG_DATA_DIRS in fish shell
# https://github.com/flatpak/flatpak/pull/5123
./no-breaking-fish.patch
# The icon validator needs to access the gdk-pixbuf loaders in the Nix store # The icon validator needs to access the gdk-pixbuf loaders in the Nix store
# and cannot bind FHS paths since those are not available on NixOS. # and cannot bind FHS paths since those are not available on NixOS.
finalAttrs.passthru.icon-validator-patch finalAttrs.passthru.icon-validator-patch
@ -106,14 +110,15 @@ stdenv.mkDerivation (finalAttrs: {
libxslt libxslt
pkg-config pkg-config
xmlto xmlto
appstream-glib
bison bison
wrapGAppsNoGuiHook wrapGAppsNoGuiHook
]; ];
buildInputs = [ buildInputs = [
appstream
bubblewrap bubblewrap
bzip2 bzip2
curl
dbus dbus
dconf dconf
gpgme gpgme
@ -121,14 +126,13 @@ stdenv.mkDerivation (finalAttrs: {
libarchive libarchive
libcap libcap
libseccomp libseccomp
libsoup
xz xz
zstd zstd
polkit polkit
python3 python3
systemd systemd
xorg.libXau xorg.libXau
fuse fuse3
gsettings-desktop-schemas gsettings-desktop-schemas
glib-networking glib-networking
librsvg # for flatpak-validate-icon librsvg # for flatpak-validate-icon
@ -152,6 +156,7 @@ stdenv.mkDerivation (finalAttrs: {
enableParallelBuilding = true; enableParallelBuilding = true;
configureFlags = [ configureFlags = [
"--with-curl"
"--with-system-bubblewrap=${bubblewrap}/bin/bwrap" "--with-system-bubblewrap=${bubblewrap}/bin/bwrap"
"--with-system-dbus-proxy=${xdg-dbus-proxy}/bin/xdg-dbus-proxy" "--with-system-dbus-proxy=${xdg-dbus-proxy}/bin/xdg-dbus-proxy"
"--with-dbus-config-dir=${placeholder "out"}/share/dbus-1/system.d" "--with-dbus-config-dir=${placeholder "out"}/share/dbus-1/system.d"

View file

@ -1,8 +1,8 @@
diff --git a/app/flatpak-builtins-build-export.c b/app/flatpak-builtins-build-export.c diff --git a/app/flatpak-builtins-build-export.c b/app/flatpak-builtins-build-export.c
index 43fd0563..4067bd36 100644 index 3f5d8a1f..79493e61 100644
--- a/app/flatpak-builtins-build-export.c --- a/app/flatpak-builtins-build-export.c
+++ b/app/flatpak-builtins-build-export.c +++ b/app/flatpak-builtins-build-export.c
@@ -458,7 +458,7 @@ validate_desktop_file (GFile *desktop_file, @@ -464,7 +464,7 @@ validate_desktop_file (GFile *desktop_file,
subprocess = g_subprocess_new (G_SUBPROCESS_FLAGS_STDOUT_PIPE | subprocess = g_subprocess_new (G_SUBPROCESS_FLAGS_STDOUT_PIPE |
G_SUBPROCESS_FLAGS_STDERR_PIPE | G_SUBPROCESS_FLAGS_STDERR_PIPE |
G_SUBPROCESS_FLAGS_STDERR_MERGE, G_SUBPROCESS_FLAGS_STDERR_MERGE,
@ -12,10 +12,10 @@ index 43fd0563..4067bd36 100644
{ {
if (!g_error_matches (local_error, G_SPAWN_ERROR, G_SPAWN_ERROR_NOENT)) if (!g_error_matches (local_error, G_SPAWN_ERROR, G_SPAWN_ERROR_NOENT))
diff --git a/tests/libtest.sh b/tests/libtest.sh diff --git a/tests/libtest.sh b/tests/libtest.sh
index acb2095b..b361da16 100644 index 36d39ac4..3ad2c7a6 100644
--- a/tests/libtest.sh --- a/tests/libtest.sh
+++ b/tests/libtest.sh +++ b/tests/libtest.sh
@@ -431,7 +431,7 @@ if [ -z "${FLATPAK_BWRAP:-}" ]; then @@ -511,7 +511,7 @@ if [ -z "${FLATPAK_BWRAP:-}" ]; then
# running installed-tests: assume we know what we're doing # running installed-tests: assume we know what we're doing
_flatpak_bwrap_works=true _flatpak_bwrap_works=true
elif ! "$FLATPAK_BWRAP" --unshare-ipc --unshare-net --unshare-pid \ elif ! "$FLATPAK_BWRAP" --unshare-ipc --unshare-net --unshare-pid \
@ -24,7 +24,7 @@ index acb2095b..b361da16 100644
_flatpak_bwrap_works=false _flatpak_bwrap_works=false
else else
_flatpak_bwrap_works=true _flatpak_bwrap_works=true
@@ -504,7 +504,7 @@ dbus-daemon --fork --config-file=session.conf --print-address=3 --print-pid=4 \ @@ -591,7 +591,7 @@ dbus-daemon --fork --config-file=session.conf --print-address=3 --print-pid=4 \
export DBUS_SESSION_BUS_ADDRESS="$(cat dbus-session-bus-address)" export DBUS_SESSION_BUS_ADDRESS="$(cat dbus-session-bus-address)"
DBUS_SESSION_BUS_PID="$(cat dbus-session-bus-pid)" DBUS_SESSION_BUS_PID="$(cat dbus-session-bus-pid)"
@ -33,20 +33,20 @@ index acb2095b..b361da16 100644
assert_not_reached "Failed to start dbus-daemon" assert_not_reached "Failed to start dbus-daemon"
fi fi
@@ -519,7 +519,7 @@ commit_to_path () { @@ -606,7 +606,7 @@ commit_to_path () {
} }
cleanup () { cleanup () {
- /bin/kill -9 $DBUS_SESSION_BUS_PID - /bin/kill -9 $DBUS_SESSION_BUS_PID
+ @coreutils@/bin/kill -9 $DBUS_SESSION_BUS_PID + @coreutils@/bin/kill -9 $DBUS_SESSION_BUS_PID
gpg-connect-agent --homedir "${FL_GPG_HOMEDIR}" killagent /bye || true gpg-connect-agent --homedir "${FL_GPG_HOMEDIR}" killagent /bye >&2 || true
fusermount -u $XDG_RUNTIME_DIR/doc || : fusermount -u $XDG_RUNTIME_DIR/doc >&2 || :
kill $(jobs -p) &> /dev/null || true kill $(jobs -p) &> /dev/null || true
diff --git a/tests/make-test-app.sh b/tests/make-test-app.sh diff --git a/tests/make-test-app.sh b/tests/make-test-app.sh
index 612f914f..4b890da2 100755 index afa11a6b..5b12055f 100755
--- a/tests/make-test-app.sh --- a/tests/make-test-app.sh
+++ b/tests/make-test-app.sh +++ b/tests/make-test-app.sh
@@ -151,13 +151,13 @@ msgid "Hello world" @@ -190,13 +190,13 @@ msgid "Hello world"
msgstr "Hallo Welt" msgstr "Hallo Welt"
EOF EOF
mkdir -p ${DIR}/files/de/share/de/LC_MESSAGES mkdir -p ${DIR}/files/de/share/de/LC_MESSAGES
@ -60,10 +60,10 @@ index 612f914f..4b890da2 100755
-msgfmt --output-file ${DIR}/files/fr/share/fr/LC_MESSAGES/helloworld.mo fr.po -msgfmt --output-file ${DIR}/files/fr/share/fr/LC_MESSAGES/helloworld.mo fr.po
+@gettext@/bin/msgfmt --output-file ${DIR}/files/fr/share/fr/LC_MESSAGES/helloworld.mo fr.po +@gettext@/bin/msgfmt --output-file ${DIR}/files/fr/share/fr/LC_MESSAGES/helloworld.mo fr.po
flatpak build-finish ${DIR} flatpak build-finish ${DIR} >&2
mkdir -p repos mkdir -p repos
diff --git a/tests/make-test-runtime.sh b/tests/make-test-runtime.sh diff --git a/tests/make-test-runtime.sh b/tests/make-test-runtime.sh
index af289625..7db51c17 100755 index 4ba950df..fd50fab3 100755
--- a/tests/make-test-runtime.sh --- a/tests/make-test-runtime.sh
+++ b/tests/make-test-runtime.sh +++ b/tests/make-test-runtime.sh
@@ -28,9 +28,10 @@ EOF @@ -28,9 +28,10 @@ EOF
@ -80,7 +80,7 @@ index af289625..7db51c17 100755
ln -s ../lib ${DIR}/usr/lib64 ln -s ../lib ${DIR}/usr/lib64
@@ -40,40 +41,17 @@ if test -f /sbin/ldconfig.real; then @@ -40,40 +41,17 @@ if test -f /sbin/ldconfig.real; then
else else
cp `which ldconfig` ${DIR}/usr/bin cp "$(type -P ldconfig)" "${DIR}/usr/bin"
fi fi
-LIBS=`mktemp` -LIBS=`mktemp`
-BINS=`mktemp` -BINS=`mktemp`
@ -106,8 +106,8 @@ index af289625..7db51c17 100755
-} -}
- -
for i in $@ bash ls cat echo readlink socat; do for i in $@ bash ls cat echo readlink socat; do
- I=`which $i` - I=$(type -P "$i")
- add_bin $I - add_bin "$I"
-done -done
-for i in `cat $BINS`; do -for i in `cat $BINS`; do
- #echo Adding binary $i 1>&2 - #echo Adding binary $i 1>&2
@ -116,16 +116,16 @@ index af289625..7db51c17 100755
-for i in `cat $LIBS`; do -for i in `cat $LIBS`; do
- #echo Adding library $i 1>&2 - #echo Adding library $i 1>&2
- cp "$i" ${DIR}/usr/lib/ - cp "$i" ${DIR}/usr/lib/
+ I=$(readlink -f $(which $i)) + I=$(readlink -f "$(type -P "$i")")
+ [ -e ${DIR}/usr/bin/$i ] && continue + [ -e "${DIR}/usr/bin/$i" ] && continue
+ requisites=$(nix-store --query --requisites "$I") + requisites=$(nix-store --query --requisites "$I")
+ for r in $requisites; do + for r in $requisites; do
+ # a single store item can be needed by multiple paths, no need to copy it again + # a single store item can be needed by multiple paths, no need to copy it again
+ if [ ! -e ${DIR}/$r ]; then + if [ ! -e "${DIR}/$r" ]; then
+ cp -r $r ${DIR}/$r + cp -r "$r" "${DIR}/$r"
+ fi + fi
+ done + done
+ ln -s $I ${DIR}/usr/bin/$i + ln -s "$I" "${DIR}/usr/bin/$i"
done done
ln -s bash ${DIR}/usr/bin/sh ln -s bash ${DIR}/usr/bin/sh
@ -141,18 +141,18 @@ index af289625..7db51c17 100755
+# We do not copy C.UTF8 locale because it is in locale archive and +# We do not copy C.UTF8 locale because it is in locale archive and
+# that is already copied with glibc. +# that is already copied with glibc.
+ +
+mv ${DIR}/nix/store ${DIR}/usr/store # files outside /usr are not permitted, we will have to replace /nix/store with /usr/store +mv "${DIR}/nix/store" "${DIR}/usr/store" # files outside /usr are not permitted, we will have to replace /nix/store with /usr/store
+chmod -R u+w ${DIR} # nix store has read-only directories which would cause problems during clean-up, files need to be writable for sed +chmod -R u+w "${DIR}" # nix store has read-only directories which would cause problems during clean-up, files need to be writable for sed
+find ${DIR} -type f -print0 | xargs -0 sed -i 's~/nix/store/~/usr/store/~g' # replace hardcoded paths +find "${DIR}" -type f -print0 | xargs -0 sed -i 's~/nix/store/~/usr/store/~g' # replace hardcoded paths
+find ${DIR} -type l | xargs -I '{}' sh -c 'tg="$(readlink "$1")"; newtg="${tg#/nix/store/}"; if [ "$tg" != "$newtg" ]; then ln -fs "/usr/store/$newtg" "$1"; fi' -- '{}' # replace symlink targets +find "${DIR}" -type l | xargs -I '{}' sh -c 'tg="$(readlink "$1")"; newtg="${tg#/nix/store/}"; if [ "$tg" != "$newtg" ]; then ln -fs "/usr/store/$newtg" "$1"; fi' -- '{}' # replace symlink targets
if [ x$COLLECTION_ID != x ]; then if [ x$COLLECTION_ID != x ]; then
collection_args=--collection-id=${COLLECTION_ID} collection_args=--collection-id=${COLLECTION_ID}
diff --git a/tests/testlibrary.c b/tests/testlibrary.c diff --git a/tests/testlibrary.c b/tests/testlibrary.c
index 509ce6cc..6a333c9c 100644 index 831d85c1..ae4f03d0 100644
--- a/tests/testlibrary.c --- a/tests/testlibrary.c
+++ b/tests/testlibrary.c +++ b/tests/testlibrary.c
@@ -1399,7 +1399,7 @@ check_bwrap_support (void) @@ -1601,7 +1601,7 @@ check_bwrap_support (void)
{ {
gint exit_code = 0; gint exit_code = 0;
char *argv[] = { (char *) bwrap, "--unshare-ipc", "--unshare-net", char *argv[] = { (char *) bwrap, "--unshare-ipc", "--unshare-net",
@ -162,44 +162,43 @@ index 509ce6cc..6a333c9c 100644
g_test_message ("Spawning %s", argv_str); g_test_message ("Spawning %s", argv_str);
g_spawn_sync (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL, &exit_code, &error); g_spawn_sync (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL, &exit_code, &error);
diff --git a/triggers/desktop-database.trigger b/triggers/desktop-database.trigger diff --git a/triggers/desktop-database.trigger b/triggers/desktop-database.trigger
index 2188f535..d8283061 100755 index 1037466d..c4c7ed6d 100755
--- a/triggers/desktop-database.trigger --- a/triggers/desktop-database.trigger
+++ b/triggers/desktop-database.trigger +++ b/triggers/desktop-database.trigger
@@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
-if test \( -x "$(which update-desktop-database 2>/dev/null)" \) -a \( -d $1/exports/share/applications \); then -if command -v update-desktop-database >/dev/null && test -d "$1/exports/share/applications"; then
- exec update-desktop-database -q $1/exports/share/applications - exec update-desktop-database -q "$1/exports/share/applications"
+if test \( -d $1/exports/share/applications \); then +if test -d "$1/exports/share/applications"; then
+ exec @dfu@/bin/update-desktop-database -q $1/exports/share/applications + exec @dfu@/bin/update-desktop-database -q "$1/exports/share/applications"
fi fi
diff --git a/triggers/gtk-icon-cache.trigger b/triggers/gtk-icon-cache.trigger diff --git a/triggers/gtk-icon-cache.trigger b/triggers/gtk-icon-cache.trigger
index 711cfab2..07baa2ac 100755 index d9fc8251..d8ddb96e 100755
--- a/triggers/gtk-icon-cache.trigger --- a/triggers/gtk-icon-cache.trigger
+++ b/triggers/gtk-icon-cache.trigger +++ b/triggers/gtk-icon-cache.trigger
@@ -1,10 +1,10 @@ @@ -1,10 +1,10 @@
#!/bin/sh #!/bin/sh
-if test \( -x "$(which gtk-update-icon-cache 2>/dev/null)" \) -a \( -d $1/exports/share/icons/hicolor \); then if command -v gtk-update-icon-cache >/dev/null && test -d "$1/exports/share/icons/hicolor"; then
- cp /usr/share/icons/hicolor/index.theme $1/exports/share/icons/hicolor/ - cp /usr/share/icons/hicolor/index.theme "$1/exports/share/icons/hicolor/"
+if test \( -d $1/exports/share/icons/hicolor \); then + cp @hicolorIconTheme@/share/icons/hicolor/index.theme "$1/exports/share/icons/hicolor/"
+ cp @hicolorIconTheme@/share/icons/hicolor/index.theme $1/exports/share/icons/hicolor/ for dir in "$1"/exports/share/icons/*; do
for dir in $1/exports/share/icons/*; do if test -f "$dir/index.theme"; then
if test -f $dir/index.theme; then - if ! gtk-update-icon-cache --quiet "$dir"; then
- if ! gtk-update-icon-cache --quiet $dir; then + if ! @gtk3@/bin/gtk-update-icon-cache --quiet "$dir"; then
+ if ! @gtk3@/bin/gtk-update-icon-cache --quiet $dir; then
echo "Failed to run gtk-update-icon-cache for $dir" echo "Failed to run gtk-update-icon-cache for $dir"
exit 1 exit 1
fi fi
diff --git a/triggers/mime-database.trigger b/triggers/mime-database.trigger diff --git a/triggers/mime-database.trigger b/triggers/mime-database.trigger
index 2067d8ec..a49a8777 100755 index 10ddbbb3..c270998a 100755
--- a/triggers/mime-database.trigger --- a/triggers/mime-database.trigger
+++ b/triggers/mime-database.trigger +++ b/triggers/mime-database.trigger
@@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
-if test \( -x "$(which update-mime-database 2>/dev/null)" \) -a \( -d $1/exports/share/mime/packages \); then -if command -v update-mime-database >/dev/null && test -d "$1/exports/share/mime/packages"; then
- exec update-mime-database $1/exports/share/mime - exec update-mime-database "$1/exports/share/mime"
+if test \( -d $1/exports/share/mime/packages \); then +if test -d "$1/exports/share/mime/packages"; then
+ exec @smi@/bin/update-mime-database $1/exports/share/mime + exec @smi@/bin/update-mime-database "$1/exports/share/mime"
fi fi

View file

@ -0,0 +1,11 @@
--- a/profile/flatpak.fish
+++ b/profile/flatpak.fish
@@ -1,7 +1,7 @@
if type -q flatpak
# Set XDG_DATA_DIRS to include Flatpak installations
- set -x --path XDG_DATA_DIRS
+ set -x --path XDG_DATA_DIRS $XDG_DATA_DIRS
set -q XDG_DATA_DIRS[1]; or set XDG_DATA_DIRS /usr/local/share /usr/share
set -q XDG_DATA_HOME; or set -l XDG_DATA_HOME $HOME/.local/share