Remove libflatpak

This commit is contained in:
heliguy
2025-02-17 18:36:28 -05:00
parent 2246b34350
commit 48047c1bde
6 changed files with 2 additions and 203 deletions

View File

@@ -1,24 +0,0 @@
SPDX-License-Identifier: GPL-3.0-or-later
SPDX-FileCopyrightText: 2017 Christian Hergert <chergert@redhat.com>
Reference: https://gitlab.gnome.org/GNOME/gnome-builder/-/blob/main/build-aux/flatpak/fuse-2.9.2-closefrom.patch?ref_type=heads
--- fuse-2.9.2/util/ulockmgr_server.c.closefromfix 2019-01-04 05:33:33.000000000 -0800
+++ fuse-2.9.2/util/ulockmgr_server.c 2022-07-12 12:29:56.445402244 -0700
@@ -124,7 +124,7 @@
return res;
}
-static int closefrom(int minfd)
+static int _closefrom(int minfd)
{
DIR *dir = opendir("/proc/self/fd");
if (dir) {
@@ -384,7 +384,7 @@
dup2(nullfd, 1);
}
close(3);
- closefrom(5);
+ _closefrom(5);
while (1) {
char c;
int sock;

View File

@@ -1,25 +0,0 @@
SPDX-License-Identifier: GPL-3.0-or-later
SPDX-FileCopyrightText: 2017 Christian Hergert <chergert@redhat.com>
Reference: https://gitlab.gnome.org/GNOME/gnome-builder/-/blob/main/build-aux/flatpak/fuse-2.9.2-namespace-conflict-fix.patch?ref_type=heads
diff -up fuse-2.9.2/include/fuse_kernel.h.conflictfix fuse-2.9.2/include/fuse_kernel.h
--- fuse-2.9.2/include/fuse_kernel.h.conflictfix 2013-06-26 09:31:57.862198038 -0400
+++ fuse-2.9.2/include/fuse_kernel.h 2013-06-26 09:32:19.679198365 -0400
@@ -88,12 +88,16 @@
#ifndef _LINUX_FUSE_H
#define _LINUX_FUSE_H
-#include <sys/types.h>
+#ifdef __linux__
+#include <linux/types.h>
+#else
+#include <stdint.h>
#define __u64 uint64_t
#define __s64 int64_t
#define __u32 uint32_t
#define __s32 int32_t
#define __u16 uint16_t
+#endif
/*
* Version negotiation:

View File

@@ -1,29 +0,0 @@
SPDX-License-Identifier: GPL-3.0-or-later
SPDX-FileCopyrightText: 2018 Christian Hergert <chergert@redhat.com>
Reference: https://gitlab.gnome.org/GNOME/gnome-builder/-/blob/main/build-aux/flatpak/fuse-disable-sys-mount-under-flatpak.patch?ref_type=heads
From 1ec935f4abecd08957affc7b21bae6bf5be78931 Mon Sep 17 00:00:00 2001
From: Christian Hergert <chergert@redhat.com>
Date: Thu, 12 Apr 2018 01:47:57 -0700
Subject: [PATCH] libfuse: disable sys mount under flatpak
---
lib/mount.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/mount.c b/lib/mount.c
index 7a18c11..1667db2 100644
--- a/lib/mount.c
+++ b/lib/mount.c
@@ -392,6 +392,9 @@ static int fuse_mount_sys(const char *mnt, struct mount_opts *mo,
int fd;
int res;
+ /* disable in flatpak */
+ return -2;
+
if (!mnt) {
fprintf(stderr, "fuse: missing mountpoint parameter\n");
return -1;
--
2.17.0.rc2

View File

@@ -1,13 +0,0 @@
#!/bin/sh
#
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: 2020 Christian Hergert <christian@hergert.me>
# Reference: https://gitlab.gnome.org/GNOME/gnome-builder/-/blob/main/build-aux/flatpak/fusermount-wrapper.sh?ref_type=heads
if [ -z "$_FUSE_COMMFD" ]; then
FD_ARGS=
else
FD_ARGS="--env=_FUSE_COMMFD=${_FUSE_COMMFD} --forward-fd=${_FUSE_COMMFD}"
fi
exec flatpak-spawn --host --forward-fd=1 --forward-fd=2 --forward-fd=3 $FD_ARGS fusermount "$@"

View File

@@ -26,11 +26,6 @@
"*.la",
"*.a"
],
"build-options" : {
"env" : {
"MOUNT_FUSE_PATH" : "../tmp/"
}
},
"modules" : [
{
"name" : "blueprint-compiler",
@@ -46,108 +41,6 @@
"*"
]
},
{
"name" : "libfuse",
"config-opts" : [
"UDEV_RULES_PATH=/app/etc/udev/rules.d",
"INIT_D_PATH=/app/etc/init.d"
],
"cleanup" : [
"/bin/ulockmgr_server"
],
"post-install" : [
"install -m a+rx fusermount-wrapper.sh /app/bin/fusermount"
],
"sources" : [
{
"type" : "archive",
"url" : "https://github.com/libfuse/libfuse/releases/download/fuse-2.9.9/fuse-2.9.9.tar.gz",
"sha256" : "d0e69d5d608cc22ff4843791ad097f554dd32540ddc9bed7638cc6fea7c1b4b5"
},
{
"type" : "patch",
"path" : "fuse-2.9.2-namespace-conflict-fix.patch"
},
{
"type" : "patch",
"path" : "fuse-disable-sys-mount-under-flatpak.patch"
},
{
"type" : "patch",
"path" : "fuse-2.9.2-closefrom.patch"
},
{
"type" : "file",
"path" : "fusermount-wrapper.sh"
}
]
},
{
"name": "ostree",
"buildsystem": "autotools",
"config-opts": [
"--disable-rofiles-fuse"
],
"sources": [
{
"type": "git",
"url": "https://github.com/ostreedev/ostree",
"tag": "v2024.9"
}
]
},
{
"name": "pyparsing",
"buildsystem": "simple",
"build-commands": [
"pip3 install --prefix=/app --no-deps ./pyparsing-*.whl"
],
"sources": [
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/8a/bb/488841f56197b13700afd5658fc279a2025a39e22449b7cf29864669b15d/pyparsing-2.4.7-py2.py3-none-any.whl",
"sha256": "ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b"
}
]
},
{
"name" : "flatpak",
"buildsystem" : "meson",
"config-opts" : [
"-Ddocbook_docs=disabled",
"-Dseccomp=disabled",
"-Dsandboxed_triggers=false",
"-Dsystem_helper=disabled",
"-Dsystem_install_dir=/var/lib/flatpak",
"--sysconfdir=/var/run/host/etc",
"-Dman=disabled",
"-Dhttp_backend=curl",
"-Dsystemd=disabled",
"-Dtests=false"
],
"cleanup" : [
"/bin/flatpak-bisect",
"/bin/flatpak-coredumpctl",
"/etc/profile.d",
"/lib/systemd",
"/share/dbus-1/interfaces/org.freedesktop.*",
"/share/dbus-1/services/org.freedesktop.*",
"/share/flatpak/triggers",
"/share/gdm",
"/share/zsh"
],
"post-install" : [
"cp /usr/bin/update-mime-database /app/bin",
"cp /usr/bin/update-desktop-database /app/bin"
],
"sources" : [
{
"type" : "git",
"url" : "https://github.com/flatpak/flatpak.git",
"tag" : "1.15.6"
}
]
},
{
"name" : "warehouse",
"builddir" : true,

View File

@@ -22,9 +22,8 @@ import gi
gi.require_version("Gtk", "4.0")
gi.require_version("Adw", "1")
gi.require_version("Flatpak", "1.0")
from gi.repository import Gtk, Gio, Adw, GLib, Flatpak
from gi.repository import Gtk, Gio, Adw, GLib
from src.main_window.window import WarehouseWindow
from src.const import Config
from src.gtk.error_toast import ErrorToast
@@ -37,7 +36,7 @@ class WarehouseApplication(Adw.Application):
"""The main application singleton class."""
troubleshooting = (
"OS: {os}\nWarehouse version: {wv}\nlibflatpak: {libflatpak}\nGTK: {gtk}\nlibadwaita: {adw}\nApp ID: {app_id}\nProfile: {profile}\nLanguage: {lang}"
"OS: {os}\nWarehouse version: {wv}\nGTK: {gtk}\nlibadwaita: {adw}\nApp ID: {app_id}\nProfile: {profile}\nLanguage: {lang}"
)
version = Config.VERSION
@@ -69,7 +68,6 @@ class WarehouseApplication(Adw.Application):
self.is_dialog_open = False
libflatpak_version = str(Flatpak.MAJOR_VERSION) + "." + str(Flatpak.MINOR_VERSION) + "." + str(Flatpak.MICRO_VERSION)
gtk_version = str(Gtk.MAJOR_VERSION) + "." + str(Gtk.MINOR_VERSION) + "." + str(Gtk.MICRO_VERSION)
adw_version = str(Adw.MAJOR_VERSION) + "." + str(Adw.MINOR_VERSION) + "." + str(Adw.MICRO_VERSION)
os_string = GLib.get_os_info("NAME") + " " + GLib.get_os_info("VERSION")
@@ -78,7 +76,6 @@ class WarehouseApplication(Adw.Application):
self.troubleshooting = self.troubleshooting.format(
os=os_string,
wv=self.version,
libflatpak=libflatpak_version,
gtk=gtk_version,
adw=adw_version,
profile=Config.PROFILE,