From 44087d5afaf19da6515898d4f1040fe49cc1867a Mon Sep 17 00:00:00 2001 From: stefan Date: Thu, 5 Apr 2007 10:05:22 +0000 Subject: Enable joystick support. PR: 111076 Submitted by: Teemu Korhonen Patch by: submitter/maintainer Approved by: maintainer --- multimedia/mplayer/Makefile | 8 +++++++ multimedia/mplayer/files/patch-ad | 21 ++++++++++++++++-- multimedia/mplayer/files/patch-input-joystick.c | 29 +++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 multimedia/mplayer/files/patch-input-joystick.c diff --git a/multimedia/mplayer/Makefile b/multimedia/mplayer/Makefile index 60c4183dfb3e..6fe67c41def2 100644 --- a/multimedia/mplayer/Makefile +++ b/multimedia/mplayer/Makefile @@ -174,6 +174,7 @@ OPTIONS+= LIRC "Enable lirc support" off OPTIONS+= LIBCDIO "Enable libcdio support" off OPTIONS+= CDPARANOIA "Enable cdparanoia support" off OPTIONS+= LIBLZO "Enable external liblzo library" off +OPTIONS+= JOYSTICK "Enable joystick support" off .endif WANT_GNOME= yes @@ -586,6 +587,13 @@ DEFAULT_KERN_HZ=${WITH_KERN_HZ} DEFAULT_KERN_HZ=1024 .endif +.if defined(WITH_JOYSTICK) +BUILD_DEPENDS+= ${LOCALBASE}/include/linux/joystick.h:${PORTSDIR}/devel/linux-js +CONFIGURE_ARGS+=--enable-joystick +.else +CONFIGURE_ARGS+=--disable-joystick +.endif + # "enable" build for other archs .if ${ARCH} == "i386" || ${ARCH} == "amd64" .if !defined(WITHOUT_RTCPU) diff --git a/multimedia/mplayer/files/patch-ad b/multimedia/mplayer/files/patch-ad index a9d297a63740..70734c7f5f6d 100644 --- a/multimedia/mplayer/files/patch-ad +++ b/multimedia/mplayer/files/patch-ad @@ -1,5 +1,5 @@ ---- configure.orig Mon Oct 23 00:32:31 2006 -+++ configure Tue Oct 24 22:19:10 2006 +--- configure.orig Tue Apr 3 13:35:43 2007 ++++ configure Tue Apr 3 13:35:51 2007 @@ -59,9 +59,9 @@ echo >> "$TMPLOG" cat "$1" >> "$TMPLOG" @@ -150,3 +150,20 @@ fi # 64 bit file offsets? if test "$_largefiles" = yes || freebsd ; then +@@ -7362,12 +7325,12 @@ + echocheck "joystick" + _def_joystick='#undef HAVE_JOYSTICK' + if test "$_joystick" = yes ; then +- if linux ; then ++# if linux ; then + # TODO add some check + _def_joystick='#define HAVE_JOYSTICK 1' +- else +- _joystick="no (unsupported under $system_name)" +- fi ++# else ++# _joystick="no (unsupported under $system_name)" ++# fi + fi + echores "$_joystick" + diff --git a/multimedia/mplayer/files/patch-input-joystick.c b/multimedia/mplayer/files/patch-input-joystick.c new file mode 100644 index 000000000000..f57f78b57235 --- /dev/null +++ b/multimedia/mplayer/files/patch-input-joystick.c @@ -0,0 +1,29 @@ +--- input/joystick.c.orig Sat Mar 31 05:10:08 2007 ++++ input/joystick.c Sat Mar 31 05:09:30 2007 +@@ -24,8 +24,6 @@ + #define JS_DEV "/dev/input/js0" + #endif + +-#ifdef TARGET_LINUX +- + #include + + int axis[256]; +@@ -147,17 +145,3 @@ + return MP_INPUT_NOTHING; + } + +-#else +- +-// dummy function +- +-int mp_input_joystick_init(char* dev) { +- return -1; +-} +- +-int mp_input_joystick_read(int fd) { +- +- return MP_INPUT_NOTHING; +-} +- +-#endif -- cgit