govee2mqtt: init at 2024.01.24-ea3cd430

This commit is contained in:
Sandro Jäckel 2024-01-22 00:42:42 +01:00
parent bed631549e
commit 486222545b
No known key found for this signature in database
GPG Key ID: 3AF5A43A3EECC2E5
2 changed files with 97 additions and 0 deletions

View File

@ -0,0 +1,41 @@
diff --git a/Cargo.lock b/Cargo.lock
index 303f6f8..952a7ff 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1373,15 +1373,6 @@ version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
-[[package]]
-name = "openssl-src"
-version = "300.2.1+3.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3fe476c29791a5ca0d1273c697e96085bbabbbea2ef7afd5617e78a4b40332d3"
-dependencies = [
- "cc",
-]
-
[[package]]
name = "openssl-sys"
version = "0.9.98"
@@ -1390,7 +1381,6 @@ checksum = "c1665caf8ab2dc9aef43d1c0023bd904633a6a05cb30b0ad59bec2ae986e57a7"
dependencies = [
"cc",
"libc",
- "openssl-src",
"pkg-config",
"vcpkg",
]
diff --git a/Cargo.toml b/Cargo.toml
index a4cf25c..42fde6d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -44,7 +44,7 @@ parking_lot = "0.12.1"
[dependencies.mosquitto-rs]
version="0.11.1"
-features = ["vendored-openssl"]
+features = ["router"]
#path = "../mosquitto-rs/mosquitto-rs"
[dev-dependencies]

View File

@ -0,0 +1,56 @@
{ rustPlatform
, lib
, fetchFromGitHub
, fetchpatch
, openssl
, pkg-config
}:
rustPlatform.buildRustPackage rec {
pname = "govee2mqtt";
version = "2024.01.24-ea3cd430";
src = fetchFromGitHub {
owner = "wez";
repo = "govee2mqtt";
rev = version;
hash = "sha256-iGOj0a4+wLd8QlM1tr+NYfd2tuwgHV+u5dt0zf+WscY=";
};
cargoPatches = [
./dont-vendor-openssl.diff
];
patches = [
# update test fixtures https://github.com/wez/govee2mqtt/pull/120
(fetchpatch {
url = "https://github.com/wez/govee2mqtt/commit/0c2dc3e1cc1ccd44ddf98ead34e081ac4b4335f1.patch";
hash = "sha256-0TNYyvRRcMkE9FYPcVoKburejhAn/cVYM3eaobS4nx8=";
})
];
postPatch = ''
substituteInPlace src/service/http.rs \
--replace '"assets"' '"${placeholder "out"}/share/govee2mqtt/assets"'
'';
cargoHash = "sha256-wApf+H5T7HPkCGQwv8ePoDnStUn04oVvv3eIJ8aKVUw=";
nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl ];
postInstall = ''
mkdir -p $out/share/govee2mqtt/
cp -r assets $out/share/govee2mqtt/
'';
meta = with lib; {
description = "Connect Govee lights and devices to Home Assistant";
homepage = "https://github.com/wez/govee2mqtt";
changelog = "https://github.com/wez/govee2mqtt/blob/${src.rev}/addon/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ SuperSandro2000 ];
mainProgram = "govee";
};
}