2023-09-07 17:06:52 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchurl
|
|
|
|
, wrapQtAppsHook
|
|
|
|
, dpkg
|
|
|
|
, autoPatchelfHook
|
|
|
|
, qtserialport
|
|
|
|
, qtwebsockets
|
|
|
|
, openssl
|
|
|
|
, libredirect
|
|
|
|
, makeWrapper
|
|
|
|
, gzip
|
|
|
|
, gnutar
|
2023-09-17 18:05:48 +00:00
|
|
|
, nixosTests
|
2023-09-07 17:06:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "deconz";
|
2024-08-16 09:15:53 +00:00
|
|
|
version = "2.28.0";
|
2023-09-07 17:06:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://deconz.dresden-elektronik.de/ubuntu/beta/deconz-${version}-qt5.deb";
|
2024-08-16 09:15:53 +00:00
|
|
|
sha256 = "sha256-/lsPhpG8z4nNRuk55n7Xo1Q97muWk33Uo3vmX5GxPxU=";
|
2023-09-07 17:06:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ dpkg autoPatchelfHook makeWrapper wrapQtAppsHook ];
|
|
|
|
|
|
|
|
buildInputs = [ qtserialport qtwebsockets openssl ];
|
|
|
|
|
|
|
|
unpackPhase = ''
|
|
|
|
runHook preUnpack
|
|
|
|
|
|
|
|
dpkg -x $src ./deconz-src
|
|
|
|
|
|
|
|
runHook postUnpack
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p "$out"
|
|
|
|
cp -r deconz-src/* "$out"
|
|
|
|
|
|
|
|
# Flatten /usr and manually merge lib/ and usr/lib/, since mv refuses to.
|
|
|
|
mv "$out/lib" "$out/orig_lib"
|
|
|
|
mv "$out/usr/"* "$out/"
|
|
|
|
mkdir -p "$out/lib/systemd/system/"
|
|
|
|
mv "$out/orig_lib/systemd/system/"* "$out/lib/systemd/system/"
|
|
|
|
rmdir "$out/orig_lib/systemd/system"
|
|
|
|
rmdir "$out/orig_lib/systemd"
|
|
|
|
rmdir "$out/orig_lib"
|
|
|
|
rmdir "$out/usr"
|
|
|
|
|
|
|
|
for f in "$out/lib/systemd/system/"*.service \
|
|
|
|
"$out/share/applications/"*.desktop; do
|
|
|
|
substituteInPlace "$f" \
|
|
|
|
--replace "/usr/" "$out/"
|
|
|
|
done
|
|
|
|
|
|
|
|
for p in "$out/bin/deCONZ" "$out/bin/GCFFlasher_internal.bin"; do
|
|
|
|
wrapProgram "$p" \
|
|
|
|
--set LD_PRELOAD "${libredirect}/lib/libredirect.so" \
|
|
|
|
--set NIX_REDIRECTS "/usr/share=$out/share:/usr/bin=$out/bin" \
|
|
|
|
--prefix PATH : "${lib.makeBinPath [ gzip gnutar ]}"
|
|
|
|
done
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2023-09-17 18:05:48 +00:00
|
|
|
passthru = {
|
|
|
|
tests = { inherit (nixosTests) deconz; };
|
|
|
|
};
|
|
|
|
|
2023-09-07 17:06:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Manage Zigbee network with ConBee, ConBee II or RaspBee hardware";
|
|
|
|
homepage = "https://www.dresden-elektronik.com/wireless/software/deconz.html";
|
|
|
|
license = licenses.unfree;
|
2023-09-17 17:38:34 +00:00
|
|
|
platforms = with platforms; [ "x86_64-linux" ];
|
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2023-09-07 17:06:52 +00:00
|
|
|
maintainers = with maintainers; [ bjornfor ];
|
2023-09-17 17:38:34 +00:00
|
|
|
mainProgram = "deCONZ";
|
2023-09-07 17:06:52 +00:00
|
|
|
};
|
|
|
|
}
|