minicom: 2.7 -> 2.7.1

This commit is contained in:
Peter Hoeg 2017-10-24 17:14:24 +08:00
parent b752a9e433
commit 707b6b12cc
2 changed files with 112 additions and 19 deletions

View File

@ -1,32 +1,46 @@
{ stdenv, fetchurl, ncurses }:
{ stdenv, fetchurl, autoreconfHook, pkgconfig
, ncurses }:
stdenv.mkDerivation rec {
name = "minicom-2.7";
name = "minicom-2.7.1";
src = fetchurl {
url = "http://alioth.debian.org/frs/download.php/file/3977/${name}.tar.gz";
sha256 = "1x04m4k7c71j5cnhzpjrbz43dd96k4mpkd0l87v5skrgp1isdhws";
url = "https://alioth.debian.org/frs/download.php/latestfile/3/${name}.tar.gz";
sha256 = "1wa1l36fa4npd21xa9nz60yrqwkk5cq713fa3p5v0zk7g9mq6bsk";
};
buildInputs = [ncurses];
buildInputs = [ ncurses ];
configureFlags = [ "--sysconfdir=/etc" "--enable-lock-dir=/var/lock" ];
nativeBuildInputs = [ autoreconfHook pkgconfig ];
preConfigure =
enableParallelBuilding = true;
configureFlags = [
"--sysconfdir=/etc"
"--enable-lock-dir=/var/lock"
];
patches = [ ./xminicom_terminal_paths.patch ];
preConfigure = ''
# Have `configure' assume that the lock directory exists.
'' sed -i "configure" -e's/test -d \$UUCPLOCK/true/g'
'';
substituteInPlace configure \
--replace 'test -d $UUCPLOCK' true
meta = {
substituteInPlace src/rwconf.c \
--replace /usr/bin/ascii-xfr $out/bin/ascii-xfr
'';
meta = with stdenv.lib; {
description = "Modem control and terminal emulation program";
homepage = http://alioth.debian.org/projects/minicom/;
longDescription =
'' Minicom is a menu driven communications program. It emulates ANSI
and VT102 terminals. It has a dialing directory and auto zmodem
download.
'';
platforms = stdenv.lib.platforms.gnu; # arbitrary choice
homepage = https://alioth.debian.org/projects/minicom/;
license = licenses.gpl2;
longDescription = ''
Minicom is a menu driven communications program. It emulates ANSI
and VT102 terminals. It has a dialing directory and auto zmodem
download.
'';
maintainers = with maintainers; [ peterhoeg ];
platforms = platforms.linux;
};
}

View File

@ -0,0 +1,79 @@
diff --git a/src/xminicom b/src/xminicom
index a59aa08..cef153b 100755
--- a/src/xminicom
+++ b/src/xminicom
@@ -7,57 +7,39 @@
#
# version $Id: xminicom,v 1.4 2008-06-09 20:48:35 al-guest Exp $
-findcmd()
-{
- IFS=:
- for i in $PATH
- do
- if [ -x $i\/$1 ]
- then
- result=$i\/$1
- IFS=
- return 0
- fi
- done
- result=
- IFS=
- return 1
+findcmd() {
+ result=$(command -v $1)
}
-if findcmd x-terminal-emulator
-then
+if findcmd x-terminal-emulator ; then
exec $result -T minicom -e "if ! minicom -m -c on $*; then echo Press ENTER to continue...; read; fi"
exit 1
fi
-if findcmd color_xterm
-then
+if findcmd konsole ; then
+ exec $result -T minicom -geometry 80x25 -e minicom -m -c on "$@"
+ exit 1
+fi
+
+if findcmd gnome-terminal ; then
+ exec $result -T minicom -geometry 80x25 -e "if ! minicom -m -c on $*; then echo Press ENTER to continue...; read; fi"
+ exit 1
+fi
+
+if findcmd color_xterm ; then
exec $result -T minicom -bg black -fg grey -n minicom -geometry 80x25 -e "if ! minicom -m -c on $*; then echo Press ENTER to continue...; read; fi"
exit 1
fi
-if findcmd rxvt
-then
+if findcmd rxvt ; then
exec $result -bg black -fg grey -n minicom -T minicom -sl 0 -geometry 80x25 -e "if ! minicom -m -c on $*; then echo Press ENTER to continue...; read; fi"
exit 1
fi
-if findcmd kterm
-then
+if findcmd xterm ; then
exec $result -T minicom -n minicom -geometry 80x25 -e "if ! minicom -m -c on $*; then echo Press ENTER to continue...; read; fi"
exit 1
fi
-if findcmd xterm
-then
- if [ -f /etc/debian_version ]
- then
- exec $result -T minicom -n minicom -bg black -fg grey -geometry 80x25 -e "if ! minicom -m -c on $*; then echo Press ENTER to continue...; read; fi"
- else
- exec $result -T minicom -n minicom -geometry 80x25 -e "if ! minicom -m -c on $*; then echo Press ENTER to continue...; read; fi"
- fi
- exit 1
-fi
-
-echo "xminicom: rxvt, color_xterm or xterm NOT found!" 1>&2
+echo "xminicom: konsole, gnome-terminal, rxvt, color_xterm or xterm NOT found!" 1>&2
exit 1