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
45 lines
1.2 KiB
Nix
45 lines
1.2 KiB
Nix
{ lib, stdenv, fetchurl, ncurses, glibc }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "statserial";
|
|
version = "1.1";
|
|
|
|
src = fetchurl {
|
|
url = "http://www.ibiblio.org/pub/Linux/system/serial/${pname}-${version}.tar.gz";
|
|
sha256 = "0rrrmxfba5yn836zlgmr8g9xnrpash7cjs7lk2m44ac50vakpks0";
|
|
};
|
|
|
|
postPatch = ''
|
|
substituteInPlace Makefile \
|
|
--replace '-lcurses' '-lncurses'
|
|
|
|
substituteInPlace Makefile \
|
|
--replace 'LDFLAGS = -s -N' '#LDFLAGS = -s -N'
|
|
'';
|
|
|
|
buildInputs = [ ncurses glibc stdenv ];
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
cp statserial $out/bin
|
|
|
|
mkdir -p $out/share/man/man1
|
|
cp statserial.1 $out/share/man/man1
|
|
'';
|
|
|
|
meta = with lib; {
|
|
homepage = "https://sites.google.com/site/tranter/software";
|
|
description = "Display serial port modem status lines";
|
|
license = licenses.gpl2;
|
|
|
|
longDescription =
|
|
'' Statserial displays a table of the signals on a standard 9-pin or
|
|
25-pin serial port, and indicates the status of the handshaking lines. It
|
|
can be useful for debugging problems with serial ports or modems.
|
|
'';
|
|
|
|
platforms = platforms.unix;
|
|
maintainers = with maintainers; [ rps ];
|
|
};
|
|
}
|