electron_32: fix log spam when building on aarch64-linux (#378988)
[NixPkgs.git] / pkgs / by-name / de / desktop-postflop / package.nix
blobfb3b8269c9f9f95a3cb8c3ab9f1ef13943d8a6a4
2   lib,
3   rustPlatform,
4   buildNpmPackage,
5   fetchFromGitHub,
6   copyDesktopItems,
7   makeDesktopItem,
8   pkg-config,
9   gtk3,
10   libsoup_2_4,
11   webkitgtk_4_0,
14 rustPlatform.buildRustPackage rec {
15   pname = "desktop-postflop";
16   version = "0.2.7";
18   src = fetchFromGitHub {
19     owner = "b-inary";
20     repo = "desktop-postflop";
21     rev = "v${version}";
22     hash = "sha256-pOPxNHM4mseIuyyWNoU0l+dGvfURH0+9+rmzRIF0I5s=";
23   };
25   npmDist = buildNpmPackage {
26     name = "${pname}-${version}-dist";
27     inherit src;
29     npmDepsHash = "sha256-HWZLicyKL2FHDjZQj9/CRwVi+uc/jHmVNxtlDuclf7s=";
31     installPhase = ''
32       mkdir -p $out
33       cp -r dist/* $out
34     '';
35   };
37   sourceRoot = "${src.name}/src-tauri";
39   cargoLock = {
40     lockFile = ./Cargo.lock;
41     outputHashes = {
42       "postflop-solver-0.1.0" = "sha256-coEl09eMbQqSos1sqWLnfXfhujSTsnVnOlOQ+JbdFWY=";
43     };
44   };
46   postPatch = ''
47     substituteInPlace tauri.conf.json \
48         --replace "../dist" "${npmDist}"
49   '';
51   # postflop-solver requires unstable rust features
52   env.RUSTC_BOOTSTRAP = 1;
54   nativeBuildInputs = [
55     copyDesktopItems
56     pkg-config
57   ];
59   buildInputs = [
60     gtk3
61     libsoup_2_4
62     webkitgtk_4_0
63   ];
65   postInstall = ''
66     install -Dm644 ${src}/public/favicon.png $out/share/icons/hicolor/128x128/apps/desktop-postflop.png
67   '';
69   desktopItems = [
70     (makeDesktopItem {
71       name = "desktop-postflop";
72       exec = "desktop-postflop";
73       icon = "desktop-postflop";
74       desktopName = "Desktop Postflop";
75       comment = meta.description;
76       categories = [ "Utility" ];
77       terminal = false;
78     })
79   ];
81   meta = {
82     changelog = "https://github.com/b-inary/desktop-postflop/releases/tag/${src.rev}";
83     description = "Free, open-source GTO solver for Texas hold'em poker";
84     homepage = "https://github.com/b-inary/desktop-postflop";
85     license = lib.licenses.agpl3Plus;
86     mainProgram = "desktop-postflop";
87     maintainers = with lib.maintainers; [ tomasajt ];
88   };