From b0b503d7f82104f83ef0376d478854fa804a414b Mon Sep 17 00:00:00 2001 From: Stefan Fiedler Date: Thu, 16 Mar 2006 03:13:19 +0000 Subject: [PATCH] Stefan Fiedler: (copied from http://wiki.linuxfromscratch.org/blfs/wiki/W3M) When W3M is built against GPM compiled according to recommendations of NCurses maintainer (i.e., with the --without-curses configure option), W3M fails to link due to the Gpm_Wgetch() function missing from the GPM library. This patch fixes the issue by adding a substitute for the missing function to W3M. After patching, run autoconf to regenerate the configure script. Index: package/esden/w3m/w3m-0.5.1-gpm_fix-1.patch =================================================================== [2006022613193624501] (https://www.rocklinux.net/submaster) git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@7220 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- package/esden/w3m/w3m-0.5.1-gpm_fix-1.patch | 134 ++++++++++++++++++++ package/esden/w3m/w3m.conf | 2 + 2 files changed, 136 insertions(+) create mode 100644 package/esden/w3m/w3m-0.5.1-gpm_fix-1.patch diff --git a/package/esden/w3m/w3m-0.5.1-gpm_fix-1.patch b/package/esden/w3m/w3m-0.5.1-gpm_fix-1.patch new file mode 100644 index 000000000..514473cf9 --- /dev/null +++ b/package/esden/w3m/w3m-0.5.1-gpm_fix-1.patch @@ -0,0 +1,134 @@ +copied from http://wiki.linuxfromscratch.org/blfs/attachment/wiki/W3M/w3m-0.5.1-gpm_fix-1.patch +- stf + +Submitted by: Alexander E. Patrakov +Date: 2005-09-24 +Initial Package Version: 0.5.1 +Upstream Status: Will submit +Origin: Alexander E. Patrakov +Description: fixes w3m compilation failure when GPM is built --without-curses + +diff -urN w3m-0.5.1/configure.in w3m-0.5.1.fixed/configure.in +--- w3m-0.5.1/configure.in 2004-04-29 00:19:25.000000000 +0600 ++++ w3m-0.5.1.fixed/configure.in 2005-09-24 16:39:11.000000000 +0600 +@@ -97,6 +97,7 @@ + AC_SUBST(USE_W3M) + AC_CHECK_LIB(gpm, Gpm_Open, [AC_DEFINE(USE_GPM) + W3M_LIBS="$W3M_LIBS -lgpm"]) ++ AC_CHECK_LIB(gpm, Gpm_Wgetch, AC_DEFINE(HAVE_GPM_WGETCH)) + AC_SUBST(USE_SYSMOUSE) + AC_TRY_CPP([#include + MOUSE_GETINFO], [AC_DEFINE(USE_SYSMOUSE)]) +diff -urN w3m-0.5.1/gpm-libcurses.c w3m-0.5.1.fixed/gpm-libcurses.c +--- w3m-0.5.1/gpm-libcurses.c 1970-01-01 05:00:00.000000000 +0500 ++++ w3m-0.5.1.fixed/gpm-libcurses.c 2005-09-24 18:18:30.000000000 +0600 +@@ -0,0 +1,84 @@ ++/* ++ * libcurses.c - client library - curses level (gpm-Linux) ++ * ++ * Copied from GPM by Alexander E. Patrakov ++ * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) ++ * Copyright 2002 nico@schottelius.org (Nico Schottelius) ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ++ ********/ ++ ++#include ++#include ++#include /* select(); */ ++#include /* timeval */ ++#include /* socket() */ ++ ++#include "config.h" ++#if defined(USE_GPM) && !defined(HAVE_GPM_WGETCH) ++ ++extern int getch(); ++ ++#include ++#include ++ ++#define SELECT_TIME 86400 /* one day */ ++ ++int Gpm_Wgetch(void * dummy) ++{ ++fd_set selSet; ++int max, flag, result; ++int fd=STDIN_FILENO; ++static Gpm_Event ev; ++ ++ if (!gpm_flag || gpm_fd==-1) return getch(); ++ if (gpm_morekeys) return (*gpm_handler)(&ev,gpm_data); ++ gpm_hflag=0; ++ ++ max = (gpm_fd>fd) ? gpm_fd : fd; ++ ++/*...................................................................*/ ++ if (gpm_fd>=0) /* linux */ ++ while(1) ++ { ++ if (gpm_visiblepointer) GPM_DRAWPOINTER(&ev); ++ do ++ { ++ FD_ZERO(&selSet); ++ FD_SET(fd,&selSet); ++ FD_SET(gpm_fd,&selSet); ++ gpm_timeout.tv_sec=SELECT_TIME; ++ errno = 0; ++ flag=select(max+1,&selSet,(fd_set *)NULL,(fd_set *)NULL,&gpm_timeout); ++ } ++ while (!flag); ++ ++ if (flag==-1) ++ continue; ++ ++ if (FD_ISSET(fd,&selSet)) ++ return getch(); ++ ++ if (Gpm_GetEvent(&ev) && gpm_handler ++ && (result=(*gpm_handler)(&ev,gpm_data))) ++ { ++ gpm_hflag=1; ++ return result; ++ } ++ } ++ return 0; ++} ++#endif ++ +diff -urN w3m-0.5.1/Makefile.in w3m-0.5.1.fixed/Makefile.in +--- w3m-0.5.1/Makefile.in 2004-04-26 23:04:48.000000000 +0600 ++++ w3m-0.5.1.fixed/Makefile.in 2005-09-24 16:48:54.000000000 +0600 +@@ -85,11 +85,11 @@ + SRCS=main.c file.c buffer.c display.c etc.c search.c linein.c table.c local.c \ + form.c map.c frame.c rc.c menu.c mailcap.c image.c \ + symbol.c entity.c terms.c url.c ftp.c mimehead.c regex.c news.c \ +- func.c cookie.c history.c backend.c $(KEYBIND_SRC) ++ func.c cookie.c history.c backend.c gpm-libcurses.c $(KEYBIND_SRC) + OBJS=main.o file.o buffer.o display.o etc.o search.o linein.o table.o local.o\ + form.o map.o frame.o rc.o menu.o mailcap.o image.o \ + symbol.o entity.o terms.o url.o ftp.o mimehead.o regex.o news.o \ +- func.o cookie.o history.o backend.o $(KEYBIND_OBJ) ++ func.o cookie.o history.o backend.o gpm-libcurses.o $(KEYBIND_OBJ) + LSRCS=anchor.c parsetagx.c tagtable.c istream.c + LOBJS=anchor.o parsetagx.o tagtable.o istream.o + LLOBJS=version.o +diff -urN w3m-0.5.1/config.h.in w3m-0.5.1.fixed/config.h.in +--- w3m-0.5.1/config.h.in 2004-04-04 22:47:20.000000000 +0600 ++++ w3m-0.5.1.fixed/config.h.in 2005-09-24 16:50:43.000000000 +0600 +@@ -231,3 +231,4 @@ + #define INFLATE_NAME "inflate" + ++#undef HAVE_GPM_WGETCH + #endif /* CONFIG_H_SEEN */ diff --git a/package/esden/w3m/w3m.conf b/package/esden/w3m/w3m.conf index 733b78a07..d89cbbf95 100644 --- a/package/esden/w3m/w3m.conf +++ b/package/esden/w3m/w3m.conf @@ -26,3 +26,5 @@ var_append extraconfopt ' ' "--enable-gopher" # --no-as-needed" does not include gcc_s when it is needed... var_append GCC_WRAPPER_INSERT ' ' '-lgcc_s' +# w3m-0.5.1-gpm_fix-1.patch requires configure to be recreated +var_append preconf 5 "autoconf" \ No newline at end of file