From 48047c1bde709f022133fbb2d101a120fd977bf7 Mon Sep 17 00:00:00 2001 From: heliguy Date: Mon, 17 Feb 2025 18:36:28 -0500 Subject: [PATCH] Remove libflatpak --- build-aux/fuse-2.9.2-closefrom.patch | 24 ---- .../fuse-2.9.2-namespace-conflict-fix.patch | 25 ---- ...fuse-disable-sys-mount-under-flatpak.patch | 29 ----- build-aux/fusermount-wrapper.sh | 13 --- build-aux/io.github.flattool.Warehouse.json | 107 ------------------ src/main.py | 7 +- 6 files changed, 2 insertions(+), 203 deletions(-) delete mode 100644 build-aux/fuse-2.9.2-closefrom.patch delete mode 100644 build-aux/fuse-2.9.2-namespace-conflict-fix.patch delete mode 100644 build-aux/fuse-disable-sys-mount-under-flatpak.patch delete mode 100644 build-aux/fusermount-wrapper.sh diff --git a/build-aux/fuse-2.9.2-closefrom.patch b/build-aux/fuse-2.9.2-closefrom.patch deleted file mode 100644 index a7ae30f..0000000 --- a/build-aux/fuse-2.9.2-closefrom.patch +++ /dev/null @@ -1,24 +0,0 @@ -SPDX-License-Identifier: GPL-3.0-or-later -SPDX-FileCopyrightText: 2017 Christian Hergert -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; diff --git a/build-aux/fuse-2.9.2-namespace-conflict-fix.patch b/build-aux/fuse-2.9.2-namespace-conflict-fix.patch deleted file mode 100644 index e204114..0000000 --- a/build-aux/fuse-2.9.2-namespace-conflict-fix.patch +++ /dev/null @@ -1,25 +0,0 @@ -SPDX-License-Identifier: GPL-3.0-or-later -SPDX-FileCopyrightText: 2017 Christian Hergert -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 -+#ifdef __linux__ -+#include -+#else -+#include - #define __u64 uint64_t - #define __s64 int64_t - #define __u32 uint32_t - #define __s32 int32_t - #define __u16 uint16_t -+#endif - - /* - * Version negotiation: diff --git a/build-aux/fuse-disable-sys-mount-under-flatpak.patch b/build-aux/fuse-disable-sys-mount-under-flatpak.patch deleted file mode 100644 index a594c50..0000000 --- a/build-aux/fuse-disable-sys-mount-under-flatpak.patch +++ /dev/null @@ -1,29 +0,0 @@ -SPDX-License-Identifier: GPL-3.0-or-later -SPDX-FileCopyrightText: 2018 Christian Hergert -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 -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 diff --git a/build-aux/fusermount-wrapper.sh b/build-aux/fusermount-wrapper.sh deleted file mode 100644 index aaa96ec..0000000 --- a/build-aux/fusermount-wrapper.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# -# SPDX-License-Identifier: GPL-3.0-or-later -# SPDX-FileCopyrightText: 2020 Christian Hergert -# 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 "$@" diff --git a/build-aux/io.github.flattool.Warehouse.json b/build-aux/io.github.flattool.Warehouse.json index c04c1fd..5fd0de5 100644 --- a/build-aux/io.github.flattool.Warehouse.json +++ b/build-aux/io.github.flattool.Warehouse.json @@ -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, diff --git a/src/main.py b/src/main.py index fc4d5d2..6462959 100644 --- a/src/main.py +++ b/src/main.py @@ -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,