nixpkgs/pkgs/applications/misc/rusty-psn/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

81 lines
1.8 KiB
Nix
Raw Normal View History

2022-08-05 17:42:35 +03:00
{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
, makeDesktopItem
, copyDesktopItems
, pkg-config
, openssl
, xorg
, libGL
2022-08-05 17:42:35 +03:00
, withGui ? false # build GUI version
}:
rustPlatform.buildRustPackage rec {
pname = "rusty-psn";
2022-09-22 05:46:43 +03:00
version = "0.3.0";
2022-08-05 17:42:35 +03:00
src = fetchFromGitHub {
owner = "RainbowCookie32";
repo = "rusty-psn";
rev = "v${version}";
2022-09-22 05:46:43 +03:00
sha256 = "sha256-BsbuEsW6cQbWg8BLtEBnjoCfcUCy1xWz9u0wBa8BKtA=";
};
2022-09-22 05:46:43 +03:00
cargoSha256 = "sha256-TD5du7I6Hw1PC8s9NI19jYCXlaZMnsdVj/a0q+M8Raw=";
nativeBuildInputs = [
pkg-config
copyDesktopItems
];
2022-08-05 17:42:35 +03:00
buildInputs = if withGui then [
openssl
xorg.libxcb
xorg.libX11
xorg.libXcursor
xorg.libXrandr
xorg.libXi
xorg.libxcb
libGL
libGL.dev
] else [
2022-08-05 17:42:35 +03:00
openssl
];
buildNoDefaultFeatures = true;
2022-08-05 17:42:35 +03:00
buildFeatures = [ (if withGui then "egui" else "cli") ];
postFixup = ''
2022-08-05 17:42:35 +03:00
patchelf --set-rpath "${lib.makeLibraryPath buildInputs}" $out/bin/rusty-psn
'' + lib.optionalString withGui ''
mv $out/bin/rusty-psn $out/bin/rusty-psn-gui
'';
2022-08-05 17:42:35 +03:00
desktopItem = lib.optionalString withGui (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"
];
2022-08-05 17:42:35 +03:00
});
desktopItems = lib.optionals withGui [ desktopItem ];
meta = with lib; {
2022-08-05 17:42:35 +03:00
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" ];
2022-08-05 17:42:35 +03:00
maintainers = with maintainers; [ AngryAnt ];
};
}