2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
2022-11-21 17:40:18 +00:00
|
|
|
, meson, ninja, pkg-config, cmake
|
2021-02-05 17:12:51 +00:00
|
|
|
, libtirpc, rpcsvc-proto, avahi, libxml2
|
|
|
|
}:
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-02-05 17:12:51 +00:00
|
|
|
pname = "liblxi";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "1.20";
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lxi-tools";
|
|
|
|
repo = "liblxi";
|
2024-06-20 14:57:18 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-jS0huNkbyKrsJ3NkenrYtjkzLakOsTJpwlgSo98ribE=";
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
postPatch = ''
|
|
|
|
# needed by darwin
|
|
|
|
sed -e 1i'#include <string.h>' \
|
|
|
|
-e 1i'#include <stdlib.h>' \
|
|
|
|
-i src/bonjour.c
|
|
|
|
'';
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
nativeBuildInputs = [ meson ninja cmake pkg-config rpcsvc-proto ];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
buildInputs = lib.optionals (!stdenv.isDarwin) [
|
|
|
|
libtirpc
|
|
|
|
avahi
|
|
|
|
] ++ [
|
|
|
|
libxml2
|
|
|
|
];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Library for communicating with LXI compatible instruments";
|
|
|
|
longDescription = ''
|
|
|
|
liblxi is an open source software library which offers a simple
|
|
|
|
API for communicating with LXI compatible instruments.
|
|
|
|
The API allows applications to easily discover instruments
|
|
|
|
on networks and communicate SCPI commands.
|
|
|
|
'';
|
|
|
|
homepage = "https://lxi-tools.github.io/";
|
|
|
|
license = licenses.bsd3;
|
2023-07-15 17:15:38 +00:00
|
|
|
platforms = platforms.unix;
|
2021-02-05 17:12:51 +00:00
|
|
|
maintainers = [ maintainers.vq ];
|
|
|
|
};
|
2024-06-20 14:57:18 +00:00
|
|
|
})
|