diff options
author | Martin Schlemmer <azarah@gentoo.org> | 2003-08-02 13:00:21 +0000 |
---|---|---|
committer | Martin Schlemmer <azarah@gentoo.org> | 2003-08-02 13:00:21 +0000 |
commit | 1d28e35070061badeb9d38752e705510897d9f1c (patch) | |
tree | e79a67854e270f375c0a326cd048fa64dfb2d41c /sys-apps/kbd | |
parent | digest update (diff) | |
download | gentoo-2-1d28e35070061badeb9d38752e705510897d9f1c.tar.gz gentoo-2-1d28e35070061badeb9d38752e705510897d9f1c.tar.bz2 gentoo-2-1d28e35070061badeb9d38752e705510897d9f1c.zip |
A better fix from Keith M Wesolowski <wesolows@gentoo.org> (bug #25517).
Diffstat (limited to 'sys-apps/kbd')
-rw-r--r-- | sys-apps/kbd/ChangeLog | 8 | ||||
-rw-r--r-- | sys-apps/kbd/Manifest | 4 | ||||
-rw-r--r-- | sys-apps/kbd/files/digest-kbd-1.08-r2 | 1 | ||||
-rw-r--r-- | sys-apps/kbd/files/kbd-1.08-kbd_repeat.patch | 157 | ||||
-rw-r--r-- | sys-apps/kbd/kbd-1.08-r2.ebuild | 63 |
5 files changed, 232 insertions, 1 deletions
diff --git a/sys-apps/kbd/ChangeLog b/sys-apps/kbd/ChangeLog index 68f910712b10..be32a985fad9 100644 --- a/sys-apps/kbd/ChangeLog +++ b/sys-apps/kbd/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sys-apps/kbd # Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/kbd/ChangeLog,v 1.15 2003/08/01 22:43:22 azarah Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/kbd/ChangeLog,v 1.16 2003/08/02 13:00:21 azarah Exp $ + +*kbd-1.08-r2 (02 Aug 2003) + + 02 Aug 2003; Martin Schlemmer <azarah@gentoo.org> kbd-1.08-r2.ebuild, + files/kbd-1.08-kbd_repeat.patch: + A better fix from Keith M Wesolowski <wesolows@gentoo.org> (bug #25517). 02 Aug 2003; Martin Schlemmer <azarah@gentoo.org> files/kbd-1.08-sparc-fixes.patch: diff --git a/sys-apps/kbd/Manifest b/sys-apps/kbd/Manifest index 3305438a1792..dcd86b27aa44 100644 --- a/sys-apps/kbd/Manifest +++ b/sys-apps/kbd/Manifest @@ -1,6 +1,10 @@ MD5 7e67c3b3e2af910874c6cf22aa20536e ChangeLog 2587 MD5 f03b668fce4d663f9cc584d09e6150f6 kbd-1.06-r1.ebuild 1125 MD5 a2519d48c55d482a0d4893754bec966c kbd-1.08-r1.ebuild 1550 +MD5 56533fd9fd54d4aa2486744aae0ac0de kbd-1.08-r2.ebuild 1549 +MD5 d31273bb8b528d436bd3ab34b672e4a5 .kbd-1.08-r2.ebuild.swp 12288 MD5 b1f1dbd569840cc0e1c97a7431466964 files/digest-kbd-1.06-r1 60 MD5 f6af43f3979cc9d66a938d22c1727388 files/digest-kbd-1.08-r1 60 MD5 9dde9067630b0fb27bd8224753741463 files/kbd-1.08-sparc-fixes.patch 2375 +MD5 bd6db9808c207f17713c8abc9fa52849 files/kbd-1.08-kbd_repeat.patch 25625 +MD5 f6af43f3979cc9d66a938d22c1727388 files/digest-kbd-1.08-r2 60 diff --git a/sys-apps/kbd/files/digest-kbd-1.08-r2 b/sys-apps/kbd/files/digest-kbd-1.08-r2 new file mode 100644 index 000000000000..9b77d0dd0db3 --- /dev/null +++ b/sys-apps/kbd/files/digest-kbd-1.08-r2 @@ -0,0 +1 @@ +MD5 924e6a05e52715dc0f96385b35f2f680 kbd-1.08.tar.gz 819924 diff --git a/sys-apps/kbd/files/kbd-1.08-kbd_repeat.patch b/sys-apps/kbd/files/kbd-1.08-kbd_repeat.patch new file mode 100644 index 000000000000..7dd9524bcee5 --- /dev/null +++ b/sys-apps/kbd/files/kbd-1.08-kbd_repeat.patch @@ -0,0 +1,157 @@ +diff -urN kbd-1.08.orig/configure kbd-1.08/configure +--- kbd-1.08.orig/configure 2003-08-01 20:31:50.298316445 -0700 ++++ kbd-1.08/configure 2003-08-01 21:00:17.812534740 -0700 +@@ -193,3 +193,33 @@ + else + echo "HAVE_XGETTEXT=no" >> make_include + fi ++ ++# ++# 4. Do we have <linux/kd.h>, and if so what is the name of the second ++# member of struct kbd_repeat? ++# ++echo " ++#include <linux/kd.h> ++main(){ struct kbd_repeat x; x.rate = 0; exit(0); } ++" > conftest.c ++eval $compile ++if test -s conftest && ./conftest 2>/dev/null; then ++ echo "You have <linux/kd.h> (rate)" ++ echo "#define HAVE_kd_h" >> defines.h ++ echo "#define kd_PERIOD rate" >> defines.h ++else ++ echo " ++#include <linux/kd.h> ++main(){ struct kbd_repeat x; x.period = 0; exit(0); } ++" > conftest.c ++ eval $compile ++ if test -s conftest && ./conftest 2>/dev/null; then ++ echo "You have <linux/kd.h> (period)" ++ echo "#define HAVE_kd_h" >> defines.h ++ echo "#define kd_PERIOD period" >> defines.h ++ else ++ echo "You don't have <linux/kd.h>" ++ fi ++fi ++rm -f conftest conftest.c ++ +diff -urN kbd-1.08.orig/src/kbdrate.c kbd-1.08/src/kbdrate.c +--- kbd-1.08.orig/src/kbdrate.c 2003-08-01 20:31:50.443296940 -0700 ++++ kbd-1.08/src/kbdrate.c 2003-08-01 21:02:36.135807454 -0700 +@@ -75,21 +75,15 @@ + #include <sys/file.h> + #include <sys/ioctl.h> + ++#include "../defines.h" ++#ifdef HAVE_kd_h ++#include <linux/kd.h> ++#endif + #ifdef __sparc__ + #include <asm/param.h> + #include <asm/kbio.h> + #endif + +-#ifndef KDKBDREP +-/* usually defined in <linux/kd.h> */ +-#define KDKBDREP 0x4B52 /* set keyboard delay/repeat rate; +- * actually used values are returned */ +-struct kbd_repeat { +- int delay; /* in msec; <= 0: don't change */ +- int period; /* in msec; <= 0: don't change */ +-}; +-#endif +- + #include "nls.h" + #include "version.h" + +@@ -104,12 +98,13 @@ + + static int + KDKBDREP_ioctl_ok(double rate, int delay, int silent) { ++#ifdef KDKBDREP + /* This ioctl is defined in <linux/kd.h> but is not + implemented anywhere - must be in some m68k patches. */ + struct kbd_repeat kbdrep_s; + + /* don't change, just test */ +- kbdrep_s.period = -1; ++ kbdrep_s.kd_PERIOD = -1; + kbdrep_s.delay = -1; + if (ioctl( 0, KDKBDREP, &kbdrep_s )) { + if (errno == EINVAL) +@@ -118,38 +113,37 @@ + exit( 1 ); + } + +-#if 0 +- printf("old delay %d, period %d\n", +- kbdrep_s.delay, kbdrep_s.period); +-#endif +- + /* do the change */ +- if (rate == 0) /* switch repeat off */ +- kbdrep_s.period = 0; ++ if (rate == 0) /* switch repeat off */ ++ kbdrep_s.kd_PERIOD = 0; + else +- kbdrep_s.period = 1000.0 / rate; /* convert cps to msec */ +- if (kbdrep_s.period < 1) +- kbdrep_s.period = 1; ++ kbdrep_s.kd_PERIOD = 1000.0 / rate; /* convert cps to msec */ ++ if (kbdrep_s.kd_PERIOD < 1) ++ kbdrep_s.kd_PERIOD = 1; + kbdrep_s.delay = delay; + if (kbdrep_s.delay < 1) + kbdrep_s.delay = 1; + +- if (ioctl(0, KDKBDREP, &kbdrep_s)) { +- perror("ioctl(KDKBDREP)"); +- exit(1); ++ if (ioctl( 0, KDKBDREP, &kbdrep_s )) { ++ perror( "ioctl(KDKBDREP)" ); ++ exit( 1 ); + } + + /* report */ +- if (kbdrep_s.period == 0) ++ if (kbdrep_s.kd_PERIOD == 0) + rate = 0; + else +- rate = 1000.0 / (double) kbdrep_s.period; ++ rate = 1000.0 / (double) kbdrep_s.kd_PERIOD; + + if (!silent) + printf( _("Typematic Rate set to %.1f cps (delay = %d ms)\n"), + rate, kbdrep_s.delay ); + + return 1; /* success! */ ++ ++#else /* no KDKBDREP */ ++ return 0; ++#endif /* KDKBDREP */ + } + + static int +@@ -164,10 +158,10 @@ + exit( 1 ); + } + +- kbdrate_s.period = (int) (rate + 0.5); /* round up */ ++ kbdrate_s.rate = (int) (rate + 0.5); /* round up */ + kbdrate_s.delay = delay * HZ / 1000; /* convert ms to Hz */ +- if (kbdrate_s.period > 50) +- kbdrate_s.period = 50; ++ if (kbdrate_s.rate > 50) ++ kbdrate_s.rate = 50; + + if (ioctl( fd, KIOCSRATE, &kbdrate_s )) { + perror( "ioctl(KIOCSRATE)" ); +@@ -177,7 +171,7 @@ + + if (!silent) + printf( "Typematic Rate set to %d cps (delay = %d ms)\n", +- kbdrate_s.period, kbdrate_s.delay * 1000 / HZ ); ++ kbdrate_s.rate, kbdrate_s.delay * 1000 / HZ ); + + return 1; + #else /* no KIOCSRATE */ diff --git a/sys-apps/kbd/kbd-1.08-r2.ebuild b/sys-apps/kbd/kbd-1.08-r2.ebuild new file mode 100644 index 000000000000..9bc98f482921 --- /dev/null +++ b/sys-apps/kbd/kbd-1.08-r2.ebuild @@ -0,0 +1,63 @@ +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/kbd/kbd-1.08-r2.ebuild,v 1.1 2003/08/02 13:00:21 azarah Exp $ + +IUSE="nls" + +inherit eutils + +S="${WORKDIR}/${P}" +DESCRIPTION="Keyboard and console utilities" +SRC_URI="ftp://ftp.cwi.nl/pub/aeb/kbd/${P}.tar.gz + ftp://ftp.win.tue.nl/pub/home/aeb/linux-local/utils/kbd/${P}.tar.gz" +HOMEPAGE="http://freshmeat.net/projects/kbd/" + +KEYWORDS="~x86 ~amd64 ~ppc ~sparc ~alpha ~mips ~hppa ~arm" +SLOT="0" +LICENSE="GPL-2" + +DEPEND="virtual/glibc nls? ( sys-devel/gettext )" +PROVIDE="sys-apps/console-tools" + +src_unpack() { + unpack ${A} + + cd ${S} + # Fixes makefile so that it uses the CFLAGS from portage (bug #21320). + sed -i -e "s:-O2:${CFLAGS}:g" src/Makefile.in + + # Sparc have not yet fixed struct kbd_rate to use 'period' and not 'rate'. + epatch ${FILESDIR}/${P}-kbd_repeat.patch +} + +src_compile() { + local myconf= + + # Non-standard configure script; --disable-nls to + # disable NLS, nothing to enable it. + use nls || myconf="--disable-nls" + + # We should not add the prefix to mandir and datadir + ./configure --prefix=/usr \ + --mandir=/share/man \ + --datadir=/share \ + ${myconf} || die + + make || die +} + +src_install() { + make \ + DESTDIR=${D} \ + DATADIR=${D}/usr/share \ + MANDIR=${D}/usr/share/man \ + install || die + + dodir /usr/bin + dosym ../../bin/setfont /usr/bin/setfont + + dodoc CHANGES CREDITS COPYING README + dodir /usr/share/doc/${PF}/html + cp -dR doc/* ${D}/usr/share/doc/${PF}/html/ +} + |