liminix/pkgs/ubus/default.nix
Raito Bezarius 1a770910a6 fix(ubus): rendez vous URL for the unix socket
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-07 17:48:06 +02:00

34 lines
780 B
Nix

{ stdenv, fetchFromGitHub, cmake, libubox, json_c, lua5_1, defaultSocketLocation ? "/run/ubus/ubus.sock" }:
stdenv.mkDerivation {
pname = "ubus";
version = "unstable-04-09-2024";
src = fetchFromGitHub {
owner = "openwrt";
repo = "ubus";
rev = "65bb027054def3b94a977229fd6ad62ddd32345b";
hash = "sha256-n82Ub0IiuvWbnlDCoN+0hjo/1PbplEbc56kuOYMrHxQ=";
};
# We don't use /var/run/ in Liminix by default.
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace-fail "/var/run/ubus/ubus.sock" "${defaultSocketLocation}"
'';
nativeBuildInputs = [
cmake
];
buildInputs = [
lua5_1
libubox
json_c
];
cmakeFlags = [
"-DBUILD_LUA=on"
"-DLUAPATH=${placeholder "out"}/lib/lua"
"-DBUILD_EXAMPLES=off"
];
}