diff --git a/packages/flutter_app_packager/lib/src/makers/appimage/make_appimage_config.dart b/packages/flutter_app_packager/lib/src/makers/appimage/make_appimage_config.dart index 7e8c22db..fdc9672c 100644 --- a/packages/flutter_app_packager/lib/src/makers/appimage/make_appimage_config.dart +++ b/packages/flutter_app_packager/lib/src/makers/appimage/make_appimage_config.dart @@ -32,6 +32,7 @@ class AppImageAction { class MakeAppImageConfig extends MakeConfig { MakeAppImageConfig({ + this.packageName, required this.displayName, required this.icon, this.keywords = const [], @@ -45,6 +46,7 @@ class MakeAppImageConfig extends MakeConfig { }); factory MakeAppImageConfig.fromJson(Map<String, dynamic> map) { return MakeAppImageConfig( + packageName: map['package_name'] as String?, displayName: map['display_name'] as String, icon: map['icon'] as String, metainfo: map['metainfo'] as String?, @@ -66,6 +68,9 @@ class MakeAppImageConfig extends MakeConfig { ); } + @override + String get appName => packageName ?? pubspec.name; + final String icon; final String? metainfo; final List<String> keywords; @@ -73,6 +78,7 @@ class MakeAppImageConfig extends MakeConfig { final List<AppImageAction> actions; final bool startupNotify; final String genericName; + final String? packageName; final String displayName; final List<String> include; List<String>? supportedMimeType; diff --git a/packages/flutter_app_packager/lib/src/makers/rpm/make_rpm_config.dart b/packages/flutter_app_packager/lib/src/makers/rpm/make_rpm_config.dart index 87a8381c..f5a63154 100644 --- a/packages/flutter_app_packager/lib/src/makers/rpm/make_rpm_config.dart +++ b/packages/flutter_app_packager/lib/src/makers/rpm/make_rpm_config.dart @@ -4,6 +4,7 @@ import 'package:flutter_app_packager/src/api/app_package_maker.dart'; class MakeRPMConfig extends MakeConfig { MakeRPMConfig({ + this.packageName, // Desktop file required this.displayName, this.startupNotify = true, @@ -39,6 +40,7 @@ class MakeRPMConfig extends MakeConfig { factory MakeRPMConfig.fromJson(Map<String, dynamic> json) { return MakeRPMConfig( + packageName: json['package_name'] as String?, displayName: json['display_name'] as String, icon: json['icon'] as String?, metainfo: json['metainfo'] as String?, @@ -71,6 +73,8 @@ class MakeRPMConfig extends MakeConfig { ); } + String? packageName; + String displayName; String? icon; String? metainfo; @@ -103,6 +107,9 @@ class MakeRPMConfig extends MakeConfig { String? attr; String? changelog; + @override + String get appName => packageName ?? pubspec.name; + @override Map<String, dynamic> toJson() { return { diff --git a/website/src/content/docs/makers/appimage.md b/website/src/content/docs/makers/appimage.md index 2a6c89cf..5922faa8 100644 --- a/website/src/content/docs/makers/appimage.md +++ b/website/src/content/docs/makers/appimage.md @@ -27,6 +27,7 @@ mv appimagetool /usr/local/bin/ Add `make_config.yaml` to your project `linux/packaging/appimage` directory. ```yaml +package_name: hello_world display_name: Hello World icon: assets/logo.png diff --git a/website/src/content/docs/makers/rpm.md b/website/src/content/docs/makers/rpm.md index 9f59d874..0fdbff0a 100644 --- a/website/src/content/docs/makers/rpm.md +++ b/website/src/content/docs/makers/rpm.md @@ -18,6 +18,7 @@ Install requirements: Add `make_config.yaml` to your project `linux/packaging/rpm` directory. ```yaml +package_name: hello-world icon: assets/logo.png summary: A really cool application group: Application/Emulator diff --git a/website/src/content/docs/zh-hans/makers/appimage.md b/website/src/content/docs/zh-hans/makers/appimage.md index b4edb2f8..cc46bbec 100644 --- a/website/src/content/docs/zh-hans/makers/appimage.md +++ b/website/src/content/docs/zh-hans/makers/appimage.md @@ -27,6 +27,7 @@ mv appimagetool /usr/local/bin/ 将 `make_config.yaml` 添加到您的项目 `linux/packaging/appimage` 目录。 ```yaml +package_name: hello_world display_name: Hello World icon: assets/logo.png diff --git a/website/src/content/docs/zh-hans/makers/rpm.md b/website/src/content/docs/zh-hans/makers/rpm.md index fa909c87..d3133aa1 100644 --- a/website/src/content/docs/zh-hans/makers/rpm.md +++ b/website/src/content/docs/zh-hans/makers/rpm.md @@ -18,6 +18,7 @@ title: RPM 将 `make_config.yaml` 添加到您的项目 `linux/packaging/rpm` 目录。 ```yaml +package_name: hello-world icon: assets/logo.png summary: A really cool application group: Application/Emulator