From 4ee4fa98d522ccea580c0afafaf20ddec45c81f7 Mon Sep 17 00:00:00 2001 From: Chahatpreet Singh Date: Tue, 2 Jun 2026 16:49:47 +0000 Subject: [PATCH] bacnet-stack: 1.3.5 -> 1.5.0 - Switch from manual `make` invocation to CMake, which is the upstream- supported build system in 1.5.0 and handles datalink/app selection correctly. - Drop `hardeningDisable = [ "all" ]`; the package now builds with the default nixpkgs hardening flags. - Drop `BUILD=debug`; ship a release build. - Add `postInstall` to copy the app binaries to `$out/bin`. Upstream's CMakeLists builds the apps via `add_executable()` but does not declare `install(TARGETS ...)` rules for them, so they are not picked up by `make install`. - Add `meta.homepage` and `meta.changelog`. --- pkgs/by-name/ba/bacnet-stack/package.nix | 33 ++++++++++++++---------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/pkgs/by-name/ba/bacnet-stack/package.nix b/pkgs/by-name/ba/bacnet-stack/package.nix index 5f5e744a2f33..a97343ea89a9 100644 --- a/pkgs/by-name/ba/bacnet-stack/package.nix +++ b/pkgs/by-name/ba/bacnet-stack/package.nix @@ -2,35 +2,42 @@ lib, stdenv, fetchFromGitHub, + cmake, }: stdenv.mkDerivation (finalAttrs: { pname = "bacnet-stack"; - version = "1.3.5"; + version = "1.5.0"; src = fetchFromGitHub { owner = "bacnet-stack"; repo = "bacnet-stack"; - rev = "bacnet-stack-${finalAttrs.version}"; - sha256 = "sha256-Iwo0bNulKdFNwNU2xj6Uin+5hQt1I3N6+zso5BHrIOU="; + tag = "bacnet-stack-${finalAttrs.version}"; + hash = "sha256-CJmEEIGT6u2nsnl3btWL/JJPxQM53JF6l+mLBSF+Q8Q="; }; - hardeningDisable = [ "all" ]; + nativeBuildInputs = [ cmake ]; - buildPhase = '' - make BUILD=debug BACNET_PORT=linux BACDL_DEFINE=-DBACDL_BIP=1 BACNET_DEFINES=" -DPRINT_ENABLED=1 -DBACFILE -DBACAPP_ALL -DBACNET_PROPERTY_LISTS" - ''; - - installPhase = '' - mkdir $out - cp -r bin $out/bin + # bacnet-stack's CMakeLists builds the apps via add_executable() but never + # adds install(TARGETS ...) rules for them, so `make install` skips them. + # Copy them out of the CMake build tree manually. + postInstall = '' + mkdir -p $out/bin + find . -maxdepth 2 -type f -executable -not -name '*.so*' -not -name '*.a' \ + -exec cp -t $out/bin {} + ''; meta = { description = "BACnet open source protocol stack for embedded systems, Linux, and Windows"; homepage = "https://github.com/bacnet-stack/bacnet-stack"; - platforms = lib.platforms.linux; - license = lib.licenses.gpl2Plus; + changelog = "https://github.com/bacnet-stack/bacnet-stack/blob/bacnet-stack-${finalAttrs.version}/CHANGELOG.md"; + license = with lib.licenses; [ + gpl2Plus # Core stack (WITH GCC-exception-2.0) + mit # Examples and applications + asl20 # Auxiliary files (SPDX identified) + bsd3 # Auxiliary files (SPDX identified) + ]; maintainers = with lib.maintainers; [ WhittlesJr ]; + platforms = lib.platforms.linux; }; })