evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / po / pop-launcher / package.nix
blob4e98ec2d33088aa91ae8f2b2656feab5282e78a3
2   stdenv,
3   rustPlatform,
4   fetchFromGitHub,
5   lib,
6   just,
7   pkg-config,
8   fd,
9   libqalculate,
10   libxkbcommon,
13 rustPlatform.buildRustPackage rec {
14   pname = "pop-launcher";
15   version = "1.2.4";
17   src = fetchFromGitHub {
18     owner = "pop-os";
19     repo = "launcher";
20     rev = version;
21     hash = "sha256-CLpquNgdtnGMlMpGLv72WZmizalvYPfMWlE/qLprVrs=";
22   };
24   nativeBuildInputs = [
25     just
26     pkg-config
27   ];
28   buildInputs = [
29     libxkbcommon
30   ];
32   cargoLock = {
33     lockFile = ./Cargo.lock;
34     outputHashes = {
35       "cosmic-client-toolkit-0.1.0" = "sha256-6XM6kcM2CEGAziCkal4uO0EL1nEWOKb3rFs7hFh6r7Y=";
36       "switcheroo-control-0.1.0" = "sha256-mklNPKVMO6iFrxki2DwiL5K78KiWpGxksisYldaASIE=";
37     };
38   };
39   cargoBuildFlags = [
40     "--package"
41     "pop-launcher-bin"
42   ];
43   cargoTestFlags = [
44     "--package"
45     "pop-launcher-bin"
46   ];
48   dontUseJustBuild = true;
49   dontUseJustCheck = true;
50   justFlags = [
51     "--set"
52     "base-dir"
53     (placeholder "out")
54     "--set"
55     "target-dir"
56     "target/${stdenv.hostPlatform.rust.cargoShortTarget}/release"
57   ];
59   postPatch = ''
60     substituteInPlace justfile --replace-fail '#!/usr/bin/env' "#!$(command -v env)"
62     substituteInPlace src/lib.rs \
63         --replace-fail '/usr/lib/pop-launcher' "$out/share/pop-launcher"
64     substituteInPlace plugins/src/scripts/mod.rs \
65         --replace-fail '/usr/lib/pop-launcher' "$out/share/pop-launcher"
66     substituteInPlace plugins/src/calc/mod.rs \
67         --replace-fail 'Command::new("qalc")' 'Command::new("${libqalculate}/bin/qalc")'
68     substituteInPlace plugins/src/find/mod.rs \
69         --replace-fail 'spawn("fd")' 'spawn("${fd}/bin/fd")'
70     substituteInPlace plugins/src/terminal/mod.rs \
71         --replace-fail '/usr/bin/gnome-terminal' 'gnome-terminal'
72   '';
74   meta = with lib; {
75     description = "Modular IPC-based desktop launcher service";
76     homepage = "https://github.com/pop-os/launcher";
77     platforms = platforms.linux;
78     license = licenses.mpl20;
79     maintainers = with maintainers; [ samhug ];
80     mainProgram = "pop-launcher";
81   };