Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flatpak workaround #367

Draft
wants to merge 40 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
39a5bab
create initial flatpak manifest file
Jul 14, 2021
883434f
starts building; fails on libbamf3
Jul 26, 2021
327849a
Add Flatpak build dependencies (#234)
dar5hak Jul 31, 2021
ff75c62
rm libbamf as dependency
Aug 4, 2021
e8ab7ff
fixed appdata; hope so
Aug 12, 2021
7be22ab
system tab works
Aug 12, 2021
f974e20
try to break out from sandbox
stsdc May 19, 2022
9a63d4e
Merge branch 'dev' into flatpak
stsdc Feb 13, 2023
94162f4
convert flatpak manifest to json
stsdc Feb 13, 2023
106cdf6
update readme
stsdc Feb 13, 2023
824633c
adding udisks2 dependency
stsdc Feb 13, 2023
f3c7afe
Merge branch 'flatpak' of github.com:stsdc/monitor into flatpak
stsdc Feb 14, 2023
8ff18f7
[Flatpak]: add libXNVCtrl module
stsdc Feb 15, 2023
d92477a
[Flatpak]: Fix installing path for libNVCtrl
stsdc Feb 15, 2023
15f6e12
[Flatpak]: Build works
stsdc Feb 15, 2023
e506159
Merge branch 'dev' into flatpak
stsdc Nov 29, 2023
70eb435
Make it compile
stsdc Nov 30, 2023
aa43cef
there is an attempt
stsdc Dec 6, 2023
787e319
.
stsdc Dec 7, 2023
69e199c
.
stsdc Dec 7, 2023
8f7c929
parse data from python
stsdc Dec 9, 2023
bb35702
provider wip
stsdc Dec 10, 2023
d673254
Use provider to get pids
stsdc Dec 11, 2023
d7d38d4
return pids
stsdc Dec 12, 2023
5256763
get list of processes
stsdc Dec 12, 2023
a94f2da
read uid
stsdc Dec 12, 2023
5a00128
clean hashmaps in ProcessProvider; retrieve children for a process
stsdc Dec 13, 2023
0a3cd3d
Create ProcessWorkaround class and use it if in Flatpak env
stsdc Dec 24, 2023
7ba6821
remove unnecessary conditions
stsdc Dec 24, 2023
24f0dc7
Show cpu usage for processes in Flatpak
stsdc Dec 25, 2023
cbeb519
Showing process memory usage works in Flatpak
stsdc Dec 25, 2023
fe48f0e
remove debug message
stsdc Dec 25, 2023
841fd80
Workaround started automatically
stsdc Jan 2, 2024
cd8ffd3
Ending and killing processes works thru workaround
stsdc Jan 4, 2024
3b917e4
Uncomment spawn_workaround()
stsdc Jan 4, 2024
7046f0f
fix lint
stsdc Jan 4, 2024
2c87b9a
Merge branch 'dev' into flatpak-workaround
stsdc Jan 4, 2024
9d28856
add kill signal; show root user if uid 0
stsdc Jan 6, 2024
b2119c0
Save flatpak-infobar-state
stsdc Jan 6, 2024
683cb60
fix lint
stsdc Jan 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,16 @@ Check dependencies in [the deb control file](debian/control).
sudo ninja install
```

#### Build Flatpak

flatpak-builder build com.github.stsdc.monitor.yml --user --install --force-clean

### Debug logging

```bash
G_MESSAGES_DEBUG=all GTK_DEBUG=interactive com.github.stsdc.monitor
```

#### Debug Flatpak

flatpak run --command=sh --devel com.github.stsdc.monitor
346 changes: 346 additions & 0 deletions com.github.stsdc.monitor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,346 @@
{
"app-id": "com.github.stsdc.monitor",
"runtime": "io.elementary.Platform",
"runtime-version": "7.3",
"sdk": "io.elementary.Sdk",
"command": "com.github.stsdc.monitor",
"finish-args": [
"--share=ipc",
"--socket=fallback-x11",
"--socket=wayland",
"--socket=session-bus",
"--socket=system-bus",
"--device=shm",
"--device=all",
"--share=network",
"--env=XDG_DATA_DIRS=/app/share:/usr/share:/usr/share/runtime/share:/run/host/user-share:/run/host/usr/share:/run/host/share:/var/lib/flatpak/exports/share:~/.local/share/flatpak/exports/share",
"--talk-name=org.freedesktop.Flatpak",
"--talk-name=com.github.stsdc.monitor",
"--system-talk-name=org.freedesktop.Accounts",
"--system-talk-name=org.freedesktop.UDisks2",
"--filesystem=host:ro",
"--filesystem=/var/lib/flatpak/app:ro",
"--filesystem=/var/lib/flatpak/exports/share:ro",
"--filesystem=xdg-data/flatpak/app:ro",
"--filesystem=xdg-data/flatpak/exports/share:ro",
"--filesystem=/run/docker.sock",
"--filesystem=xdg-run/docker.sock",
"--filesystem=/run/podman/podman.sock",
"--filesystem=xdg-run/podman/podman.sock",
"--filesystem=/tmp"
],
"modules": [
{
"name": "sassc",
"cleanup": [
"*"
],
"sources": [
{
"type": "git",
"url": "https://github.com/sass/sassc.git",
"tag": "3.6.2"
},
{
"type": "script",
"dest-filename": "autogen.sh",
"commands": [
"autoreconf -si"
]
}
],
"modules": [
{
"name": "pam",
"config-opts": [
"--includedir=/app/include/security",
"--disable-doc"
],
"sources": [
{
"type": "archive",
"url": "https://github.com/linux-pam/linux-pam/releases/download/v1.4.0/Linux-PAM-1.4.0.tar.xz",
"sha256": "cd6d928c51e64139be3bdb38692c68183a509b83d4f2c221024ccd4bcddfd034"
}
]
},
{
"name": "polkit",
"buildsystem": "meson",
"config-opts": [
"-Dlibs-only=true",
"-Dauthfw=pam"
],
"sources": [
{
"type": "git",
"url": "https://gitlab.freedesktop.org/stsdc/polkit.git",
"branch": "polkit-agent-building-option"
}
]
},
{
"name": "udisks2",
"buildsystem": "autotools",
"config-opts": [
"--enable-available-modules=no",
"--enable-bcache=no",
"--enable-btrfs=no",
"--enable-introspection=yes",
"--enable-lvm2=no",
"--enable-modules=no",
"--enable-vdo=no",
"--enable-zram=no",
"--with-systemdsystemunitdir=no",
"--with-tmpfilesdir=no",
"--disable-daemon"
],
"sources": [
{
"type": "git",
"url": "https://github.com/storaged-project/udisks.git",
"tag": "udisks-2.9.4"
}
]
},
{
"name": "libsass",
"cleanup": [
"*"
],
"sources": [
{
"type": "git",
"url": "https://github.com/sass/libsass.git",
"tag": "3.6.5"
},
{
"type": "script",
"dest-filename": "autogen.sh",
"commands": [
"autoreconf -si"
]
}
]
}
]
},
{
"name": "libstartup-notification",
"sources": [
{
"type": "archive",
"url": "http://www.freedesktop.org/software/startup-notification/releases/startup-notification-0.12.tar.gz",
"sha256": "3c391f7e930c583095045cd2d10eb73a64f085c7fde9d260f2652c7cb3cfbe4a"
}
]
},
{
"name": "flatpak",
"config-opts": [
"--disable-documentation",
"--disable-seccomp",
"--disable-sandboxed-triggers",
"--disable-system-helper",
"--with-system-install-dir=/var/lib/flatpak"
],
"cleanup": [
"/etc/profile.d",
"/lib/systemd",
"/share/dbus-1/interfaces/org.freedesktop.*",
"/share/dbus-1/services/org.freedesktop.*",
"/share/gdm"
],
"post-install": [
"cp /usr/bin/update-mime-database /app/bin",
"cp /usr/bin/update-desktop-database /app/bin"
],
"sources": [
{
"type": "archive",
"url": "https://github.com/flatpak/flatpak/releases/download/1.14.4/flatpak-1.14.4.tar.xz",
"sha256": "8a34dbd0b67c434e7598b98ec690953d046f0db26e480aeafb46d72aec716799",
"x-checker-data": {
"type": "json",
"url": "https://api.github.com/repos/flatpak/flatpak/releases/latest",
"version-query": ".tag_name",
"url-query": "\"https://github.com/flatpak/flatpak/releases/download/\\($version)/flatpak-\\($version).tar.xz\""
}
}
],
"modules": [
{
"name": "snowball",
"buildsystem": "simple",
"sources": [
{
"type": "archive",
"url": "https://github.com/snowballstem/snowball/archive/refs/tags/v2.2.0.tar.gz",
"sha512": "02c43313de9de2518ea51cfb11f1c29145fc046c7838329bfdefd70b604009ad44b6db8175c25b0db31f03db30a6aec5857aa35775a9c204ec976df9cae62957"
},
{
"type": "patch",
"paths": [
"flatpak/patches/snowball.patch"
]
}
],
"build-commands": [
"make libstemmer.so -j$FLATPAK_BUILDER_N_JOBS",
"install -Dm644 include/libstemmer.h /app/include/libstemmer.h",
"install -Dm644 libstemmer.so /app/lib/libstemmer.so.0.0.0",
"ln -s libstemmer.so.0.0.0 /app/lib/libstemmer.so.0",
"ln -s libstemmer.so.0 /app/lib/libstemmer.so"
]
},
{
"name": "libfuse",
"buildsystem": "meson",
"config-opts": [
"-Dexamples=false",
"-Dinitscriptdir=",
"-Duseroot=false",
"-Dtests=false",
"-Dudevrulesdir=/tmp/"
],
"sources": [
{
"type": "archive",
"url": "https://github.com/libfuse/libfuse/releases/download/fuse-3.14.1/fuse-3.14.1.tar.xz",
"sha256": "126919d72b46b3e0eb58a9c6933a2a50c36f2ea69f61fe9e78bdba9f463ffa20",
"x-checker-data": {
"type": "anitya",
"project-id": 861,
"url-template": "https://github.com/libfuse/libfuse/releases/download/fuse-$version/fuse-$version.tar.gz",
"versions": {
"<": "4.0"
}
}
}
]
},
{
"name": "ostree",
"config-opts": [
"--disable-man",
"--with-systemdsystemgeneratordir=/app/lib/systemd/system-generators",
"--without-systemdsystemunitdir",
"--with-curl"
],
"cleanup": [
"/etc/grub.d",
"/etc/ostree",
"/share/ostree",
"/libexec"
],
"sources": [
{
"type": "archive",
"url": "https://github.com/ostreedev/ostree/releases/download/v2023.7/libostree-2023.7.tar.xz",
"sha256": "19cda718705f7ac8c018c939c38b1bb8412deaaa04862da98cd9fe9243f073bf",
"x-checker-data": {
"type": "json",
"url": "https://api.github.com/repos/ostreedev/ostree/releases/latest",
"version-query": ".tag_name",
"url-query": ".assets | first | .browser_download_url"
}
}
]
},
{
"name": "python3-pyparsing",
"cleanup": [
"*"
],
"buildsystem": "simple",
"build-commands": [
"pip3 install --prefix=/app pyparsing-2.4.7-py2.py3-none-any.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": "libwnck",
"buildsystem": "meson",
"config-opts": [
"-Dstartup_notification=enabled"
],
"cleanup": [
"/include",
"/lib/pkgconfig",
"/bin"
],
"sources": [
{
"type": "archive",
"url": "https://download.gnome.org/sources/libwnck/3.36/libwnck-3.36.0.tar.xz",
"sha256": "bc508150b3ed5d22354b0e6774ad4eee465381ebc0ace45eb0e2d3a4186c925f"
}
]
},
{
"name": "libgtop",
"sources": [
{
"type": "archive",
"url": "https://download.gnome.org/sources/libgtop/2.40/libgtop-2.40.0.tar.xz",
"sha256": "78f3274c0c79c434c03655c1b35edf7b95ec0421430897fb1345a98a265ed2d4"
}
]
},
{
"name": "libNVCtrl",
"build-options": {
"env": {
"LIB": "lib/x86_64-linux-gnu"
}
},
"no-autogen": true,
"no-make-install": true,
"build-commands": [
"mkdir -p ${FLATPAK_DEST}/lib",
"cp -a libXNVCtrl.so* ${FLATPAK_DEST}/lib/",
"install -D *.h -t ${FLATPAK_DEST}/include/NVCtrl"
],
"subdir": "src/libXNVCtrl",
"sources": [
{
"type": "archive",
"archive-type": "tar",
"url": "https://api.github.com/repos/NVIDIA/nvidia-settings/tarball/refs/tags/470.63.01",
"sha256": "0ede63515851d85ac0d1ed5f00e355f539968e6d1fd226120a27b2c66c3575de"
},
{
"type": "patch",
"path": "flatpak/patches/libxnvctrl_so_0.patch",
"x-checker-data": {
"type": "json",
"url": "https://api.github.com/repos/NVIDIA/nvidia-settings/tags",
"url-query": ".[0].tarball_url",
"version-query": ".[0].name"
}
}
]
},
{
"name": "com.github.stsdc.monitor",
"buildsystem": "meson",
"config-opts": [
"-Dflatpak-workaround=enabled"
],
"sources": [
{
"type": "dir",
"path": "."
}
]
}
]
}
Loading