mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-22 05:33:23 +00:00
4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
32 lines
970 B
Nix
32 lines
970 B
Nix
{ lib, stdenv, fetchFromGitHub }:
|
|
|
|
stdenv.mkDerivation {
|
|
pname = "can-utils";
|
|
# There are no releases (source archives or git tags), so use the date of the
|
|
# latest commit in git master as version number.
|
|
version = "20170830";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "linux-can";
|
|
repo = "can-utils";
|
|
rev = "5b518a0a5fa56856f804372a6b99b518dedb5386";
|
|
sha256 = "1ygzp8rjr8f1gs48mb1pz7psdgbfhlvr6kjdnmzbsqcml06zvrpr";
|
|
};
|
|
|
|
# Fixup build with newer Linux headers.
|
|
postPatch = ''
|
|
sed '1i#include <linux/sockios.h>' -i \
|
|
slcanpty.c cansniffer.c canlogserver.c isotpdump.c isotpsniffer.c isotpperf.c
|
|
'';
|
|
|
|
preConfigure = ''makeFlagsArray+=(PREFIX="$out")'';
|
|
|
|
meta = with lib; {
|
|
description = "CAN userspace utilities and tools (for use with Linux SocketCAN)";
|
|
homepage = "https://github.com/linux-can/can-utils";
|
|
license = licenses.gpl2Plus;
|
|
platforms = platforms.linux;
|
|
maintainers = [ maintainers.bjornfor ];
|
|
};
|
|
}
|