aboutsummaryrefslogtreecommitdiffstats
path: root/testing/flatpak/musl-fixes.patch
diff options
context:
space:
mode:
Diffstat (limited to 'testing/flatpak/musl-fixes.patch')
-rw-r--r--testing/flatpak/musl-fixes.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/testing/flatpak/musl-fixes.patch b/testing/flatpak/musl-fixes.patch
new file mode 100644
index 0000000000..0a84cf374e
--- /dev/null
+++ b/testing/flatpak/musl-fixes.patch
@@ -0,0 +1,60 @@
+--- a/common/flatpak-utils.c
++++ b/common/flatpak-utils.c
+@@ -36,6 +36,7 @@
+ #include <fcntl.h>
+ #include <string.h>
+ #include <sys/stat.h>
++#include <sys/file.h>
+ #include <sys/types.h>
+ #include <sys/utsname.h>
+
+--- a/config.h.in
++++ b/config.h.in
+@@ -140,3 +140,14 @@
+
+ /* Define to 1 if you need to in order for `stat' and other things to work. */
+ #undef _POSIX_SOURCE
++
++/* taken from glibc unistd.h and fixes musl */
++#ifndef TEMP_FAILURE_RETRY
++#define TEMP_FAILURE_RETRY(expression) \
++ (__extension__ \
++ ({ long int __result; \
++ do __result = (long int) (expression); \
++ while (__result == -1L && errno == EINTR); \
++ __result; }))
++#endif
++
+--- a/builder/builder-module.c
++++ b/builder/builder-module.c
+@@ -771,7 +771,7 @@
+ g_ptr_array_add (args, g_strdup ("flatpak"));
+ g_ptr_array_add (args, g_strdup ("build"));
+
+- source_dir_path_canonical = canonicalize_file_name (source_dir_path);
++ source_dir_path_canonical = realpath (source_dir_path, NULL);
+
+ if (builder_context_get_build_runtime (context))
+ builddir = "/run/build-runtime/";
+--- a/builder/builder-source-shell.c
++++ b/builder/builder-source-shell.c
+@@ -130,7 +130,7 @@
+ g_ptr_array_add (args, g_strdup ("flatpak"));
+ g_ptr_array_add (args, g_strdup ("build"));
+
+- source_dir_path_canonical = canonicalize_file_name (source_dir_path);
++ source_dir_path_canonical = realpath (source_dir_path, NULL);
+
+ g_ptr_array_add (args, g_strdup ("--nofilesystem=host"));
+ g_ptr_array_add (args, g_strdup_printf ("--filesystem=%s", source_dir_path_canonical));
+--- a/common/flatpak-dir.c
++++ b/common/flatpak-dir.c
+@@ -2862,7 +2862,7 @@
+ somewhere the bind mount will be on the target of that, not
+ at that exact path. */
+ g_autofree char *basedir_orig = g_file_get_path (self->basedir);
+- g_autofree char *basedir = canonicalize_file_name (basedir_orig);
++ g_autofree char *basedir = realpath (basedir_orig, NULL);
+
+ g_debug ("running trigger %s", name);
+