Skip to content

Various flatpak fixes and improvements #9527

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/build_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
flatpak:
name: "Flatpak"
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-46
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-47
options: --privileged
volumes:
- /usr/local/lib/android:/usr/local/lib/android
Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,9 @@ endif()
# set(Boost_COMPILER "-mgw81")
# boost::process was introduced first in version 1.64.0,
# boost::beast::detail::base64 was introduced first in version 1.66.0
if(POLICY CMP0167)
cmake_policy(SET CMP0167 NEW)
endif()
find_package(Boost 1.83.0 REQUIRED COMPONENTS system filesystem thread log log_setup locale regex chrono atomic date_time iostreams program_options nowide)

add_library(boost_libs INTERFACE)
Expand Down
24 changes: 24 additions & 0 deletions deps/OCCT/0001-OCCT-fix.patch
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,27 @@ index 5ae9899f..0a17372b 100644

if (!myFTLib->IsValid())
{
From 7236e83dcc1e7284e66dc61e612154617ef715d6 Mon Sep 17 00:00:00 2001
From: dpasukhi <[email protected]>
Date: Tue, 27 Aug 2024 11:33:29 +0100
Subject: [PATCH] 0033808: Coding - FreeType Use unsigned point and contour
indexing in `FT_Outline`

Changes to auto instead of specific type
---
src/StdPrs/StdPrs_BRepFont.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/StdPrs/StdPrs_BRepFont.cxx b/src/StdPrs/StdPrs_BRepFont.cxx
index ab2d9b3c9f..cd701879b1 100644
--- a/src/StdPrs/StdPrs_BRepFont.cxx
+++ b/src/StdPrs/StdPrs_BRepFont.cxx
@@ -457,7 +457,7 @@ Standard_Boolean StdPrs_BRepFont::renderGlyph (const Standard_Utf32Char theChar,
for (short aContour = 0, aStartIndex = 0; aContour < anOutline->n_contours; ++aContour)
{
const FT_Vector* aPntList = &anOutline->points[aStartIndex];
- const char* aTags = &anOutline->tags[aStartIndex];
+ const auto* aTags = &anOutline->tags[aStartIndex];
const short anEndIndex = anOutline->contours[aContour];
const short aPntsNb = (anEndIndex - aStartIndex) + 1;
aStartIndex = anEndIndex + 1;
9 changes: 1 addition & 8 deletions flatpak/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,4 @@ grep -q org.freedesktop.Platform.GL.nvidia /.flatpak-info && export WEBKIT_DISAB
# Work-around https://github.com/bambulab/BambuStudio/issues/3440
export LC_ALL=C.UTF-8

if XDG_CONFIG_HOME=$HOME/.config /app/bin/uses-dark-theme.py; then
export GTK_THEME='Adwaita:dark'
export ORCA_SLICER_DARK_THEME='true'
echo "Message: $(date +%T): INFO: using dark theme variant"
fi

exec /app/bin/orca-slicer "$@" &
$(/app/bin/set-dark-theme-variant.py) &
exec /app/bin/orca-slicer "$@"
52 changes: 14 additions & 38 deletions flatpak/io.github.softfever.OrcaSlicer.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
app-id: io.github.softfever.OrcaSlicer
runtime: org.gnome.Platform
runtime-version: "46"
runtime-version: "47"
sdk: org.gnome.Sdk
command: entrypoint
separate-locales: true
Expand All @@ -19,34 +19,8 @@ finish-args:
- --talk-name=io.github.softfever.OrcaSlicer.InstanceCheck.*
- --system-talk-name=org.freedesktop.UDisks2
- --env=SPNAV_SOCKET=/run/spnav.sock
# set dark theme
- --env=ORCA_SLICER_DARK_THEME=false

modules:
# xprop, xlib is needed to manipulate the X11 window and set _GTK_THEME_VARIANT dark on X11
# and paint the window dark when ORCA_SLICER_DARK_THEME is true
# see: entrypoint & set-dark-theme-variant.py (originated from Pursa Slicer flatpak which originated from spotify client flatpak)
- name: xprop
sources:
- type: archive
url: https://xorg.freedesktop.org/archive/individual/app/xprop-1.2.5.tar.gz
sha256: b7bf6b6be6cf23e7966a153fc84d5901c14f01ee952fbd9d930aa48e2385d670
- name: python-setuptools_scm
buildsystem: simple
build-commands:
- pip3 install --no-deps --no-build-isolation --verbose --prefix=${FLATPAK_DEST} .
sources:
- type: archive
url: https://files.pythonhosted.org/packages/57/38/930b1241372a9f266a7df2b184fb9d4f497c2cef2e016b014f82f541fe7c/setuptools_scm-6.0.1.tar.gz
sha256: d1925a69cb07e9b29416a275b9fadb009a23c148ace905b2fb220649a6c18e92
- name: python-xlib
buildsystem: simple
build-commands:
- pip3 install --no-deps --no-build-isolation --verbose --prefix=${FLATPAK_DEST} .
sources:
- type: archive
url: https://files.pythonhosted.org/packages/86/f5/8c0653e5bb54e0cbdfe27bf32d41f27bc4e12faa8742778c17f2a71be2c0/python-xlib-0.33.tar.gz
sha256: 55af7906a2c75ce6cb280a584776080602444f75815a7aff4d287bb2d7018b32

# JPEG codec for the liveview
- name: gst-plugins-good
Expand Down Expand Up @@ -112,7 +86,7 @@ modules:
- type: archive
url: https://github.com/FreeSpacenav/libspnav/releases/download/v1.2/libspnav-1.2.tar.gz
sha256: 093747e7e03b232e08ff77f1ad7f48552c06ac5236316a5012db4269951c39db

- name: orca_wxwidgets
buildsystem: simple
build-commands:
Expand Down Expand Up @@ -221,6 +195,12 @@ modules:
dest: external-packages/GMP
sha256: eae9326beb4158c386e39a356818031bd28f3124cf915f8c5b1dc4c7a36b4d7c

# curl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For CURL and OpenSSL, any reason why you're building those? The runtime versions should be new enough (curl 8.13.0 and openssl 3.3.3).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there is a way to disable building these. No one backported your patches from Bambu Studio for disabling built-in deps

- type: file
url: https://github.com/curl/curl/archive/refs/tags/curl-7_75_0.zip
dest: external-packages/CURL
sha256: a63ae025bb0a14f119e73250f2c923f4bf89aa93b8d4fafa4a9f5353a96a765a

# MPFR
- type: file
url: https://www.mpfr.org/mpfr-4.2.2/mpfr-4.2.2.tar.bz2
Expand Down Expand Up @@ -257,6 +237,12 @@ modules:
dest: external-packages/OpenEXR
sha256: 0307a3d7e1fa1e77e9d84d7e9a8694583fbbbfd50bdc6884e2c96b8ef6b902de

# OpenSSL
- type: file
url: https://github.com/openssl/openssl/archive/OpenSSL_1_1_1w.tar.gz
dest: external-packages/OpenSSL
sha256: 2130e8c2fb3b79d1086186f78e59e8bc8d1a6aedf17ab3907f4cb9ae20918c41

# OpenVDB
- type: file
url: https://github.com/tamasmeszaros/openvdb/archive/a68fd58d0e2b85f01adeb8b13d7555183ab10aa5.zip
Expand Down Expand Up @@ -325,8 +311,6 @@ modules:
desktop-file-edit --set-key=Exec --set-value="entrypoint %U" /app/share/applications/${FLATPAK_ID}.desktop
install -Dm755 entrypoint /app/bin
install -Dm755 umount /app/bin
install set-dark-theme-variant.py /app/bin
install uses-dark-theme.py /app/bin

sources:
# -
Expand All @@ -344,14 +328,6 @@ modules:
- type: file
path: io.github.softfever.OrcaSlicer.metainfo.xml

# script to set dark theme variant
- type: file
path: set-dark-theme-variant.py

# script to detect if host uses dark theme
- type: file
path: uses-dark-theme.py

# start-up script
- type: file
path: entrypoint
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 221be0af1a0b5bcf05c59b3403f969643b42dbaf Mon Sep 17 00:00:00 2001
From f0135d9c3faf0207f7100991ccf512f228b90570 Mon Sep 17 00:00:00 2001
From: Paul Cornett <[email protected]>
Date: Sat, 30 Sep 2023 16:42:58 -0700
Subject: [PATCH] Enable using a dark theme when Gnome "dark style" is set
Expand All @@ -8,11 +8,11 @@ automatically, so request it explicitly.

Co-authored-by: Colin Kinloch
---
src/gtk/settings.cpp | 112 ++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 111 insertions(+), 1 deletion(-)
src/gtk/settings.cpp | 118 ++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 117 insertions(+), 1 deletion(-)

diff --git a/src/gtk/settings.cpp b/src/gtk/settings.cpp
index 304724773711..74898d9bb953 100644
index 3047247737..f13ea2ef24 100644
--- a/src/gtk/settings.cpp
+++ b/src/gtk/settings.cpp
@@ -183,6 +183,64 @@ static void notify_gtk_font_name(GObject*, GParamSpec*, void*)
Expand Down Expand Up @@ -80,7 +80,7 @@ index 304724773711..74898d9bb953 100644
// Some notes on using GtkStyleContext. Style information from a context
// attached to a non-visible GtkWidget is not accurate. The context has an
// internal visibility state, controlled by the widget, which it presumably
@@ -1124,12 +1182,62 @@ bool wxSystemSettingsNative::HasFeature(wxSystemFeature index)
@@ -1124,12 +1182,68 @@ bool wxSystemSettingsNative::HasFeature(wxSystemFeature index)
class wxSystemSettingsModule: public wxModule
{
public:
Expand Down Expand Up @@ -109,8 +109,14 @@ index 304724773711..74898d9bb953 100644
+
+ m_proxy = nullptr;
+
+ if (getenv("ORCA_SLICER_DARK_THEME") != nullptr) {
+ /* 1 for prefer dark */
+ GVariant *value = g_variant_new_uint32(1);
+ UpdatePreferDark(value);
+ g_variant_unref(value);
+ }
+ // GTK_THEME environment variable overrides other settings
+ if (getenv("GTK_THEME") == nullptr)
+ else if (getenv("GTK_THEME") == nullptr)
+ {
+ m_proxy = g_dbus_proxy_new_for_bus_sync(
+ G_BUS_TYPE_SESSION, G_DBUS_PROXY_FLAGS_NONE, nullptr,
Expand Down Expand Up @@ -144,7 +150,7 @@ index 304724773711..74898d9bb953 100644
void wxSystemSettingsModule::OnExit()
{
#ifdef __WXGTK3__
@@ -1141,6 +1249,8 @@ void wxSystemSettingsModule::OnExit()
@@ -1141,6 +1255,8 @@ void wxSystemSettingsModule::OnExit()
g_signal_handlers_disconnect_by_func(settings,
(void*)notify_gtk_font_name, NULL);
}
Expand All @@ -154,5 +160,5 @@ index 304724773711..74898d9bb953 100644
if (gs_tlw_parent)
{
--
2.46.2
2.49.0

85 changes: 0 additions & 85 deletions flatpak/set-dark-theme-variant.py

This file was deleted.

18 changes: 0 additions & 18 deletions flatpak/uses-dark-theme.py

This file was deleted.