linux: be able to use different install configurations
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
403eb04124
commit
0a9583e54e
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue