evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / go / govee2mqtt / package.nix
blob41392d0022c13fe00a652fd6bffa1f9d80fbf95b
1 { rustPlatform
2 , lib
3 , fetchFromGitHub
4 , fetchpatch
5 , openssl
6 , pkg-config
7 }:
9 rustPlatform.buildRustPackage rec {
10   pname = "govee2mqtt";
11   version = "2024.01.24-ea3cd430";
13   src = fetchFromGitHub {
14     owner = "wez";
15     repo = "govee2mqtt";
16     rev = version;
17     hash = "sha256-iGOj0a4+wLd8QlM1tr+NYfd2tuwgHV+u5dt0zf+WscY=";
18   };
20   cargoPatches = [
21     ./dont-vendor-openssl.diff
22   ];
24   patches = [
25     # update test fixtures https://github.com/wez/govee2mqtt/pull/120
26     (fetchpatch {
27       url = "https://github.com/wez/govee2mqtt/commit/0c2dc3e1cc1ccd44ddf98ead34e081ac4b4335f1.patch";
28       hash = "sha256-0TNYyvRRcMkE9FYPcVoKburejhAn/cVYM3eaobS4nx8=";
29     })
30   ];
32   postPatch = ''
33     substituteInPlace src/service/http.rs \
34       --replace '"assets"' '"${placeholder "out"}/share/govee2mqtt/assets"'
35   '';
37   cargoHash = "sha256-wApf+H5T7HPkCGQwv8ePoDnStUn04oVvv3eIJ8aKVUw=";
39   nativeBuildInputs = [ pkg-config ];
41   buildInputs = [ openssl ];
43   postInstall = ''
44     mkdir -p $out/share/govee2mqtt/
45     cp -r assets $out/share/govee2mqtt/
46   '';
48   meta = with lib; {
49     description = "Connect Govee lights and devices to Home Assistant";
50     homepage = "https://github.com/wez/govee2mqtt";
51     changelog = "https://github.com/wez/govee2mqtt/blob/${src.rev}/addon/CHANGELOG.md";
52     license = licenses.mit;
53     maintainers = with maintainers; [ SuperSandro2000 ];
54     mainProgram = "govee";
55   };