From b6044982352ea07f05907febbb63beefda2bd41a Mon Sep 17 00:00:00 2001 From: Petr Zahradnik Date: Tue, 4 Mar 2025 23:05:47 +0100 Subject: [PATCH 1/2] domoticz: fix build on GCC 14, Boost 1.87 --- pkgs/by-name/do/domoticz/package.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/do/domoticz/package.nix b/pkgs/by-name/do/domoticz/package.nix index ac98513ac698..03cab2432666 100644 --- a/pkgs/by-name/do/domoticz/package.nix +++ b/pkgs/by-name/do/domoticz/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitHub, + fetchpatch, makeWrapper, cmake, python3, @@ -17,6 +18,7 @@ git, libusb-compat-0_1, cereal, + minizip, }: stdenv.mkDerivation rec { @@ -28,9 +30,16 @@ stdenv.mkDerivation rec { repo = pname; rev = version; hash = "sha256-D8U1kK3m1zT83YvZ42hGSU9PzBfS1VGr2mxUYbM2vNQ="; - fetchSubmodules = true; }; + patches = [ + # Boost 1.87 compatibility, remove once upgraded to 2025.1 + (fetchpatch { + url = "https://github.com/domoticz/domoticz/commit/5d0db89bbd120ed5dc05b4ff8c136f14a42f0cd3.patch"; + hash = "sha256-FPe83yJKJEgnY3kABy9CTRe1CBh42dPG1ZWCUE5PO8E="; + }) + ]; + buildInputs = [ openssl python3 @@ -44,6 +53,7 @@ stdenv.mkDerivation rec { git libusb-compat-0_1 cereal + minizip ]; nativeBuildInputs = [ @@ -60,7 +70,7 @@ stdenv.mkDerivation rec { "-DUSE_BUILTIN_ZLIB=false" "-DUSE_OPENSSL_STATIC=false" "-DUSE_STATIC_BOOST=false" - "-DUSE_BUILTIN_MINIZIP=true" + "-DUSE_BUILTIN_MINIZIP=false" ]; installPhase = '' From fe92c2a63a461232b11aa7ec04098958a156c459 Mon Sep 17 00:00:00 2001 From: Petr Zahradnik Date: Tue, 4 Mar 2025 23:12:44 +0100 Subject: [PATCH 2/2] domoticz: modernize derivation --- pkgs/by-name/do/domoticz/package.nix | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/do/domoticz/package.nix b/pkgs/by-name/do/domoticz/package.nix index 03cab2432666..e9e10aae3263 100644 --- a/pkgs/by-name/do/domoticz/package.nix +++ b/pkgs/by-name/do/domoticz/package.nix @@ -19,16 +19,17 @@ libusb-compat-0_1, cereal, minizip, + versionCheckHook, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "domoticz"; version = "2024.7"; src = fetchFromGitHub { owner = "domoticz"; - repo = pname; - rev = version; + repo = "domoticz"; + tag = finalAttrs.version; hash = "sha256-D8U1kK3m1zT83YvZ42hGSU9PzBfS1VGr2mxUYbM2vNQ="; }; @@ -85,19 +86,24 @@ stdenv.mkDerivation rec { wrapProgram $out/bin/domoticz --set LD_LIBRARY_PATH ${python3}/lib; ''; - meta = with lib; { + nativeInstallCheckInputs = [ + versionCheckHook + ]; + doInstallCheck = true; + + meta = { description = "Home automation system"; longDescription = '' Domoticz is a home automation system that lets you monitor and configure various devices like: lights, switches, various sensors/meters like temperature, rain, wind, UV, electra, gas, water and much more ''; - maintainers = with maintainers; [ edcragg ]; + maintainers = with lib.maintainers; [ edcragg ]; homepage = "https://www.domoticz.com/"; - changelog = "https://github.com/domoticz/domoticz/blob/${version}/History.txt"; - license = licenses.gpl3Plus; - platforms = platforms.all; + changelog = "https://github.com/domoticz/domoticz/blob/${finalAttrs.version}/History.txt"; + license = lib.licenses.gpl3Plus; + platforms = lib.platforms.all; broken = stdenv.hostPlatform.isDarwin; # never built on Hydra https://hydra.nixos.org/job/nixpkgs/staging-next/domoticz.x86_64-darwin mainProgram = "domoticz"; }; -} +})