finally remove dirty struct copy in linux my_application.cc and nsis path fix for flutter 3.19.3

This commit is contained in:
Dan Ballard 2024-04-05 15:42:51 -07:00
parent db1f0ed41e
commit f87b05ed95
2 changed files with 7 additions and 16 deletions

View File

@ -10,7 +10,6 @@
#include <pwd.h>
#include <flutter_linux/flutter_linux.h>
#include <flutter_linux/fl_dart_project.h>
#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
#endif
@ -24,17 +23,6 @@ struct _MyApplication {
FlMethodChannel* channel;
// Redefining from flutter/engine::shell/platform/linux/fl_dart_project.cc
// struct def required here to enable compiler to allow access to variables
struct _FlDartProject {
GObject parent_instance;
gchar* aot_library_path;
gchar* assets_path;
gchar* icu_data_path;
gchar** dart_entrypoint_args;
};
G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)
#include <dlfcn.h>
@ -99,7 +87,8 @@ static void my_application_activate(GApplication* application) {
if( stat("lib/cwtch", &info) == 0) {
// use local dir structure
fl_dart_project_set_assets_path(project, g_build_filename("data", "flutter_assets", nullptr));
project->aot_library_path = g_build_filename("lib", "libapp.so", nullptr);
//project->aot_library_path = g_build_filename("lib", "libapp.so", nullptr);
fl_dart_project_set_aot_library_path(project, g_build_filename("lib", "libapp.so", nullptr));
fl_dart_project_set_icu_data_path(project, g_build_filename("data", "icudtl.dat", nullptr));
gtk_window_set_icon_from_file(window, "./cwtch.png", NULL);
} else if( stat("/usr/share/cwtch/data/flutter_assets", &info ) != 0 ) {
@ -109,7 +98,8 @@ static void my_application_activate(GApplication* application) {
// /home/$USER/.local/share/cwtch/data/flutter_assets
fl_dart_project_set_assets_path(project, g_build_filename(homedir, ".local", "share", "cwtch", "data", "flutter_assets", nullptr));
// /home/$USER/.local/lib/cwtch/
project->aot_library_path = g_build_filename(homedir, ".local", "lib", "cwtch", "libapp.so", nullptr);
//project->aot_library_path = g_build_filename(homedir, ".local", "lib", "cwtch", "libapp.so", nullptr);
fl_dart_project_set_aot_library_path(project, g_build_filename(homedir, ".local", "lib", "cwtch", "libapp.so", nullptr));
// /home/$USER/.local/share/cwtch/data
fl_dart_project_set_icu_data_path(project, g_build_filename(homedir, ".local", "share", "cwtch", "data", "icudtl.dat", nullptr));
gtk_window_set_icon_from_file(window, g_build_filename(homedir, ".local", "share", "icons", "cwtch.png", nullptr), NULL);
@ -118,7 +108,8 @@ static void my_application_activate(GApplication* application) {
// /usr/share/cwtch/data/flutter_assets
fl_dart_project_set_assets_path(project, g_build_filename("/", "usr", "share", "cwtch", "data", "flutter_assets", nullptr));
// /usr/lib/cwtch
project->aot_library_path = g_build_filename("/", "usr", "lib", "cwtch", "libapp.so", nullptr);
//project->aot_library_path = g_build_filename("/", "usr", "lib", "cwtch", "libapp.so", nullptr);
fl_dart_project_set_aot_library_path(project, g_build_filename("/", "usr", "lib", "cwtch", "libapp.so", nullptr));
// /usr/share/cwtch/data
fl_dart_project_set_icu_data_path(project, g_build_filename("/", "usr", "share", "cwtch", "data", "icudtl.dat", nullptr));
gtk_window_set_icon_from_file(window, "/usr/share/icons/cwtch.png", NULL);

View File

@ -87,7 +87,7 @@ Section
# define what to install and place it in the output path
# Filler for .sh to populate with contents of deploy/windows
#FILESLISTSTART
FILE /r "..\..\build\windows\runner\Release\"
FILE /r "..\..\build\windows\x64\runner\Release\"
#FILESLISTEND
CreateDirectory "$SMPROGRAMS\Cwtch"