From 0a9583e54e5c912b14feffdc2d2aedfd388ded19 Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Mon, 14 Jun 2021 08:43:30 -0700 Subject: [PATCH] linux: be able to use different install configurations --- linux/my_application.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/linux/my_application.cc b/linux/my_application.cc index f68cb91..742330f 100644 --- a/linux/my_application.cc +++ b/linux/my_application.cc @@ -73,7 +73,6 @@ static void my_application_activate(GApplication* application) { gtk_window_set_default_size(window, 1280, 720); gtk_widget_show(GTK_WIDGET(window)); - g_autoptr(FlDartProject) project = fl_dart_project_new(); // Check if assets folder is relative to the executable or if we can use a system copy @@ -82,15 +81,22 @@ static void my_application_activate(GApplication* application) { if( stat("/usr/share/cwtch/data/flutter_assets", &info ) != 0 ) { struct passwd *pw = getpwuid(getuid()); const char *homedir = pw->pw_dir; - // /home/$USER/.local/share.... + // /home/$USER/.local/share/cwtch/data/flutter_assets project->assets_path = g_build_filename(homedir, ".local", "share", "cwtch", "data", "flutter_assets", nullptr); + // /home/$USER/bin/cwtch/lib + project->aot_library_path = g_build_filename(homedir, "bin", "cwtch", "lib", nullptr); + // /home/$USER/.local/share/cwtch/data + project->icu_data_path = g_build_filename(homedir, ".local", "share", "cwtch", "data", nullptr); } else { + // /usr/share/cwtch/data/flutter_assets project->assets_path = g_build_filename("usr", "share", "cwtch", "data", "flutter_assets", nullptr); + // /usr/lib/cwtch + project->aot_library_path = g_build_filename("usr", "lib", "cwtch", nullptr); + // /usr/share/cwtch/data + project->icu_data_path = g_build_filename("usr", "share", "cwtch", "data", nullptr); } } - // TODO override icu_data_path - fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); FlView* view = fl_view_new(project);