From a40f69d5ec71d297676799e99c74f59f3783776b Mon Sep 17 00:00:00 2001 From: Manuel Date: Wed, 29 Jul 2026 10:59:32 +0200 Subject: [PATCH 1/2] deps(libiec61850): Update to 1.6.2 Signed-off-by: Manuel Signed-off-by: Steffen Vogel --- packaging/deps.sh | 4 +-- .../patches/libiec61850_debug_r_session.patch | 31 ------------------- 2 files changed, 2 insertions(+), 33 deletions(-) mode change 100644 => 100755 packaging/deps.sh delete mode 100644 packaging/patches/libiec61850_debug_r_session.patch diff --git a/packaging/deps.sh b/packaging/deps.sh old mode 100644 new mode 100755 index d3270a27a..f0a843ecb --- a/packaging/deps.sh +++ b/packaging/deps.sh @@ -258,9 +258,9 @@ if ! pkg-config "libethercat >= 1.5.2" && \ fi # Build & Install libiec61850 -if ! pkg-config "libiec61850 >= 1.6.0" && \ +if ! pkg-config "libiec61850 >= 1.6.2" && \ should_build "iec61850" "for the iec61850 node-type"; then - git clone ${GIT_OPTS} --branch v1.6.1 https://github.com/mz-automation/libiec61850.git + git clone ${GIT_OPTS} --branch v1.6.2 https://github.com/mz-automation/libiec61850.git pushd libiec61850/third_party/mbedtls/ curl -L https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/v3.6.0.tar.gz | tar -xz diff --git a/packaging/patches/libiec61850_debug_r_session.patch b/packaging/patches/libiec61850_debug_r_session.patch deleted file mode 100644 index a803f36c2..000000000 --- a/packaging/patches/libiec61850_debug_r_session.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/src/r_session/r_session.c b/src/r_session/r_session.c -index 538ad8ec..c15d2f9c 100644 ---- a/src/r_session/r_session.c -+++ b/src/r_session/r_session.c -@@ -89,7 +89,7 @@ struct sRSession - int timeToNextKey; - }; - --#ifdef DEBUG_RSESSION -+#if (DEBUG_RSESSION == 1) - static void - printBuffer(uint8_t* buffer, int bufSize) - { -@@ -1000,7 +1000,7 @@ encodePacket(RSession self, uint8_t payloadType, uint8_t* buffer, int bufPos, RS - int addPartSize = encryptedPartStartPos - startPos; - int encryptedPartSize = payloadEndPos - encryptedPartStartPos; - --#ifdef DEBUG_RSESSION -+#if (DEBUG_RSESSION == 1) - printBuffer(buffer + startPos, bufPos - startPos); - #endif - -@@ -1053,7 +1053,7 @@ RSession_sendMessage(RSession self, RSessionProtocol_SPDU_ID spduId, bool simula - - int msgSize = encodePacket(self, (uint8_t) spduId, self->sendBuffer, 0, &element); - --#ifdef DEBUG_RSESSION -+#if (DEBUG_RSESSION == 1) - printBuffer(self->sendBuffer, msgSize); - #endif - From 2157dd63742b8465b39f0bc8c1563a96acfb9025 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sun, 2 Aug 2026 19:43:59 +0200 Subject: [PATCH 2/2] chore(deps): Update Nixpkgs flake input As part of this update libiec61850 got updated to v1.6.2. This makes r_session the patch now finally fully obsolete. Signed-off-by: Steffen Vogel --- flake.lock | 8 ++++---- flake.nix | 5 ----- packaging/nix/patches.nix | 23 ----------------------- 3 files changed, 4 insertions(+), 32 deletions(-) delete mode 100644 packaging/nix/patches.nix diff --git a/flake.lock b/flake.lock index cbc90502f..3ed6b5a89 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1785141334, - "narHash": "sha256-kh35kIx7el4Jk8Ki3BH9/Pn1eZYSYLJ6LMALos0zOy0=", + "lastModified": 1785602060, + "narHash": "sha256-z7D96eESRM4CPV/XtwpwFn8IDdfLAmxz6lVWrGYXvR4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "38a4887411571457d700c51c64a6e49ead2ed5ab", + "rev": "a5cbcfe954791221bfffe2307f7d1a1bf61a871e", "type": "github" }, "original": { @@ -24,4 +24,4 @@ }, "root": "root", "version": 7 -} +} \ No newline at end of file diff --git a/flake.nix b/flake.nix index 25db1bef6..6cdc7c197 100644 --- a/flake.nix +++ b/flake.nix @@ -46,7 +46,6 @@ inherit system; overlays = with self.overlays; [ default - patches ]; }; @@ -57,7 +56,6 @@ inherit system; overlays = with self.overlays; [ default - patches debug ]; }; @@ -129,8 +127,6 @@ overlays = { default = final: prev: packagesWith final; - patches = import ./packaging/nix/patches.nix; - debug = final: prev: { jansson = addSeparateDebugInfo prev.jansson; libmodbus = addSeparateDebugInfo prev.libmodbus; @@ -229,7 +225,6 @@ imports = [ (nixDir + "/module.nix") ]; nixpkgs.overlays = [ self.overlays.default - self.overlays.patches ]; }; }; diff --git a/packaging/nix/patches.nix b/packaging/nix/patches.nix deleted file mode 100644 index 796f67c6c..000000000 --- a/packaging/nix/patches.nix +++ /dev/null @@ -1,23 +0,0 @@ -# SPDX-FileCopyrightText: 2025 Institute for Automation of Complex Power Systems, RWTH Aachen University# -# SPDX-License-Identifier: Apache-2.0 -# -# This overlay contains patches to dependencies of villas-node. -# It is only guaranteed to work for the locked version of nixpkgs, -# future updates to upstream nixpkgs may make these obsolete. -final: prev: -let - inherit (final) lib; -in -{ - libiec61850 = prev.libiec61850.overrideAttrs { - patches = [ ../patches/libiec61850_debug_r_session.patch ]; - cmakeFlags = (prev.cmakeFlags or [ ]) ++ [ - "-DCONFIG_USE_EXTERNAL_MBEDTLS_DYNLIB=ON" - "-DCONFIG_EXTERNAL_MBEDTLS_DYNLIB_PATH=${final.mbedtls}/lib" - "-DCONFIG_EXTERNAL_MBEDTLS_INCLUDE_PATH=${final.mbedtls}/include" - ]; - nativeBuildInputs = (prev.nativeBuildInputs or [ ]) ++ [ final.buildPackages.cmake ]; - buildInputs = [ final.mbedtls ]; - separateDebugInfo = true; - }; -}