From 8c33dddc3f7ce64488411bf6ea390124abe3065a Mon Sep 17 00:00:00 2001 From: seth Date: Sat, 8 Jun 2024 16:54:32 -0400 Subject: [PATCH 1/5] cartridges: migrate to by-name --- .../default.nix => by-name/ca/cartridges/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{applications/misc/cartridges/default.nix => by-name/ca/cartridges/package.nix} (100%) diff --git a/pkgs/applications/misc/cartridges/default.nix b/pkgs/by-name/ca/cartridges/package.nix similarity index 100% rename from pkgs/applications/misc/cartridges/default.nix rename to pkgs/by-name/ca/cartridges/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 169d36662ccc..da6b04e5123c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -411,8 +411,6 @@ with pkgs; caroline = callPackage ../development/libraries/caroline { }; - cartridges = callPackage ../applications/misc/cartridges { }; - castget = callPackage ../applications/networking/feedreaders/castget { }; catatonit = callPackage ../applications/virtualization/catatonit { }; From a57781b65a3ef9f82d512d82bc8605cebb7125d1 Mon Sep 17 00:00:00 2001 From: seth Date: Sat, 8 Jun 2024 16:55:11 -0400 Subject: [PATCH 2/5] cartridges: format with nixfmt --- pkgs/by-name/ca/cartridges/package.nix | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/ca/cartridges/package.nix b/pkgs/by-name/ca/cartridges/package.nix index 3674d61fafca..e1ad5fc1de7a 100644 --- a/pkgs/by-name/ca/cartridges/package.nix +++ b/pkgs/by-name/ca/cartridges/package.nix @@ -1,15 +1,16 @@ -{ blueprint-compiler -, desktop-file-utils -, fetchFromGitHub -, gobject-introspection -, lib -, libadwaita -, meson -, ninja -, python3Packages -, stdenv -, wrapGAppsHook4 -, nix-update-script +{ + blueprint-compiler, + desktop-file-utils, + fetchFromGitHub, + gobject-introspection, + lib, + libadwaita, + meson, + ninja, + python3Packages, + stdenv, + wrapGAppsHook4, + nix-update-script, }: stdenv.mkDerivation (finalAttrs: { pname = "cartridges"; From 7401dfca27e7592c45bc449044324650d800e3a8 Mon Sep 17 00:00:00 2001 From: seth Date: Sat, 8 Jun 2024 17:07:45 -0400 Subject: [PATCH 3/5] cartridges: `mkDerivation` -> `buildPythonApplication` as we're already pulling in python's hooks, it makes sense to use the full builder as opposed to emulating its behavior --- pkgs/by-name/ca/cartridges/package.nix | 58 ++++++++++---------------- 1 file changed, 23 insertions(+), 35 deletions(-) diff --git a/pkgs/by-name/ca/cartridges/package.nix b/pkgs/by-name/ca/cartridges/package.nix index e1ad5fc1de7a..224e13a8744b 100644 --- a/pkgs/by-name/ca/cartridges/package.nix +++ b/pkgs/by-name/ca/cartridges/package.nix @@ -1,67 +1,53 @@ { + lib, + fetchFromGitHub, + python3Packages, blueprint-compiler, desktop-file-utils, - fetchFromGitHub, gobject-introspection, - lib, libadwaita, meson, ninja, - python3Packages, - stdenv, wrapGAppsHook4, - nix-update-script, }: -stdenv.mkDerivation (finalAttrs: { +python3Packages.buildPythonApplication rec { pname = "cartridges"; version = "2.8.5"; + pyproject = false; src = fetchFromGitHub { owner = "kra-mo"; repo = "cartridges"; - rev = "v${finalAttrs.version}"; + rev = "v${version}"; hash = "sha256-7T+q3T8z8SCpAn3ayodZeETOsTwL+hhVWzY2JyBEoi4="; }; - pythonPath = with python3Packages; [ - pillow - pygobject3 - pyyaml - requests - ]; - # TODO: remove this when #286814 hits master mesonFlags = [ "-Dtiff_compression=jpeg" ]; - buildInputs = [ - libadwaita - (python3Packages.python.withPackages (_: finalAttrs.pythonPath)) - ]; - nativeBuildInputs = [ blueprint-compiler desktop-file-utils gobject-introspection meson ninja - python3Packages.wrapPython wrapGAppsHook4 ]; + buildInputs = [ libadwaita ]; + + dependencies = with python3Packages; [ + pillow + pygobject3 + pyyaml + requests + ]; + dontWrapGApps = true; + makeWrapperArgs = [ ''''${gappsWrapperArgs[@]}'' ]; - postFixup = '' - makeWrapperArgs+=("''${gappsWrapperArgs[@]}") - wrapPythonPrograms "$out/bin" "$out" "$pythonPath" - ''; - - passthru = { - updateScript = nix-update-script { }; - }; - - meta = with lib; { + meta = { description = "GTK4 + Libadwaita game launcher"; - mainProgram = "cartridges"; longDescription = '' A simple game launcher for all of your games. It has support for importing games from Steam, Lutris, Heroic @@ -69,8 +55,10 @@ stdenv.mkDerivation (finalAttrs: { You can sort and hide games or download cover art from SteamGridDB. ''; homepage = "https://apps.gnome.org/Cartridges/"; - license = licenses.gpl3Plus; - maintainers = [ maintainers.getchoo ]; - platforms = platforms.linux; + changelog = "https://github.com/kra-mo/cartridges/releases/tag/${src.rev}"; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ getchoo ]; + mainProgram = "cartridges"; + platforms = lib.platforms.linux; }; -}) +} From 2458b6ac7dca849199fe1c682486c352ff46462f Mon Sep 17 00:00:00 2001 From: seth Date: Sat, 8 Jun 2024 17:25:33 -0400 Subject: [PATCH 4/5] cartridges: add missing build deps --- pkgs/by-name/ca/cartridges/package.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/by-name/ca/cartridges/package.nix b/pkgs/by-name/ca/cartridges/package.nix index 224e13a8744b..31ddaf419bfc 100644 --- a/pkgs/by-name/ca/cartridges/package.nix +++ b/pkgs/by-name/ca/cartridges/package.nix @@ -2,12 +2,14 @@ lib, fetchFromGitHub, python3Packages, + appstream, blueprint-compiler, desktop-file-utils, gobject-introspection, libadwaita, meson, ninja, + pkg-config, wrapGAppsHook4, }: python3Packages.buildPythonApplication rec { @@ -26,11 +28,13 @@ python3Packages.buildPythonApplication rec { mesonFlags = [ "-Dtiff_compression=jpeg" ]; nativeBuildInputs = [ + appstream blueprint-compiler desktop-file-utils gobject-introspection meson ninja + pkg-config wrapGAppsHook4 ]; From 261bd913b0c8e0aa565323e1d47660149aee39f6 Mon Sep 17 00:00:00 2001 From: seth Date: Sat, 8 Jun 2024 17:26:46 -0400 Subject: [PATCH 5/5] cartridges: ensure tls support --- pkgs/by-name/ca/cartridges/package.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/ca/cartridges/package.nix b/pkgs/by-name/ca/cartridges/package.nix index 31ddaf419bfc..eeb20dbfda77 100644 --- a/pkgs/by-name/ca/cartridges/package.nix +++ b/pkgs/by-name/ca/cartridges/package.nix @@ -6,6 +6,7 @@ blueprint-compiler, desktop-file-utils, gobject-introspection, + glib-networking, libadwaita, meson, ninja, @@ -38,7 +39,10 @@ python3Packages.buildPythonApplication rec { wrapGAppsHook4 ]; - buildInputs = [ libadwaita ]; + buildInputs = [ + glib-networking + libadwaita + ]; dependencies = with python3Packages; [ pillow