2022-11-21 17:40:18 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2022-01-13 20:06:32 +00:00
|
|
|
pname = "libmodbus";
|
2022-12-17 10:02:37 +00:00
|
|
|
version = "3.1.10";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "stephane";
|
|
|
|
repo = "libmodbus";
|
|
|
|
rev = "v${version}";
|
2022-12-17 10:02:37 +00:00
|
|
|
hash = "sha256-e2lB5D41a5MOmz9M90ZXfIltSOxNDOrQUpRNU2yYd1k=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
configureFlags = [
|
|
|
|
# when cross-compiling we assume that the host system will return a valid
|
|
|
|
# pointer for calls to malloc(0) or realloc(0)
|
|
|
|
# https://www.uclibc.org/FAQ.html#gnu_malloc
|
|
|
|
# https://www.gnu.org/software/autoconf/manual/autoconf.html#index-AC_005fFUNC_005fMALLOC-454
|
|
|
|
# the upstream source should be patched to avoid needing this
|
|
|
|
"ac_cv_func_malloc_0_nonnull=yes"
|
|
|
|
"ac_cv_func_realloc_0_nonnull=yes"
|
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Library to send/receive data according to the Modbus protocol";
|
|
|
|
homepage = "https://libmodbus.org/";
|
|
|
|
license = licenses.lgpl21Plus;
|
2024-09-19 14:19:46 +00:00
|
|
|
platforms = with platforms; unix ++ windows;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = [ maintainers.bjornfor ];
|
|
|
|
};
|
|
|
|
}
|