nixpkgs/pkgs/by-name/ne/netifd/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

60 lines
1.4 KiB
Nix

{ lib
, stdenv
, cmake
, fetchgit
, libnl
, libubox
, uci
, ubus
, json_c
, pkg-config
, udebug
}:
stdenv.mkDerivation {
pname = "netifd";
version = "unstable-2023-11-27";
src = fetchgit {
url = "https://git.openwrt.org/project/netifd.git";
rev = "02bc2e14d1d37500e888c0c53ac41398a56b5579";
hash = "sha256-aMs/Y50+1Yk/j5jGubjBCRcPGw03oIitvEygaxRlr90=";
};
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";
homepage = "https://git.openwrt.org/?p=project/netifd.git;a=summary";
license = licenses.lgpl21Only;
platforms = platforms.linux;
maintainers = with maintainers; [ mkg20001 ];
mainProgram = "netifd";
};
}