Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Jun 2003 00:19:09 -0400 (EDT)
From:      Andy Pavlo <amp0928@rit.edu>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/53243: UPDATE PORT - misc/hotkeys/ - fixes install block on 5.X
Message-ID:  <20030612041909.934D2151@res01621.rh.rit.edu>
Resent-Message-ID: <200306120420.h5C4KHBq052708@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         53243
>Category:       ports
>Synopsis:       UPDATE PORT - misc/hotkeys/ - fixes install block on 5.X
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 11 21:20:16 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Andy Pavlo
>Release:        FreeBSD 4.7-RELEASE i386
>Organization:
Rochester Institute of Technology
>Environment:
System: FreeBSD res01621.rh.rit.edu 4.7-RELEASE FreeBSD 4.7-RELEASE #0: Wed Oct 9 15:08:34 GMT 2002 root@builder.freebsdmall.com:/usr/obj/usr/src/sys/GENERIC i386


	
>Description:
Two quick files that need to be replaced. First is files/patch-src-hotkeys.c which will do a simple fix 
so that it doesn't crap out on FreeBSD 5.X. The next is a change to the Makefile to fix the header and 
add my email as the maintainer
>How-To-Repeat:
Shell archive has been included
>Fix:
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	hotkeys
#	hotkeys/files
#	hotkeys/files/patch-src-hotkeys.c
#	hotkeys/Makefile
#
echo c - hotkeys
mkdir -p hotkeys > /dev/null 2>&1
echo c - hotkeys/files
mkdir -p hotkeys/files > /dev/null 2>&1
echo x - hotkeys/files/patch-src-hotkeys.c
sed 's/^X//' >hotkeys/files/patch-src-hotkeys.c << 'END-of-hotkeys/files/patch-src-hotkeys.c'
X--- src/hotkeys.c.orig	Tue Dec  3 14:26:32 2002
X+++ src/hotkeys.c	Wed Jun 11 23:54:54 2003
X@@ -54,7 +54,7 @@
X #include <fcntl.h>
X #include <sys/ioctl.h>
X #if defined (__FreeBSD__)
X-#include <machine/soundcard.h>
X+#include <sys/soundcard.h>
X #else
X #       if defined (__NetBSD__) || defined (__OpenBSD__)
X #       include <soundcard.h>          /* OSS emulation */
X@@ -66,9 +66,9 @@
X #endif                          /* __FreeBSD__ */
X 
X /* CDROM related */
X-#include <linux/cdrom.h>        /* FIXME: linux specific! */
X+//#include <linux/cdrom.h>        /* FIXME: linux specific! */
X /* APM (suspend/standby) support */
X-#include "apm.h"
X+//#include "apm.h"
X #if HAVE_GTK
X   #include "splash.h"
X #endif
X@@ -585,7 +585,7 @@
X {
X     int         mixer_fd = -1, cdrom_fd = -1;
X     int         master_vol, cd_vol;
X-    struct cdrom_volctrl cdrom_vol;
X+//    struct cdrom_volctrl cdrom_vol;
X     int         left, right;
X     static struct timeval last_time;
X     struct timeval this_time;
X@@ -683,6 +683,7 @@
X     }
X 
X     /* open the cdrom/dvdrom drive device */
X+/***** ANDY: No CD support yet
X     if ( cdromDevice != NULL )
X     {
X         if ( (cdrom_fd = open( cdromDevice, O_RDONLY|O_NONBLOCK )) == -1 )
X@@ -691,7 +692,7 @@
X         }
X         else
X         {
X-            /* read the cdrom volume */
X+            || read the cdrom volume ||
X             if ( ioctl(cdrom_fd, CDROMVOLREAD, &cdrom_vol) == -1 )
X             {
X                 uError("Unable to read the CDROM volume of `%s'", cdromDevice);
X@@ -699,7 +700,7 @@
X             }
X             else
X             {
X-                /* Set the CDROM volume */
X+                || Set the CDROM volume ||
X                 int     t;
X                 float   myAdj;
X                 myAdj = 0xFF / 100.0 * adj;
X@@ -721,9 +722,10 @@
X             }
X         }
X     }
X+END Andy *****/
X 
X     if (mixer_fd != -1)     close(mixer_fd);
X-    if (cdrom_fd != -1)     close(cdrom_fd);
X+//Andy    if (cdrom_fd != -1)     close(cdrom_fd);
X 
X     return ret;
X }
X@@ -737,10 +739,10 @@
X {
X     static Bool             muted = False;
X     static int              last_mixer_vol, last_cd_vol;
X-    static struct cdrom_volctrl last_cdrom_vol;
X+//Andy    static struct cdrom_volctrl last_cdrom_vol;
X 
X     int                     vol, cd_vol;
X-    struct cdrom_volctrl    cdrom_vol;
X+//Andy    struct cdrom_volctrl    cdrom_vol;
X     int                     mixer_fd = -1, cdrom_fd = -1;
X 
X     short ret = 0;      /* return value */
X@@ -751,6 +753,7 @@
X         uError("Unable to open `%s'", MIXER_DEV);
X     }
X     /* open the cdrom/dvdrom drive device */
X+/***** Andy: No CD support
X     if ( cdromDevice != NULL )
X     {
X         if ( (cdrom_fd = open( cdromDevice, O_RDONLY|O_NONBLOCK )) == -1 )
X@@ -758,6 +761,7 @@
X             uError("Unable to open `%s'", cdromDevice);
X         }
X     }
X+END Andy *****/
X 
X     if ( muted )
X     {
X@@ -783,6 +787,7 @@
X #endif
X             }
X         }
X+/***** Andy: No CD support
X #if 0
X         if (SOUND_IOCTL(mixer_fd, SOUND_MIXER_WRITE_CD, &last_cd_vol) == -1)
X         {
X@@ -800,6 +805,7 @@
X             } else
X                 muted = False;
X         }
X+End Andy *****/
X     }
X     else    /* ! muted */
X     {
X@@ -837,6 +843,7 @@
X                 }
X             }
X         }
X+/***** Andy: No CD support
X #if 0
X         if ( SOUND_IOCTL(mixer_fd, SOUND_MIXER_READ_CD, &last_cd_vol) == -1)
X         {
X@@ -853,7 +860,9 @@
X                 muted = True;
X         }
X #endif
X+End Andy *****/
X         /* read and store the cdrom volume */
X+/***** Andy: No CD support
X         if (cdrom_fd != -1)
X         {
X             if ( ioctl(cdrom_fd, CDROMVOLREAD, &last_cdrom_vol) == -1 )
X@@ -863,8 +872,8 @@
X             }
X             else
X             {
X-                /* Set the volume to 0. FIXME: is this linux specific? Do
X-                 * other platforms also have 4 channels? */
X+                || Set the volume to 0. FIXME: is this linux specific? Do
X+                 * other platforms also have 4 channels? ||
X                 cdrom_vol.channel0 = cdrom_vol.channel1 = cdrom_vol.channel2 =
X                     cdrom_vol.channel3 = 0;
X                 if ( ioctl(cdrom_fd, CDROMVOLCTRL, &cdrom_vol) == -1 )
X@@ -875,10 +884,11 @@
X                     muted = True;
X             }
X         }
X+End Andy *****/
X     }
X 
X     if (mixer_fd != -1)   close(mixer_fd);
X-    if (cdrom_fd != -1)   close(cdrom_fd);
X+//Andy    if (cdrom_fd != -1)   close(cdrom_fd);
X 
X     return ret;
X }
X@@ -886,19 +896,20 @@
X static int 
X ejectDisc(void)
X {
X+/***** Andy: No CD support
X     int fd, status;
X 
X     if ( cdromDevice == NULL )
X         return 0;
X 
X-    /* the idea of this code is from xine's vcd plugin, mostly linux
X-       specific FIXME */
X+    || the idea of this code is from xine's vcd plugin, mostly linux
X+       specific FIXME ||
X     if ( (fd = open( cdromDevice, O_RDONLY | O_NONBLOCK)) > -1 ) {
X         status = ioctl(fd, CDROM_DRIVE_STATUS, CDSL_CURRENT);
X         switch (status)
X         {
X-            /* Looks like ATAPI drives doesn't return CDS_TRAY_OPEN,
X-             * at least it's the case on my ASUS DVD drive... */
X+            || Looks like ATAPI drives doesn't return CDS_TRAY_OPEN,
X+             * at least it's the case on my ASUS DVD drive... ||
X             case CDS_TRAY_OPEN:
X #ifdef HAVE_LIBXOSD
X                 if ( osd )
X@@ -929,7 +940,7 @@
X             case CDS_NO_INFO:
X             case CDS_DRIVE_NOT_READY:
X             default:
X-                /* Ignore */
X+                || Ignore ||
X                 break;
X         }
X         close(fd);
X@@ -940,6 +951,7 @@
X         SYSLOG(LOG_NOTICE, "CDROM_DRIVE_STATUS failed: %s\n", strerror(errno));
X         return -1;
X     }
X+End Andy *****/
X }
X 
X 
X@@ -1002,8 +1014,8 @@
X #ifdef HAVE_LIBXOSD
X         if ( osd )
X         {
X-            xosd_display(osd, 0, XOSD_string, "Launching:");
X-            xosd_display(osd, 1, XOSD_string, getConfig(type));
X+            xosd_display(osd, 0, XOSD_string, type);
X+            xosd_display(osd, 1, XOSD_string, "");
X         }
X #endif
X     }
X@@ -1015,13 +1027,14 @@
X int
X sleepState(int mode)
X {
X+/***** Andy: No APM support
X #ifdef USE_APMD
X     switch (mode)
X     {
X-      case SUSPEND:
X+    //  case SUSPEND:
X         error = system("apm -s");
X         break;
X-      case STANDBY:
X+    //  case STANDBY:
X         error = system("apm -S");
X         break;
X       default:
X@@ -1039,10 +1052,10 @@
X     }
X     switch (mode)
X     {
X-      case SUSPEND:
X+     // case SUSPEND:
X         error = apm_suspend(fd);
X         break;
X-      case STANDBY:
X+     // case STANDBY:
X         error = apm_standby(fd);
X         break;
X       default:
X@@ -1050,7 +1063,9 @@
X         break;
X     }
X     apm_close(fd);
X-#endif /* USE_APMD */
X+#endif 
X+End Andy *****/
X+/* USE_APMD */
X }
X 
X 
X@@ -1105,8 +1120,8 @@
X #ifdef HAVE_LIBXOSD
X                 if ( osd )
X                 {
X-                    xosd_display(osd, 0, XOSD_string, "Launching:");
X-                    xosd_display(osd, 1, XOSD_string, kbd.customCmds[i].desc);
X+                    xosd_display(osd, 0, XOSD_string, kbd.customCmds[i].desc);
X+                    xosd_display(osd, 1, XOSD_string, "");
X                 }
X #endif
X                 break;  /* break the for loop */
X@@ -1444,6 +1459,7 @@
X                         3       /* shadow offset */,
X                         3       /* number_lines */ 
X                         );
X+        xosd_set_align(osd, XOSD_center);
X     }
X #endif
X }
X@@ -1592,6 +1608,7 @@
X                 doMute();
X             } else
X             /* APM stuffs */
X+/**** Andy: No APM support
X             if ( ev.message.keycode == (kbd.defCmds)[sleepKey].key ||
X                  ev.message.keycode == (kbd.defCmds)[wakeupKey].key ) {
X                 sleepState(STANDBY);
X@@ -1601,8 +1618,9 @@
X             }
X             else
X             {
X+End Andy *****/
X                 lookupUserCmd(ev.message.keycode);  /* User-defined stuffs */
X-            }
X+//Andy            }
X         }
X     }
X 
END-of-hotkeys/files/patch-src-hotkeys.c
echo x - hotkeys/Makefile
sed 's/^X//' >hotkeys/Makefile << 'END-of-hotkeys/Makefile'
X# New ports collection makefile for:	hotkeys
X# Date created:				May 20th, 2003
X# Whom:					Andy Pavlo <amp0928@rit.edu>
X#
X# $FreeBSD: ports/misc/hotkeys/Makefile,v 1.1 2003/06/03 02:42:39 will Exp $
X
XPORTNAME=	hotkeys
XPORTVERSION=	0.5.7.1
XCATEGORIES=	misc
XMASTER_SITES=	http://ypwong.org/hotkeys/${PORTVERSION}/	\
X		${MASTER_SITE_XCONTRIB}
XDISTNAME=	hotkeys_${PORTVERSION}
X
XMAINTAINER=	amp0928@rit.edu
XCOMMENT=	Allows usage of special keys on internet/multimedia keyboards
X
XLIB_DEPENDS=	xosd.4:${PORTSDIR}/misc/xosd \
X		xml2.5:${PORTSDIR}/textproc/libxml2 \
X		db3.3:${PORTSDIR}/databases/db3
X
XWRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}
XGNU_CONFIGURE=	1
XCONFIGURE_ARGS=	--with-db3-inc=${LOCALBASE}/include/db3 \
X		--with-db3-lib=${LOCALBASE}/lib \
X		--with-xosd
XUSE_GMAKE=	yes
X
XMAN1=		hotkeys.1
XORIG_CONFIG=	${PREFIX}/etc/hotkeys.conf
XSAMPLE_CONFIG=	${PREFIX}/etc/hotkeys.conf.sample
X
Xpost-extract:
X	@${CP} ${PATCHDIR}/error.h ${WRKSRC}/src
X	@${CP} ${PATCHDIR}/eliteduo.def ${WRKSRC}/def
X
Xpost-install:
X	@${MV} ${ORIG_CONFIG} ${SAMPLE_CONFIG}
X	@${CAT} ${PKGMESSAGE}
X
X.include <bsd.port.mk>
END-of-hotkeys/Makefile
exit


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030612041909.934D2151>