From c9f7f02bbed1c784fe6308221a5faefaa0555a4f Mon Sep 17 00:00:00 2001 From: "Emil \"AngryAnt\" Johansen" Date: Fri, 5 Aug 2022 16:33:34 +0200 Subject: [PATCH 1/2] rusty-psn, rusty-psn-gui: init at 0.1.2 --- pkgs/applications/misc/rusty-psn/default.nix | 80 ++++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 + 2 files changed, 84 insertions(+) create mode 100644 pkgs/applications/misc/rusty-psn/default.nix diff --git a/pkgs/applications/misc/rusty-psn/default.nix b/pkgs/applications/misc/rusty-psn/default.nix new file mode 100644 index 000000000000..a3e93b871a51 --- /dev/null +++ b/pkgs/applications/misc/rusty-psn/default.nix @@ -0,0 +1,80 @@ +{ lib +, stdenv +, rustPlatform +, fetchFromGitHub +, makeDesktopItem +, copyDesktopItems +, pkg-config +, openssl +, xorg +, libGL +, gui ? false # build GUI version +}: + +rustPlatform.buildRustPackage rec { + pname = "rusty-psn"; + version = "0.1.2"; + + src = fetchFromGitHub { + owner = "RainbowCookie32"; + repo = "rusty-psn"; + rev = "v${version}"; + sha256 = "14li5fsaj4l5al6lcxy07g3gzmi0l3cyiczq44q7clq4myhykhhb"; + }; + + cargoSha256 = "0kjaq3ik3lwaz7rjb5jaxavpahzp33j7vln3zyifql7j7sbr300f"; + + nativeBuildInputs = [ + pkg-config + copyDesktopItems + ]; + + dependencies = if gui then [ + openssl + xorg.libxcb + xorg.libX11 + xorg.libXcursor + xorg.libXrandr + xorg.libXi + xorg.libxcb + libGL + libGL.dev + ] else [ + openssl + ]; + buildInputs = dependencies; + + buildNoDefaultFeatures = true; + buildFeatures = [ (if gui then "egui" else "cli") ]; + + postFixup = '' + patchelf --set-rpath "${lib.makeLibraryPath dependencies}" $out/bin/rusty-psn + ${if gui then "mv $out/bin/rusty-psn $out/bin/rusty-psn-gui" else ""} + ''; + + desktopItem = if gui then makeDesktopItem { + name = "rusty-psn"; + desktopName = "rusty-psn"; + exec = "rusty-psn-gui"; + comment = "A simple tool to grab updates for PS3 games, directly from Sony's servers using their updates API."; + categories = [ + "Network" + ]; + keywords = [ + "psn" + "ps3" + "sony" + "playstation" + "update" + ]; + } else ""; + desktopItems = if gui then [ desktopItem ] else []; + + meta = with lib; { + description = "A simple tool to grab updates for PS3 games, directly from Sony's servers using their updates API"; + homepage = ""; + license = licenses.mit; + platforms = [ "x86_64-linux" ]; + maintainers = with lib.maintainers; [ AngryAnt ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fb73e403c7ac..f557900c8a4f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -30212,6 +30212,10 @@ with pkgs; runc = callPackage ../applications/virtualization/runc {}; + rusty-psn = callPackage ../applications/misc/rusty-psn {}; + + rusty-psn-gui = rusty-psn.override { gui = true; }; + rymcast = callPackage ../applications/audio/rymcast { inherit (gnome) zenity; }; From 79736fde014ea9e37415c5969e584b3a08940e99 Mon Sep 17 00:00:00 2001 From: "Emil \"AngryAnt\" Johansen" Date: Fri, 5 Aug 2022 16:42:35 +0200 Subject: [PATCH 2/2] review fixes --- pkgs/applications/misc/rusty-psn/default.nix | 30 ++++++++++---------- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pkgs/applications/misc/rusty-psn/default.nix b/pkgs/applications/misc/rusty-psn/default.nix index a3e93b871a51..bc0fd96730b5 100644 --- a/pkgs/applications/misc/rusty-psn/default.nix +++ b/pkgs/applications/misc/rusty-psn/default.nix @@ -1,4 +1,4 @@ -{ lib +{ lib , stdenv , rustPlatform , fetchFromGitHub @@ -8,13 +8,13 @@ , openssl , xorg , libGL -, gui ? false # build GUI version +, withGui ? false # build GUI version }: rustPlatform.buildRustPackage rec { pname = "rusty-psn"; version = "0.1.2"; - + src = fetchFromGitHub { owner = "RainbowCookie32"; repo = "rusty-psn"; @@ -29,7 +29,7 @@ rustPlatform.buildRustPackage rec { copyDesktopItems ]; - dependencies = if gui then [ + buildInputs = if withGui then [ openssl xorg.libxcb xorg.libX11 @@ -40,19 +40,19 @@ rustPlatform.buildRustPackage rec { libGL libGL.dev ] else [ - openssl + openssl ]; - buildInputs = dependencies; buildNoDefaultFeatures = true; - buildFeatures = [ (if gui then "egui" else "cli") ]; + buildFeatures = [ (if withGui then "egui" else "cli") ]; postFixup = '' - patchelf --set-rpath "${lib.makeLibraryPath dependencies}" $out/bin/rusty-psn - ${if gui then "mv $out/bin/rusty-psn $out/bin/rusty-psn-gui" else ""} + patchelf --set-rpath "${lib.makeLibraryPath buildInputs}" $out/bin/rusty-psn + '' + lib.optionalString withGui '' + mv $out/bin/rusty-psn $out/bin/rusty-psn-gui ''; - desktopItem = if gui then makeDesktopItem { + desktopItem = lib.optionalString withGui (makeDesktopItem { name = "rusty-psn"; desktopName = "rusty-psn"; exec = "rusty-psn-gui"; @@ -67,14 +67,14 @@ rustPlatform.buildRustPackage rec { "playstation" "update" ]; - } else ""; - desktopItems = if gui then [ desktopItem ] else []; + }); + desktopItems = lib.optionals withGui [ desktopItem ]; meta = with lib; { - description = "A simple tool to grab updates for PS3 games, directly from Sony's servers using their updates API"; - homepage = ""; + description = "Simple tool to grab updates for PS3 games, directly from Sony's servers using their updates API"; + homepage = "https://github.com/RainbowCookie32/rusty-psn/"; license = licenses.mit; platforms = [ "x86_64-linux" ]; - maintainers = with lib.maintainers; [ AngryAnt ]; + maintainers = with maintainers; [ AngryAnt ]; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f557900c8a4f..afcd9b05b166 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -30214,7 +30214,7 @@ with pkgs; rusty-psn = callPackage ../applications/misc/rusty-psn {}; - rusty-psn-gui = rusty-psn.override { gui = true; }; + rusty-psn-gui = rusty-psn.override { withGui = true; }; rymcast = callPackage ../applications/audio/rymcast { inherit (gnome) zenity;