2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv
|
2020-12-24 00:22:20 +01:00
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, lrzsz
|
|
|
|
, IOKit
|
|
|
|
}:
|
2012-09-24 00:26:46 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "picocom";
|
2020-12-24 00:22:20 +01:00
|
|
|
# last tagged release is 3.1 but 3.2 is still considered a release
|
|
|
|
version = "3.2a";
|
2012-09-24 00:26:46 +02:00
|
|
|
|
2020-12-24 00:22:20 +01:00
|
|
|
# upstream is quiet as the original author is no longer active since March 2018
|
2015-08-17 22:14:51 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "npat-efault";
|
|
|
|
repo = "picocom";
|
2020-12-24 00:22:20 +01:00
|
|
|
rev = "1acf1ddabaf3576b4023c4f6f09c5a3e4b086fb8";
|
|
|
|
sha256 = "sha256-cs2bxqZfTbnY5d+VJ257C5hssaFvYup3tBKz68ROnAo=";
|
2012-09-24 00:26:46 +02:00
|
|
|
};
|
|
|
|
|
2020-12-24 00:22:20 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace '.picocom_history' '.cache/picocom_history'
|
2014-07-22 23:51:25 +02:00
|
|
|
|
2020-12-24 00:22:20 +01:00
|
|
|
substituteInPlace picocom.c \
|
|
|
|
--replace '"rz -vv"' '"${lrzsz}/bin/rz -vv"' \
|
|
|
|
--replace '"sz -vv"' '"${lrzsz}/bin/sz -vv"'
|
|
|
|
'';
|
2014-07-22 23:51:25 +02:00
|
|
|
|
2020-12-24 00:22:20 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2021-01-15 10:19:50 +01:00
|
|
|
buildInputs = lib.optional stdenv.isDarwin IOKit;
|
2020-12-24 00:22:20 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -Dm555 -t $out/bin picocom
|
|
|
|
installManPage picocom.1
|
|
|
|
installShellCompletion --bash bash_completion/picocom
|
2012-09-24 00:26:46 +02:00
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2012-09-24 00:26:46 +02:00
|
|
|
description = "Minimal dumb-terminal emulation program";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/npat-efault/picocom/";
|
2020-12-24 00:22:20 +01:00
|
|
|
license = licenses.gpl2Plus;
|
2019-01-19 22:08:15 +01:00
|
|
|
platforms = platforms.unix;
|
2012-09-24 00:26:46 +02:00
|
|
|
};
|
|
|
|
}
|