Patch For Ubuntu and Other Stuff

View: New views
1 Messages — Rating Filter:   Alert me  

Patch For Ubuntu and Other Stuff

by Kory Prince :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi I got a new email first of all.
Now on to business.

First of all I too had the problem with 0.8.1-2 not compiling due to the
libxf86config thing.

So basically what I did is manually go through and unpatch Danny's
xsetwacom patch as well as another reference to libxf86config.
(for some reason reverse patching was unsuccesful)
I am attaching a patch that will remove Danny's patch and let you
compile on Ubuntu/debian until we get this worked out.
That being said, Danny's patch will not work on Ubuntu for now.
(but the wacomcpl one will! Thanks Danny for your hard work)

just cd into the folder you untarred and run
patch -p0 -i patchfile

(for us newbies out there)

After working hours getting that to work (like I said, "US newbies")
I compiled it and I can confirm the pressure is fixed, and wacomcpl and
xsetwacom seem to be working better.
However the calibration button only pops up on "stylus"
(but there are no more weird errors.... there is though two "touch"
entries)

Calibrating works in the sense that you can click and it seems to
calibrate, but it does not calibrate correctly...
(i.e. giving values of bottomx and bottomy 1280 and 800 when the values
that work are 26300 and 16375.... My guess this has something to do with
the "tablet-scaling" stuff I have seen in compiling....)
Thus I still calibrate with xorg.conf.
Changeing feel values does work however...
also xsetwacom accepts presscurve values now...

That is all I can think of now.... Hope I have helped again....

p.s. for ubuntuers I have a short tutorial for the faint of heart that
will help you get this working....
I may not update it to include this patch until tomorrow though...

http://ubuntuforums.org/showthread.php?p=5469447#post5469447

Kory

[patch.diff]

Only in linuxwacom_old/: patch.diff
--- src/util/Makefile.am 2008-08-01 15:13:53.000000000 -0500
+++ src/util/Makefile.am 2008-08-03 14:24:37.000000000 -0500
@@ -4,15 +4,7 @@
 wacomcfgdir = $(includedir)/wacomcfg
 wacomcfg_HEADERS = wacomcfg.h
 
-if WCM_ENV_XORGSDK
-WACOMCFG_INCLUDES = -I$(WCM_XORGSDK_DIR) $(X_CFLAGS)
-endif
-
-if WCM_ENV_XFREE86
-WACOMCFG_INCLUDES = -I$(WCM_XFREE86_DIR)
-endif
-
-AM_CFLAGS = -Wall -pedantic $(WACOMCFG_INCLUDES)
+AM_CFLAGS = -Wall -pedantic
 
 # These identify which programs, libraries, and headers could
 # potentially be built or installed depending on the results of
@@ -36,7 +28,7 @@
 
 libwacomcfg_la_SOURCES = wacomcfg.c wacomcfg.h ../include/Xwacom.h
 libwacomcfg_la_LDFLAGS = -no-undefined -version-info @WCM_LIBWACOMCFG_VER@
-libwacomcfg_la_LIBADD = @WCM_LIBWACOMCFG_LIBS@ -lxf86config -lm
+libwacomcfg_la_LIBADD = @WCM_LIBWACOMCFG_LIBS@
 
 xsetwacom_SOURCES = xsetwacom.c wacomcfg.h wcmAction.c wcmAction.h ../include/Xwacom.h
 xsetwacom_LDADD = libwacomcfg.la
--- src/util/Makefile.in 2008-08-01 15:13:53.000000000 -0500
+++ src/util/Makefile.in 2008-08-03 14:37:28.000000000 -0500
@@ -267,7 +267,7 @@
 @WCM_ENV_NCURSES_TRUE@xidump_LDADD = -lncurses
 libwacomcfg_la_SOURCES = wacomcfg.c wacomcfg.h ../include/Xwacom.h
 libwacomcfg_la_LDFLAGS = -no-undefined -version-info @WCM_LIBWACOMCFG_VER@
-libwacomcfg_la_LIBADD = @WCM_LIBWACOMCFG_LIBS@ -lxf86config -lm
+libwacomcfg_la_LIBADD = @WCM_LIBWACOMCFG_LIBS@
 xsetwacom_SOURCES = xsetwacom.c wacomcfg.h wcmAction.c wcmAction.h ../include/Xwacom.h
 xsetwacom_LDADD = libwacomcfg.la
 all: all-am
--- src/util/wacomcfg.c 2008-08-01 15:13:53.000000000 -0500
+++ src/util/wacomcfg.c 2008-08-03 14:34:47.000000000 -0500
@@ -40,20 +40,11 @@
 #include <stdio.h> /* debugging only, we've got no business output text */
 #include <ctype.h>
 #include <stdlib.h>
-#include <stdarg.h>
 #include <errno.h>
 #include <string.h>
 #include <memory.h>
 #include <assert.h>
 
-#include "xf86Parser.h"
-
-WACOMDEVICETYPE checkIfWacomDevice (XF86ConfigPtr, const char*);
-WACOMDEVICETYPE mapStringToType (const char*);
-XF86ConfigPtr readConfig (char *);
-void VErrorF(const char*, va_list);
-void ErrorF (const char*, ...);
-
 /*****************************************************************************
 ** Internal structures
 *****************************************************************************/
@@ -131,7 +122,6 @@
  unsigned char* pReq;
  WACOMDEVICEINFO* pInfo;
  XDeviceInfo* info;
- XF86ConfigPtr conf;
  char devName[64];
 
  if (!hConfig || !ppInfo || !puCount)
@@ -141,9 +131,6 @@
  if (!hConfig->pDevs && CfgGetDevs(hConfig))
  return -1;
 
- /* read the config in for wacom devices which don'T use the commnon identifier */
- conf = readConfig ("/etc/X11/xorg.conf");
-
  /* estimate size of memory needed to hold structures */
  nSize = nCount = 0;
  for (i=0; i<hConfig->nDevCnt; ++i)
@@ -193,11 +180,18 @@
  for (j=0; j<strlen(pInfo->pszName); j++)
  devName[j] = tolower(pInfo->pszName[j]);
  devName[j] = '\0';
-
- pInfo->type = mapStringToType (devName);
-
- if ( pInfo->type == WACOMDEVICETYPE_UNKNOWN )
- pInfo->type = checkIfWacomDevice (conf, pInfo->pszName);
+ if (strstr(devName,"cursor") != NULL)
+ pInfo->type = WACOMDEVICETYPE_CURSOR;
+ else if (strstr(devName,"stylus") != NULL)
+ pInfo->type = WACOMDEVICETYPE_STYLUS;
+ else if (strstr(devName,"eraser") != NULL)
+ pInfo->type = WACOMDEVICETYPE_ERASER;
+ else if (strstr(devName,"touch") != NULL)
+ pInfo->type = WACOMDEVICETYPE_TOUCH;
+ else if (strstr(devName,"pad") != NULL)
+ pInfo->type = WACOMDEVICETYPE_PAD;
+ else
+ pInfo->type = WACOMDEVICETYPE_UNKNOWN;
 
  if ( pInfo->type != WACOMDEVICETYPE_UNKNOWN )
  {
@@ -214,60 +208,6 @@
  return 0;
 }
 
-WACOMDEVICETYPE checkIfWacomDevice (XF86ConfigPtr conf, const char* pszDeviceName) {
- XF86ConfInputPtr ip;
-
- if (!conf || !pszDeviceName) { return WACOMDEVICETYPE_UNKNOWN; }
-
- ip = (XF86ConfInputPtr) conf->conf_input_lst;
- if (!ip) { return WACOMDEVICETYPE_UNKNOWN; }
-
- for (;ip;ip=ip->list.next)
- {
- XF86OptionPtr op = (XF86OptionPtr) ip->inp_option_lst;
- char* type = 0;
-
- if (!op) { return WACOMDEVICETYPE_UNKNOWN; }
-
- if (strcasecmp(ip->inp_identifier, pszDeviceName) != 0)
- continue;
-
- if (strcasecmp(ip->inp_driver,"wacom") != 0)
- continue;
-
- for (;op;op=op->list.next)
- {
- if (strcasecmp(op->opt_name,"Type") == 0)
- {
- type = op->opt_val;
- return mapStringToType(type);
- }
- }
- }
-
- return WACOMDEVICETYPE_UNKNOWN;
-}
-
-WACOMDEVICETYPE mapStringToType (const char* name)
-{
- if (!name)
- return WACOMDEVICETYPE_UNKNOWN;
-
- if (strstr(name,"cursor") != NULL)
- return WACOMDEVICETYPE_CURSOR;
- else if (strstr(name,"stylus") != NULL)
- return WACOMDEVICETYPE_STYLUS;
- else if (strstr(name,"eraser") != NULL)
- return WACOMDEVICETYPE_ERASER;
- else if (strstr(name,"touch") != NULL)
- return WACOMDEVICETYPE_TOUCH;
- else if (strstr(name,"pad") != NULL)
- return WACOMDEVICETYPE_PAD;
- else
- return WACOMDEVICETYPE_UNKNOWN;
-
-}
-
 WACOMDEVICE * WacomConfigOpenDevice(WACOMCONFIG * hConfig,
  const char* pszDeviceName)
 {
@@ -453,41 +393,3 @@
 
  free(pvData);
 }
-
-XF86ConfigPtr readConfig (char *filename)
-{
- XF86ConfigPtr conf = 0;
- const char *file   = 0;
- char CONFPATH[]= "%A,%R,/etc/%R,%P/etc/X11/%R,%E,%F,/etc/X11/%F," \
- "%P/etc/X11/%F,%D/%X,/etc/X11/%X,/etc/%X,%P/etc/X11/%X.%H," \
- "%P/etc/X11/%X,%P/lib/X11/%X.%H,%P/lib/X11/%X";
-
- if (!(file = (char*)xf86openConfigFile (CONFPATH, filename, 0)))
- {
- fprintf (stderr, "Unable to open config file\n");
- return 0;
- }
-
- if ((conf = (XF86ConfigPtr)xf86readConfigFile ()) == 0)
- {
- fprintf (stderr, "Problem when parsing config file\n");
- xf86closeConfigFile ();
- return 0;
- }
-
- xf86closeConfigFile ();
- return conf;
-}
-
-void VErrorF(const char *f, va_list args)
-{
- vfprintf(stderr, f, args);
-}
-
-void ErrorF(const char *f, ...)
-{
- va_list args;
- va_start(args, f);
- vfprintf(stderr, f, args);
- va_end(args);
-}


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@...
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel