Skip to content

Commit

Permalink
fix: add package_name to rpm and appimage
Browse files Browse the repository at this point in the history
  • Loading branch information
prateekmedia committed Sep 24, 2024
1 parent 4b6693a commit b3883f8
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class AppImageAction {

class MakeAppImageConfig extends MakeConfig {
MakeAppImageConfig({
this.packageName,
required this.displayName,
required this.icon,
this.keywords = const [],
Expand All @@ -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?,
Expand All @@ -66,13 +68,17 @@ class MakeAppImageConfig extends MakeConfig {
);
}

@override
String get appName => packageName ?? pubspec.name;

final String icon;
final String? metainfo;
final List<String> keywords;
final List<String> categories;
final List<AppImageAction> actions;
final bool startupNotify;
final String genericName;
final String? packageName;
final String displayName;
final List<String> include;
List<String>? supportedMimeType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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?,
Expand Down Expand Up @@ -71,6 +73,8 @@ class MakeRPMConfig extends MakeConfig {
);
}

String? packageName;

String displayName;
String? icon;
String? metainfo;
Expand Down Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions website/src/content/docs/makers/appimage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions website/src/content/docs/makers/rpm.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions website/src/content/docs/zh-hans/makers/appimage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions website/src/content/docs/zh-hans/makers/rpm.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b3883f8

Please sign in to comment.