2024-09-08 01:08:59 +02:00
|
|
|
{ stdenv, fetchFromGitea, lib, cmake, libubox, json_c, lua, defaultSocketLocation ? "/run/ubus/ubus.sock" }:
|
2024-09-04 15:53:26 +02:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "ubus";
|
|
|
|
version = "unstable-04-09-2024";
|
|
|
|
|
2024-09-08 01:08:59 +02:00
|
|
|
src = fetchFromGitea {
|
|
|
|
domain = "git.dgnum.eu";
|
|
|
|
owner = "DGNum";
|
2024-09-04 15:53:26 +02:00
|
|
|
repo = "ubus";
|
2024-09-08 01:08:59 +02:00
|
|
|
rev = "ebb1dc92e4985538a8e18b7e926264118138f281";
|
|
|
|
hash = "sha256-fo4zleC9R6uzlcOJ/jQ0t0nSBHUAq/uqPVd9xJdkAM0=";
|
2024-09-04 15:53:26 +02:00
|
|
|
};
|
|
|
|
|
2024-09-07 17:35:09 +02:00
|
|
|
# We don't use /var/run/ in Liminix by default.
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace CMakeLists.txt \
|
|
|
|
--replace-fail "/var/run/ubus/ubus.sock" "${defaultSocketLocation}"
|
|
|
|
'';
|
|
|
|
|
2024-09-04 15:53:26 +02:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2024-09-08 01:08:59 +02:00
|
|
|
lua
|
2024-09-04 15:53:26 +02:00
|
|
|
libubox
|
|
|
|
json_c
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
2024-09-04 16:30:44 +02:00
|
|
|
"-DBUILD_LUA=on"
|
2024-09-08 01:08:59 +02:00
|
|
|
"-DLUAPATH=${placeholder "out"}/lib/lua/${lua.luaversion}"
|
2024-09-04 15:53:26 +02:00
|
|
|
"-DBUILD_EXAMPLES=off"
|
|
|
|
];
|
|
|
|
}
|