uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
55
pkgs/os-specific/linux/netatop/default.nix
Normal file
55
pkgs/os-specific/linux/netatop/default.nix
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
{ lib, stdenv, fetchurl, kernel, kmod, zlib }:
|
||||
|
||||
let
|
||||
version = "3.1";
|
||||
in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "netatop-${kernel.version}-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://www.atoptool.nl/download/netatop-${version}.tar.gz";
|
||||
sha256 = "0qjw8glfdmngfvbn1w63q128vxdz2jlabw13y140ga9i5ibl6vvk";
|
||||
};
|
||||
|
||||
nativeBuildInputs = kernel.moduleBuildDependencies;
|
||||
buildInputs = [ kmod zlib ];
|
||||
|
||||
hardeningDisable = [ "pic" ];
|
||||
NIX_CFLAGS_COMPILE = [ "-Wno-error=implicit-fallthrough" ];
|
||||
|
||||
patches = [
|
||||
# fix paths in netatop.service
|
||||
./fix-paths.patch
|
||||
# Specify PIDFile in /run, not /var/run to silence systemd warning
|
||||
./netatop.service.patch
|
||||
];
|
||||
preConfigure = ''
|
||||
patchShebangs mkversion
|
||||
sed -i -e 's,^KERNDIR.*,KERNDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build,' \
|
||||
*/Makefile
|
||||
sed -i -e 's,/lib/modules.*extra,'$out'/lib/modules/${kernel.modDirVersion}/extra,' \
|
||||
-e s,/usr,$out, \
|
||||
-e /init.d/d \
|
||||
-e /depmod/d \
|
||||
-e s,/lib/systemd,$out/lib/systemd, \
|
||||
Makefile
|
||||
|
||||
kmod=${kmod} substituteAllInPlace netatop.service
|
||||
'';
|
||||
|
||||
makeFlags = kernel.makeFlags;
|
||||
|
||||
preInstall = ''
|
||||
mkdir -p $out/lib/systemd/system $out/bin $out/sbin $out/share/man/man{4,8}
|
||||
mkdir -p $out/lib/modules/${kernel.modDirVersion}/extra
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Network monitoring module for atop";
|
||||
homepage = "https://www.atoptool.nl/downloadnetatop.php";
|
||||
license = lib.licenses.gpl2;
|
||||
platforms = lib.platforms.linux;
|
||||
maintainers = with lib.maintainers; [ viric ];
|
||||
};
|
||||
}
|
||||
11
pkgs/os-specific/linux/netatop/fix-paths.patch
Normal file
11
pkgs/os-specific/linux/netatop/fix-paths.patch
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
--- a/netatop.service
|
||||
+++ b/netatop.service
|
||||
@@ -8,5 +8,5 @@
|
||||
Type=oneshot
|
||||
-ExecStartPre=/sbin/modprobe netatop
|
||||
-ExecStart=/usr/sbin/netatopd
|
||||
-ExecStopPost=/sbin/rmmod netatop
|
||||
+ExecStartPre=@kmod@/bin/modprobe netatop
|
||||
+ExecStart=@out@/bin/netatopd
|
||||
+ExecStopPost=@kmod@/bin/rmmod netatop
|
||||
PIDFile=/var/run/netatop.pid
|
||||
7
pkgs/os-specific/linux/netatop/netatop.service.patch
Normal file
7
pkgs/os-specific/linux/netatop/netatop.service.patch
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
--- a/netatop.service
|
||||
+++ b/netatop.service
|
||||
@@ -11,3 +11,3 @@
|
||||
ExecStopPost=@kmod@/bin/rmmod netatop
|
||||
-PIDFile=/var/run/netatop.pid
|
||||
+PIDFile=/run/netatop.pid
|
||||
RemainAfterExit=yes
|
||||
Loading…
Add table
Add a link
Reference in a new issue