gnu: libmodbus: Update to 3.1.11.

* gnu/packages/engineering.scm (libmodbus): Update to 3.1.11.  Add a missing
newline after the package definition.
[source]: Add a patch which disables a test that requires networking.
* gnu/packages/patches/libmodbus-disable-networking-test.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.

Change-Id: I657c0aac3435ec20da6e15d31484effdb7c2dc0b
This commit is contained in:
Artyom V. Poptsov 2025-03-23 10:00:16 +03:00
parent da09013802
commit 92e3cb2e65
No known key found for this signature in database
GPG key ID: 935EBE0736DC857E
3 changed files with 45 additions and 4 deletions

View file

@ -49,7 +49,7 @@
# Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
# Copyright © 2022 Daniel Meißner <daniel.meissner-i4k@ruhr-uni-bochum.de>
# Copyright © 2022, 2024 Remco van 't Veer <remco@remworks.net>
# Copyright © 2022, 2024 Artyom V. Poptsov <poptsov.artyom@gmail.com>
# Copyright © 2022, 2024, 2025 Artyom V. Poptsov <poptsov.artyom@gmail.com>
# Copyright © 2022, 2023 John Kehayias <john.kehayias@protonmail.com>
# Copyright © 2022 muradm <mail@muradm.net>
# Copyright © 2022 Hilton Chain <hako@ultrarare.space>
@ -1843,6 +1843,7 @@ dist_patch_DATA = \
%D%/packages/patches/mcrypt-CVE-2012-4527.patch \
%D%/packages/patches/libmemcached-build-with-gcc7.patch \
%D%/packages/patches/libmhash-hmac-fix-uaf.patch \
%D%/packages/patches/libmodbus-disable-networking-test.patch \
%D%/packages/patches/lib-tl-for-telegram-memcpy.patch \
%D%/packages/patches/llama-cpp-vulkan-optional.patch \
%D%/packages/patches/llhttp-ponyfill-object-fromentries.patch \

View file

@ -1733,7 +1733,7 @@ send break and throttle transmission speed.")
(define-public libmodbus
(package
(name "libmodbus")
(version "3.1.10")
(version "3.1.11")
(source (origin
(method git-fetch)
(uri (git-reference
@ -1742,15 +1742,20 @@ send break and throttle transmission speed.")
(file-name (git-file-name name version))
(sha256
(base32
"0nbpk1n56kclab8fl32dxi46v2bwax3gfk1zkc796srm7vj42sbv"))))
"15rqrzamlp6cvixz6klnawlc9s3w34bapc1fs2c4amwyvi3n5xvp"))
;; The patch removes a test that requires networking.
;; See <https://github.com/stephane/libmodbus/issues/802>
(patches
(search-patches "libmodbus-disable-networking-test.patch"))))
(build-system gnu-build-system)
(native-inputs (list autoconf automake libtool))
(native-inputs (list autoconf psmisc automake libtool))
(synopsis "Library for the Modbus protocol")
(description "@code{libmodbus} is a library to send/receive data with a
device which respects the Modbus protocol. This library can use a serial port
or an Ethernet connection.")
(home-page "https://libmodbus.org/")
(license license:lgpl2.1+)))
(define-public harminv
(package
(name "harminv")

View file

@ -0,0 +1,35 @@
From 4fc47d8711650a1385bea0652e522af2c85129bc Mon Sep 17 00:00:00 2001
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Date: Sun, 23 Mar 2025 09:44:34 +0300
Subject: [PATCH] tests/unit-test-client: Disable a test requiring networking
* tests/unit-test-client.c (main): Disable the test that requires networking
as it fails with "Network is unreachable" (errno: 101) in environments where
networking is not available (e.g. GNU Guix.) See
<https://github.com/stephane/libmodbus/issues/802>.
---
tests/unit-test-client.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/tests/unit-test-client.c b/tests/unit-test-client.c
index a1813b1..58eaf5f 100644
--- a/tests/unit-test-client.c
+++ b/tests/unit-test-client.c
@@ -671,14 +671,6 @@ int main(int argc, char *argv[])
printf("7/8 Disable byte timeout: ");
ASSERT_TRUE(rc == 1, "");
- // Invalid in TCP or RTU mode...
- modbus_t *invalid_ctx = modbus_new_tcp("1.2.3.4", 1502);
- modbus_set_response_timeout(ctx, 0, 1);
- rc = modbus_connect(invalid_ctx);
- printf("8/8 Connection timeout: ");
- ASSERT_TRUE(rc == -1 && errno == ETIMEDOUT, "");
- modbus_free(invalid_ctx);
-
/* Restore original response timeout */
modbus_set_response_timeout(ctx, old_response_to_sec, old_response_to_usec);
--
2.48.1