diff --git a/data/com.wyattjmiller.snespatcher.desktop b/data/com.wyattjmiller.snespatcher.desktop new file mode 100644 index 0000000..6184286 --- /dev/null +++ b/data/com.wyattjmiller.snespatcher.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Type=Application +Name=SNES Patcher +GenericName=ROM Patcher +Comment=Apply IPS and BPS patches to Super Nintendo ROMs +Exec=snespatcher +Icon=com.wyattjmiller.snespatcher +Terminal=false +Categories=Utility; +Keywords=SNES;ROM;IPS;BPS;Patch; +StartupNotify=true diff --git a/data/com.wyattjmiller.snespatcher.metainfo.xml b/data/com.wyattjmiller.snespatcher.metainfo.xml new file mode 100644 index 0000000..b62ab68 --- /dev/null +++ b/data/com.wyattjmiller.snespatcher.metainfo.xml @@ -0,0 +1,27 @@ + + + com.wyattjmiller.snespatcher + + CC0-1.0 + MPL-2.0 + + SNES Patcher + Apply IPS and BPS patches to Super Nintendo ROMs + + + + SNES Patcher creates patched copies of Super Nintendo ROMs + while preserving the original file. + + + + + com.wyattjmiller.snespatcher.desktop + + + + https://scm.wyattjmiller.com/wymiller/snespatcher + + + + diff --git a/data/icons/hicolor/scalable/apps/com.wyattjmiller.snespatcher.svg b/data/icons/hicolor/scalable/apps/com.wyattjmiller.snespatcher.svg new file mode 100644 index 0000000..9a8128f --- /dev/null +++ b/data/icons/hicolor/scalable/apps/com.wyattjmiller.snespatcher.svg @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/flake.nix b/flake.nix index 4baf4b5..69694bf 100644 --- a/flake.nix +++ b/flake.nix @@ -3,7 +3,8 @@ inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - outputs = { self, nixpkgs }: + outputs = + { self, nixpkgs }: let supportedSystems = [ "x86_64-linux" @@ -12,7 +13,16 @@ forAllSystems = nixpkgs.lib.genAttrs supportedSystems; in { - packages = forAllSystems (system: + formatter = forAllSystems ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + pkgs.nixfmt-rfc-style + ); + + packages = forAllSystems ( + system: let pkgs = nixpkgs.legacyPackages.${system}; in @@ -23,7 +33,8 @@ src = pkgs.lib.cleanSourceWith { src = ./.; - filter = path: type: + filter = + path: type: let name = baseNameOf path; in @@ -47,6 +58,20 @@ gtk4 ]; + postInstall = '' + install -Dm444 \ + data/com.wyattjmiller.snespatcher.desktop \ + $out/share/applications/com.wyattjmiller.snespatcher.desktop + + install -Dm444 \ + data/com.wyattjmiller.snespatcher.metainfo.xml \ + $out/share/metainfo/com.wyattjmiller.snespatcher.metainfo.xml + + install -Dm444 \ + data/icons/hicolor/scalable/apps/com.wyattjmiller.snespatcher.svg \ + $out/share/icons/hicolor/scalable/apps/com.wyattjmiller.snespatcher.svg + ''; + meta = { description = "GTK 4 application for applying IPS patches to SNES ROMs"; homepage = "https://scm.wyattjmiller.com/wymiller/snespatcher"; @@ -57,9 +82,11 @@ }; default = snespatcher; - }); + } + ); - devShells = forAllSystems (system: + devShells = forAllSystems ( + system: let pkgs = nixpkgs.legacyPackages.${system}; in @@ -72,8 +99,11 @@ clippy rustc rustfmt + desktop-file-utils + appstream ]; }; - }); + } + ); }; } diff --git a/src/main.rs b/src/main.rs index b569b3f..eb574dc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,6 +16,7 @@ use gtk4::{ }; const APP_ID: &str = "com.wyattjmiller.snespatcher"; +const APP_NAME: &str = "SNES Patcher"; #[derive(Clone)] struct SelectionState { @@ -31,6 +32,7 @@ struct SelectionRow { } fn main() { + glib::set_application_name(APP_NAME); let app = Application::new(Some(APP_ID), Default::default()); app.connect_activate(build_ui); app.run(); @@ -194,6 +196,8 @@ fn build_header_bar( about.connect_activate(glib::clone!(@weak window => move |_, _| { let dialog = AboutDialog::builder() .transient_for(&window) + .program_name(APP_NAME) + .logo_icon_name(APP_ID) .modal(true) .program_name("SNES Patcher") .version(env!("CARGO_PKG_VERSION"))
+ SNES Patcher creates patched copies of Super Nintendo ROMs + while preserving the original file. +