1 { lib, stdenv, fetchFromGitHub, autoreconfHook }:
3 stdenv.mkDerivation rec {
7 src = fetchFromGitHub {
11 hash = "sha256-d/diR9yeV0WY0C6wqxYZfOjEKFeWTvN73MxcWtXPOJc=";
14 nativeBuildInputs = [ autoreconfHook ];
17 # when cross-compiling we assume that the host system will return a valid
18 # pointer for calls to malloc(0) or realloc(0)
19 # https://www.uclibc.org/FAQ.html#gnu_malloc
20 # https://www.gnu.org/software/autoconf/manual/autoconf.html#index-AC_005fFUNC_005fMALLOC-454
21 # the upstream source should be patched to avoid needing this
22 "ac_cv_func_malloc_0_nonnull=yes"
23 "ac_cv_func_realloc_0_nonnull=yes"
27 description = "Library to send/receive data according to the Modbus protocol";
28 homepage = "https://libmodbus.org/";
29 license = licenses.lgpl21Plus;
30 platforms = with platforms; unix ++ windows;
31 maintainers = [ maintainers.bjornfor ];