Skip to content

Commit

Permalink
AppImage support
Browse files Browse the repository at this point in the history
Signed-off-by: Blake <blake@1024256.xyz>
  • Loading branch information
bleonard252 committed Apr 29, 2022
1 parent cd28ace commit 8768320
Show file tree
Hide file tree
Showing 12 changed files with 247 additions and 283 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
.pub-cache/
.pub/
/build/
/AppDir/
**/appimage-builder-cache

# Web related
lib/generated_plugin_registrant.dart
Expand Down
62 changes: 62 additions & 0 deletions AppImageBuilder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# appimage-builder recipe see https://appimage-builder.readthedocs.io for details
version: 1
AppDir:
path: /src/bleonard252/bodacious/AppDir
app_info:
id: xyz.u1024256.bodacious
name: Bodacious
icon: xyz.u1024256.bodacious
version: 0.7.0
exec: bodacious
exec_args: $@
apt:
arch:
- amd64
allow_unauthenticated: true
sources:
- sourceline: deb http://deb.debian.org/debian/ bullseye main non-free contrib
- sourceline: deb http://deb.debian.org/debian bullseye-updates
main contrib non-free
stable main
- sourceline: deb http://security.debian.org/debian-security bullseye-security
main contrib non-free
stable main
include: []
files:
include: []
exclude:
- usr/share/man
- usr/share/doc/*/README.*
- usr/share/doc/*/changelog.*
- usr/share/doc/*/NEWS.*
- usr/share/doc/*/TODO.*
test:
fedora-30:
image: appimagecrafters/tests-env:fedora-30
command: ./AppRun
use_host_x: true
debian-stable:
image: appimagecrafters/tests-env:debian-stable
command: ./AppRun
use_host_x: true
archlinux-latest:
image: appimagecrafters/tests-env:archlinux-latest
command: ./AppRun
use_host_x: true
centos-7:
image: appimagecrafters/tests-env:centos-7
command: ./AppRun
use_host_x: true
ubuntu-xenial:
image: appimagecrafters/tests-env:ubuntu-xenial
command: ./AppRun
use_host_x: true
after_runtime:
- sed -i 's/Utility/Audio/' AppDir/xyz.u1024256.bodacious.desktop
- sed -i '/Exec=/a StartupWMClass=bodacious' AppDir/xyz.u1024256.bodacious.desktop
- mkdir -p AppDir/usr/share/applications
- cp AppDir/xyz.u1024256.bodacious.desktop AppDir/usr/share/applications/
AppImage:
arch: x86_64
update-information: guess
file_name: 'build/linux/x64/release/appimage/bodacious-x86_64.AppImage'
15 changes: 15 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ set positional-arguments
# Build the app in debug mode
build *TARGETS='appbundle': _generate
for target in {{TARGETS}}; do flutter build $target --debug --dart-define DISCORD_APP_ID=$DISCORD_APP_ID --dart-define LASTFM_API_KEY=$LASTFM_API_KEY --dart-define LASTFM_SECRET=$LASTFM_SECRET --dart-define SPOTIFY_API_KEY=$SPOTIFY_API_KEY --dart-define SPOTIFY_SECRET=$SPOTIFY_SECRET; done
release-appimage:
#!/usr/bin/env bash
set -eux
rm -rf AppDir | true
mkdir AppDir
mkdir -p AppDir/usr/share/icons/hicolor/{128x128,1024x1024,64x64}
cp -r build/linux/x64/release/bundle/. AppDir/
#cp assets/brand/ic_circle.png AppDir/usr/share/icons/hicolor/128x128/xyz.u1024256.bodacious.png
convert assets/brand/ic_circle.png -resize 128x128 AppDir/usr/share/icons/hicolor/128x128/xyz.u1024256.bodacious.png
convert assets/brand/ic_circle.png -resize 1024x1024 AppDir/usr/share/icons/hicolor/1024x1024/xyz.u1024256.bodacious.png
cp assets/brand/ic_foreground_small.png AppDir/usr/share/icons/hicolor/64x64/xyz.u1024256.bodacious.png
mkdir -p build/linux/x64/release/appimage/
echo If this is not found, run: sudo pip install appimage-builder
appimage-builder --skip-test
echo AppImage released to build/linux/x64/release/appimage/bodacious-x86_64.AppImage
# Build the app in release mode
release *TARGETS='apk': test-all prebuild
@#TODO: set version in version.txt
Expand Down
Binary file added assets/brand/ic_foreground_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
109 changes: 34 additions & 75 deletions lib/models/album_data.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,53 +12,12 @@ part of 'album_data.dart';
T _$identity<T>(T value) => value;

final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods');

AlbumMetadata _$AlbumMetadataFromJson(Map<String, dynamic> json) {
return _AlbumMetadata.fromJson(json);
}

/// @nodoc
class _$AlbumMetadataTearOff {
const _$AlbumMetadataTearOff();

_AlbumMetadata call(
{required String artistName,
required String name,
Uri? coverUri,
Uri? coverUriRemote,
String? coverSource,
String? description,
String? descriptionSource,
int? trackCount,
int? year,
DateTime? releaseDate,
String? spotifyId,
String? metadataSource}) {
return _AlbumMetadata(
artistName: artistName,
name: name,
coverUri: coverUri,
coverUriRemote: coverUriRemote,
coverSource: coverSource,
description: description,
descriptionSource: descriptionSource,
trackCount: trackCount,
year: year,
releaseDate: releaseDate,
spotifyId: spotifyId,
metadataSource: metadataSource,
);
}

AlbumMetadata fromJson(Map<String, Object?> json) {
return AlbumMetadata.fromJson(json);
}
}

/// @nodoc
const $AlbumMetadata = _$AlbumMetadataTearOff();

/// @nodoc
mixin _$AlbumMetadata {
/// The artist's name, used to group this album and make it unique.
Expand Down Expand Up @@ -314,41 +273,40 @@ class _$_AlbumMetadata extends _AlbumMetadata with DiagnosticableTreeMixin {
factory _$_AlbumMetadata.fromJson(Map<String, dynamic> json) =>
_$$_AlbumMetadataFromJson(json);

@override

/// The artist's name, used to group this album and make it unique.
final String artistName;
@override
final String artistName;

/// The album's name.
final String name;
@override
final String name;

/// The URI to the album cover.
@override
final Uri? coverUri;
@override
final Uri? coverUriRemote;
@override
final String? coverSource;
@override

/// Extra details about the album.
final String? description;
@override
final String? description;

/// Where the [description] came from.
final String? descriptionSource;
@override
final String? descriptionSource;

/// The total number of tracks on this album (or tracks present in the library).
final int? trackCount;
@override
final int? trackCount;

/// The year the album was released. Prefer to show [releaseDate] wherever given.
final int? year;
@override
final int? year;

/// The release date of this album.
@override
final DateTime? releaseDate;
@override
final String? spotifyId;
Expand Down Expand Up @@ -406,6 +364,7 @@ class _$_AlbumMetadata extends _AlbumMetadata with DiagnosticableTreeMixin {
.equals(other.metadataSource, metadataSource));
}

@JsonKey(ignore: true)
@override
int get hashCode => Object.hash(
runtimeType,
Expand Down Expand Up @@ -435,18 +394,18 @@ class _$_AlbumMetadata extends _AlbumMetadata with DiagnosticableTreeMixin {

abstract class _AlbumMetadata extends AlbumMetadata {
const factory _AlbumMetadata(
{required String artistName,
required String name,
Uri? coverUri,
Uri? coverUriRemote,
String? coverSource,
String? description,
String? descriptionSource,
int? trackCount,
int? year,
DateTime? releaseDate,
String? spotifyId,
String? metadataSource}) = _$_AlbumMetadata;
{required final String artistName,
required final String name,
final Uri? coverUri,
final Uri? coverUriRemote,
final String? coverSource,
final String? description,
final String? descriptionSource,
final int? trackCount,
final int? year,
final DateTime? releaseDate,
final String? spotifyId,
final String? metadataSource}) = _$_AlbumMetadata;
const _AlbumMetadata._() : super._();

factory _AlbumMetadata.fromJson(Map<String, dynamic> json) =
Expand All @@ -455,43 +414,43 @@ abstract class _AlbumMetadata extends AlbumMetadata {
@override

/// The artist's name, used to group this album and make it unique.
String get artistName;
String get artistName => throw _privateConstructorUsedError;
@override

/// The album's name.
String get name;
String get name => throw _privateConstructorUsedError;
@override

/// The URI to the album cover.
Uri? get coverUri;
Uri? get coverUri => throw _privateConstructorUsedError;
@override
Uri? get coverUriRemote;
Uri? get coverUriRemote => throw _privateConstructorUsedError;
@override
String? get coverSource;
String? get coverSource => throw _privateConstructorUsedError;
@override

/// Extra details about the album.
String? get description;
String? get description => throw _privateConstructorUsedError;
@override

/// Where the [description] came from.
String? get descriptionSource;
String? get descriptionSource => throw _privateConstructorUsedError;
@override

/// The total number of tracks on this album (or tracks present in the library).
int? get trackCount;
int? get trackCount => throw _privateConstructorUsedError;
@override

/// The year the album was released. Prefer to show [releaseDate] wherever given.
int? get year;
int? get year => throw _privateConstructorUsedError;
@override

/// The release date of this album.
DateTime? get releaseDate;
DateTime? get releaseDate => throw _privateConstructorUsedError;
@override
String? get spotifyId;
String? get spotifyId => throw _privateConstructorUsedError;
@override
String? get metadataSource;
String? get metadataSource => throw _privateConstructorUsedError;
@override
@JsonKey(ignore: true)
_$AlbumMetadataCopyWith<_AlbumMetadata> get copyWith =>
Expand Down
Loading

0 comments on commit 8768320

Please sign in to comment.