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:
Anton Arapov 2021-04-03 12:58:10 +02:00 committed by Alan Daniels
commit 56de2bcd43
30691 changed files with 3076956 additions and 0 deletions

View file

@ -0,0 +1,78 @@
{ lib, stdenv, fetchurl, fetchpatch, libgcrypt, libnl, pkg-config, python3Packages, wireless-regdb }:
stdenv.mkDerivation rec {
pname = "crda";
version = "4.14";
src = fetchurl {
url = "https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/crda.git/snapshot/crda-${version}.tar.gz";
sha256 = "sha256-Wo81u4snR09Gaw511FG6kXQz2KqxiJZ4pk2cTnKouMI=";
};
patches = [
# Fix python 3 build: except ImportError, e: SyntaxError: invalid syntax
(fetchpatch {
url = "https://raw.githubusercontent.com/archlinux/svntogit-packages/d234fddf451fab0f4fc412e2769f54e11f10d7d8/trunk/crda-4.14-python-3.patch";
sha256 = "sha256-KEezEKrfizq9k4ZiE2mf3Nl4JiBayhXeVnFl7wYh28Y=";
})
(fetchpatch {
url = "https://raw.githubusercontent.com/archlinux/svntogit-packages/d48ec843222b0d74c85bce86fa6f087c7dfdf952/trunk/0001-Makefile-Link-libreg.so-against-the-crypto-library.patch";
sha256 = "sha256-j93oydi209f22OF8aXZ/NczuUOnlhkdSeYvy2WRRvm0=";
})
];
strictDeps = true;
nativeBuildInputs = [
pkg-config
python3Packages.m2crypto # only used for a build time script
];
buildInputs = [
libgcrypt
libnl
];
postPatch = ''
patchShebangs utils/
substituteInPlace Makefile \
--replace 'gzip' 'gzip -n' \
--replace ldconfig true \
--replace pkg-config $PKG_CONFIG
sed -i crda.c \
-e "/\/usr\/.*\/regulatory.bin/d" \
-e "s|/lib/crda|${wireless-regdb}/lib/crda|g"
'';
makeFlags = [
"PREFIX=$(out)"
"SBINDIR=$(out)/bin/"
"UDEV_RULE_DIR=$(out)/lib/udev/rules.d/"
"REG_BIN=${wireless-regdb}/lib/crda/regulatory.bin"
];
buildFlags = [ "all_noverify" ];
enableParallelBuilding = true;
doCheck = true;
checkTarget = "verify";
meta = with lib; {
description = "Linux wireless Central Regulatory Domain Agent";
longDescription = ''
CRDA acts as the udev helper for communication between the kernel and
userspace for regulatory compliance. It relies on nl80211 for communication.
CRDA is intended to be run only through udev communication from the kernel.
To use it under NixOS, add
services.udev.packages = [ pkgs.crda ];
to the system configuration.
'';
homepage = "https://wireless.wiki.kernel.org/en/developers/regulatory/crda";
license = licenses.free; # "copyleft-next 0.3.0", as yet without a web site
platforms = platforms.linux;
};
}