2022-08-12 12:06:08 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, makeDesktopItem
|
|
|
|
, copyDesktopItems
|
|
|
|
, pkg-config
|
2023-05-24 13:37:59 +00:00
|
|
|
, cmake
|
|
|
|
, fontconfig
|
|
|
|
, glib
|
|
|
|
, gtk3
|
|
|
|
, freetype
|
2022-08-12 12:06:08 +00:00
|
|
|
, openssl
|
|
|
|
, xorg
|
|
|
|
, libGL
|
|
|
|
, withGui ? false # build GUI version
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "rusty-psn";
|
2024-06-20 14:57:18 +00:00
|
|
|
version = "0.3.7";
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "RainbowCookie32";
|
|
|
|
repo = "rusty-psn";
|
|
|
|
rev = "v${version}";
|
2024-06-20 14:57:18 +00:00
|
|
|
sha256 = "sha256-EGj9VVY+Zbmth7H1oTgq38KNLT/aWoTPn8k4sVkScgg=";
|
2022-08-12 12:06:08 +00:00
|
|
|
};
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
cargoPatches = [ ./fix-cargo-lock.patch ];
|
|
|
|
|
|
|
|
cargoSha256 = "sha256-8J92WtMmCTnghPqSmNYhG3IVdmpHsHEH7Fkod0UYKJU=";
|
|
|
|
|
|
|
|
# Tests require network access
|
|
|
|
doCheck = false;
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
2023-05-24 13:37:59 +00:00
|
|
|
] ++ lib.optionals withGui [
|
2022-08-12 12:06:08 +00:00
|
|
|
copyDesktopItems
|
2023-05-24 13:37:59 +00:00
|
|
|
cmake
|
2022-08-12 12:06:08 +00:00
|
|
|
];
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
buildInputs = [
|
|
|
|
openssl
|
|
|
|
] ++ lib.optionals withGui [
|
|
|
|
fontconfig
|
|
|
|
glib
|
|
|
|
gtk3
|
|
|
|
freetype
|
2022-08-12 12:06:08 +00:00
|
|
|
openssl
|
|
|
|
xorg.libxcb
|
|
|
|
xorg.libX11
|
|
|
|
xorg.libXcursor
|
|
|
|
xorg.libXrandr
|
|
|
|
xorg.libXi
|
|
|
|
xorg.libxcb
|
|
|
|
libGL
|
|
|
|
libGL.dev
|
|
|
|
];
|
|
|
|
|
|
|
|
buildNoDefaultFeatures = true;
|
|
|
|
buildFeatures = [ (if withGui then "egui" else "cli") ];
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
patchelf --set-rpath "${lib.makeLibraryPath buildInputs}" $out/bin/rusty-psn
|
|
|
|
'' + lib.optionalString withGui ''
|
|
|
|
mv $out/bin/rusty-psn $out/bin/rusty-psn-gui
|
|
|
|
'';
|
|
|
|
|
|
|
|
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"
|
|
|
|
];
|
|
|
|
});
|
|
|
|
desktopItems = lib.optionals withGui [ desktopItem ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
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 maintainers; [ AngryAnt ];
|
2024-02-29 20:09:43 +00:00
|
|
|
mainProgram = "rusty-psn";
|
2022-08-12 12:06:08 +00:00
|
|
|
};
|
|
|
|
}
|