about summary refs log tree commit diff
path: root/pkgs/tools/networking/netifd
diff options
context:
space:
mode:
authorMaciej Krüger <mkg20001@gmail.com>2023-11-28 23:56:32 +0100
committerMaciej Krüger <mkg20001@gmail.com>2023-12-07 12:19:03 +0100
commitb91ec1976c39a53715ed7ee6d2a894da1697fd03 (patch)
treed4aa451851d8e1c8f6ecd6a815900abc7dbfb87d /pkgs/tools/networking/netifd
parentf54c943f10644f68b43531bf715ac60513173f9c (diff)
netifd: unstable-2021-04-03 -> unstable-2023-11-27
Diffstat (limited to 'pkgs/tools/networking/netifd')
-rw-r--r--pkgs/tools/networking/netifd/default.nix47
1 files changed, 41 insertions, 6 deletions
diff --git a/pkgs/tools/networking/netifd/default.nix b/pkgs/tools/networking/netifd/default.nix
index 25aada6e3c446..59b2e47329801 100644
--- a/pkgs/tools/networking/netifd/default.nix
+++ b/pkgs/tools/networking/netifd/default.nix
@@ -1,17 +1,52 @@
-{ lib, stdenv, cmake, fetchgit, libnl, libubox, uci, ubus, json_c, pkg-config }:
+{ lib
+, stdenv
+, cmake
+, fetchgit
+, libnl
+, libubox
+, uci
+, ubus
+, json_c
+, pkg-config
+, udebug
+}:
 
 stdenv.mkDerivation {
   pname = "netifd";
-  version = "unstable-2021-04-03";
+  version = "unstable-2023-11-27";
 
   src = fetchgit {
     url = "https://git.openwrt.org/project/netifd.git";
-    rev = "327da9895327bc56b23413ee91a6e6b6e0e4329d";
-    sha256 = "0jvk2hx8kbkc6d72gh9rwap8ds6qgnmny6306vvzxy68v03xikwv";
+    rev = "02bc2e14d1d37500e888c0c53ac41398a56b5579";
+    hash = "sha256-aMs/Y50+1Yk/j5jGubjBCRcPGw03oIitvEygaxRlr90=";
   };
 
-  buildInputs = [ libnl libubox uci ubus json_c ];
-  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [
+    libnl.dev
+    libubox
+    uci
+    ubus
+    json_c
+    udebug
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+  ];
+
+  postPatch = ''
+    # by default this assumes the build directory is the source directory
+    # since we let cmake build in it's own build directory, we need to use
+    # $PWD (which at the time of this script being run is the directory with the source code)
+    # to adjust the paths
+    sed "s|./make_ethtool_modes_h.sh|$PWD/make_ethtool_modes_h.sh|g" -i CMakeLists.txt
+    sed "s|./ethtool-modes.h|$PWD/ethtool-modes.h|g" -i CMakeLists.txt
+  '';
+
+  env.NIX_CFLAGS_COMPILE = toString (lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
+    "-Wno-error=maybe-uninitialized"
+  ]);
 
   meta = with lib; {
     description = "OpenWrt Network interface configuration daemon";