Changed linux build method

This commit is contained in:
Juan Gilsanz Polo 2023-05-04 18:23:01 +02:00
parent 65708c48c3
commit 62cf4d0c7f
8 changed files with 59 additions and 10 deletions

2
.gitignore vendored
View file

@ -42,3 +42,5 @@ app.*.map.json
/android/app/debug
/android/app/profile
/android/app/release
/debian/packages

View file

@ -60,14 +60,19 @@ On [this repository](https://github.com/JuanRodenas/Pihole_list) you can find a
</li>
<li>
<b>Linux</b>
<ol>
<li>flutter clean</li>
<li>flutter pub get</li>
<li>flutter build linux --release</li>
<li>Open debian.yaml file inside debian/ and update the version number</li>
<li>Run flutter_to_debian</li>
<li>The .deb package is at debian/packages</li>
</ol>
<ul>
<b>Prerequisites</b>
<ol>
<li>Install rps by running <code>dart pub global activate rps --version 0.7.0-dev.6</code></li>
</ol>
<b>Build</b>
<ol>
<li>Open debian.yaml file inside debian/ and update the version number</li>
<li>run <code>rps build linux</code></li>
<li>The .tar.gz is at build/linux/x64/release/bundle</li>
<li>The .deb package is at debian/packages</li>
</ol>
</ul>
</li>
<li>
<b>Windows</b>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

2
debian/debian.yaml vendored
View file

@ -1,5 +1,5 @@
flutter_app:
command: adguard_home_manager
command: AdGuardHomeManager
arch: x64
parent: /usr/local/lib

View file

@ -4,7 +4,7 @@ project(runner LANGUAGES CXX)
# The name of the executable created for the application. Change this to change
# the on-disk name of your application.
set(BINARY_NAME "adguard_home_manager")
set(BINARY_NAME "AdGuardHomeManager")
# The unique GTK application identifier for this application. See:
# https://wiki.gnome.org/HowDoI/ChooseApplicationID
set(APPLICATION_ID "com.jgeek00.adguard_home_manager")

30
linux/build-app.sh Executable file
View file

@ -0,0 +1,30 @@
#!/bin/bash
# Build the Flutter app and package into an archive.
# Exit if any command fails
set -e
# Echo all commands for debug purposes
set -x
projectName=AdGuard-Home-Manager
archiveName=$projectName-Linux.tar.gz
baseDir=$(pwd)
# ----------------------------- Build Flutter app ---------------------------- #
flutter clean
flutter pub get
flutter build linux --release
flutter_to_debian
cd build/linux/x64/release/bundle || exit
mv "AdGuardHomeManager" "AdGuard Home Manager"
tar -czaf $archiveName ./*

View file

@ -51,6 +51,13 @@ static void my_application_activate(GApplication* application) {
gtk_widget_show(GTK_WIDGET(window));
g_autoptr(FlDartProject) project = fl_dart_project_new();
g_autoptr(GError) error = nullptr;
gtk_window_set_icon_from_file(window, g_strconcat(fl_dart_project_get_assets_path(project), "/assets/icon/icon-circle-256.png", NULL), &error);
if (error != nullptr) {
g_warning("Failed to set icon: %s", error->message);
}
fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);
FlView* view = fl_view_new(project);

View file

@ -22,6 +22,10 @@ version: 2.0.0+53
environment:
sdk: '>=2.18.1 <3.0.0'
scripts:
build:
linux: "./linux/build-app.sh"
# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
@ -121,6 +125,7 @@ flutter:
- assets/icon/icon-splash.png
- assets/icon/icon-macos.png
- assets/icon/icon-circle.png
- assets/icon/icon-circle-256.png
- assets/icon/icon1024-white-center.png
- assets/other/get_google_play.png
- assets/resources/github.svg