summaryrefslogtreecommitdiffstats
path: root/recipes-extended/rxtx
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-extended/rxtx')
-rw-r--r--recipes-extended/rxtx/files/kfreebsd_libpthread.patch17
-rw-r--r--recipes-extended/rxtx/files/kfreebsd_port.patch309
-rw-r--r--recipes-extended/rxtx/files/multiple_property_dirs.patch168
-rw-r--r--recipes-extended/rxtx/files/original_debian_changes.patch117
-rw-r--r--recipes-extended/rxtx/files/port_to_hurd.patch16
-rw-r--r--recipes-extended/rxtx/files/sys_io_h_check.patch35
-rw-r--r--recipes-extended/rxtx/files/ttyACM_port.patch28
-rw-r--r--recipes-extended/rxtx/files/uninstall_target.patch18
-rw-r--r--recipes-extended/rxtx/files/zsystem_init_exception.patch19
-rw-r--r--recipes-extended/rxtx/rxtx_2.2.0.bb48
10 files changed, 775 insertions, 0 deletions
diff --git a/recipes-extended/rxtx/files/kfreebsd_libpthread.patch b/recipes-extended/rxtx/files/kfreebsd_libpthread.patch
new file mode 100644
index 0000000..19040d2
--- /dev/null
+++ b/recipes-extended/rxtx/files/kfreebsd_libpthread.patch
@@ -0,0 +1,17 @@
1Description: libc_r is not available, use libpthread
2Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=585089
3Author: Scott Howard <showard@debian.org>
4
5Index: rxtx/configure.in
6===================================================================
7--- rxtx.orig/configure.in 2011-02-06 11:13:16.151426139 -0500
8+++ rxtx/configure.in 2011-02-06 11:13:58.820020857 -0500
9@@ -575,7 +575,7 @@
10 ;;
11
12 *BSD)
13- LDFLAGS=$LDFLAGS" -lc_r"
14+ LDFLAGS=$LDFLAGS" -lpthread"
15 JHOME=$JPATH/"lib"
16 CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1"
17 TARGETLIB="\$(target_triplet)/librxtxSerial.la \
diff --git a/recipes-extended/rxtx/files/kfreebsd_port.patch b/recipes-extended/rxtx/files/kfreebsd_port.patch
new file mode 100644
index 0000000..b5fa172
--- /dev/null
+++ b/recipes-extended/rxtx/files/kfreebsd_port.patch
@@ -0,0 +1,309 @@
1Description: Defines FreeBSD for kFreeBSD systems, also makes sure kfreeBSD is set to use FHS
2#grep -r -H "__FreeBSD" . -m 1 --exclude=*.patch --exclude-dir=.git | cut -d: -f1 | xargs sed -i s/__FreeBSD__/__FreeBSD_kernel__/
3Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=585089
4Author: Scott Howard <showard@debian.org>
5
6Index: rxtx/src/RS485Imp.c
7===================================================================
8--- rxtx.orig/src/RS485Imp.c 2011-02-23 22:53:43.393378664 -0500
9+++ rxtx/src/RS485Imp.c 2011-02-23 22:53:52.663072550 -0500
10@@ -120,11 +120,11 @@
11 threads, because it slows things down. Go figure. */
12
13 /* POSIX signal handling functions */
14-#if !defined(__FreeBSD___)
15+#if !defined(__FreeBSD_kernel___)
16 struct sigaction handler;
17 sigaction( SIGIO, NULL, &handler );
18 if( !handler.sa_handler ) signal( SIGIO, SIG_IGN );
19-#endif /* !__FreeBSD__ */
20+#endif /* !__FreeBSD_kernel__ */
21 #if defined(__linux__)
22 /* Lets let people who upgraded kernels know they may have problems */
23 if (uname (&name) == -1)
24@@ -178,7 +178,7 @@
25 ttyset.c_cc[ VMIN ] = 0;
26 ttyset.c_cc[ VTIME ] = 0;
27
28-#ifdef __FreeBSD__
29+#ifdef __FreeBSD_kernel__
30 if( cfsetspeed( &ttyset, B9600 ) < 0 ) goto fail;
31 #else
32 if( cfsetispeed( &ttyset, B9600 ) < 0 ) goto fail;
33@@ -238,7 +238,7 @@
34 if( !translate_data_bits( env, (int *)&(ttyset.c_cflag), dataBits ) ) return; /* dima c_cflag in darwin is unsigned long */
35 if( !translate_stop_bits( env, (int *)&(ttyset.c_cflag), stopBits ) ) return; /* dima c_cflag in darwin is unsigned long */
36 if( !translate_parity( env, (int *)&(ttyset.c_cflag), parity ) ) return;/* dima c_cflag in darwin is unsigned long */
37-#ifdef __FreeBSD__
38+#ifdef __FreeBSD_kernel__
39 if( cfsetspeed( &ttyset, cspeed ) < 0 ) goto fail;
40 #else
41 if( cfsetispeed( &ttyset, cspeed ) < 0 ) goto fail;
42@@ -1290,7 +1290,7 @@
43 return(JNI_FALSE);
44 }
45 #endif
46-#if defined(__FreeBSD__)
47+#if defined(__FreeBSD_kernel__)
48 if(!strcmp(name,"tty0")|| !strcmp(name,"ttyd")||
49 !strcmp(name,"ttyq")|| !strcmp(name,"ttym")||
50 !strcmp(name,"ttyf")|| !strcmp(name,"ttyS")||
51Index: rxtx/src/RawImp.c
52===================================================================
53--- rxtx.orig/src/RawImp.c 2011-02-23 22:53:43.413378002 -0500
54+++ rxtx/src/RawImp.c 2011-02-23 22:53:52.663072550 -0500
55@@ -265,11 +265,11 @@
56 threads, because it slows things down. Go figure. */
57
58 /* POSIX signal handling functions */
59-#if !defined(__FreeBSD___)
60+#if !defined(__FreeBSD_kernel___)
61 struct sigaction handler;
62 sigaction( SIGIO, NULL, &handler );
63 if( !handler.sa_handler ) signal( SIGIO, SIG_IGN );
64-#endif /* !__FreeBSD__ */
65+#endif /* !__FreeBSD_kernel__ */
66 #if defined(__linux__)
67 /* Lets let people who upgraded kernels know they may have problems */
68 if (uname (&name) == -1)
69@@ -307,7 +307,7 @@
70 if( !translate_data_bits( env, (int *)&(ttyset.c_cflag), dataBits ) ) return; /* dima c_flag darwin unsigned long */
71 if( !translate_stop_bits( env, (int *)&(ttyset.c_cflag), stopBits ) ) return; /* dima c_flag darwin unsigned long */
72 if( !translate_parity( env, (int *)&(ttyset.c_cflag), parity ) ) return;/* dima c_flag darwin unsigned long */
73-#ifdef __FreeBSD__
74+#ifdef __FreeBSD_kernel__
75 if( cfsetspeed( &ttyset, cspeed ) < 0 ) goto fail;
76 #else
77 if( cfsetispeed( &ttyset, cspeed ) < 0 ) goto fail;
78@@ -1289,7 +1289,7 @@
79 return(JNI_FALSE);
80 }
81 #endif
82-#if defined(__FreeBSD__)
83+#if defined(__FreeBSD_kernel__)
84 if(!strcmp(name,"tty0")|| !strcmp(name,"ttyd")||
85 !strcmp(name,"ttyq")|| !strcmp(name,"ttym")||
86 !strcmp(name,"ttyf")|| !strcmp(name,"ttyS")||
87Index: rxtx/src/SerialImp.h
88===================================================================
89--- rxtx.orig/src/SerialImp.h 2011-02-23 22:53:43.423377671 -0500
90+++ rxtx/src/SerialImp.h 2011-02-23 22:55:45.573475048 -0500
91@@ -97,7 +97,7 @@
92
93 /* glue for unsupported linux speeds see also win32termios.h */
94
95-#if !defined(__APPLE__) && !defined(__FreeBSD__) /* dima */
96+#if !defined(__APPLE__) && !defined(__FreeBSD_kernel__) /* dima */
97 /* this is now handled in SerialImp.c
98 #define B14400 1010001
99 #define B28800 1010002
100@@ -147,7 +147,7 @@
101 };
102
103 /* Ports known on the OS */
104-#if defined(__linux__)
105+#if defined(__linux__) || defined(__FreeBSD_kernel__)
106 /*
107 This is a small hack to get mark and space parity working on older systems
108 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533
109Index: rxtx/src/SerialImp.c
110===================================================================
111--- rxtx.orig/src/SerialImp.c 2011-02-23 22:53:43.443377009 -0500
112+++ rxtx/src/SerialImp.c 2011-02-23 22:53:52.663072550 -0500
113@@ -423,7 +423,7 @@
114 ttyset.c_cc[ VMIN ] = 0;
115 ttyset.c_cc[ VTIME ] = 0;
116
117-#ifdef __FreeBSD__
118+#ifdef __FreeBSD_kernel__
119 if( cfsetspeed( &ttyset, B9600 ) < 0 ) goto fail;
120 #else
121 if( cfsetispeed( &ttyset, B9600 ) < 0 ) goto fail;
122@@ -844,13 +844,13 @@
123 return(1);
124 }
125
126-#ifdef __FreeBSD__
127+#ifdef __FreeBSD_kernel__
128 if( cfsetspeed( &ttyset, cspeed ) < 0 )
129 {
130 report( "set_port_params: Cannot Set Speed\n" );
131 return( 1 );
132 }
133-#endif /* __FreeBSD__ */
134+#endif /* __FreeBSD_kernel__ */
135 if( !cspeed )
136 {
137 /* hang up the modem aka drop DTR */
138@@ -4705,7 +4705,7 @@
139 stat(teststring,&mystat);
140 #endif /* __sun__ */
141 /* XXX the following hoses freebsd when it tries to open the port later on */
142-#ifndef __FreeBSD__
143+#ifndef __FreeBSD_kernel__
144 if(S_ISCHR(mystat.st_mode)){
145 fd=OPEN(teststring,O_RDONLY|O_NONBLOCK);
146 if (fd>0){
147Index: rxtx/src/ParallelImp.c
148===================================================================
149--- rxtx.orig/src/ParallelImp.c 2011-02-23 22:53:43.463376347 -0500
150+++ rxtx/src/ParallelImp.c 2011-02-23 22:53:52.663072550 -0500
151@@ -111,7 +111,7 @@
152 #if defined(__linux__)
153 # include <linux/lp.h>
154 #endif
155-#if defined(__FreeBSD__)
156+#if defined(__FreeBSD_kernel__)
157 /* # include <machine/lpt.h> ? is this changed or wrong */
158 # include <dev/ppbus/lpt.h>
159 #endif
160@@ -265,7 +265,7 @@
161 #if defined(__linux__)
162 return( status & LP_BUSY ? JNI_TRUE : JNI_FALSE );
163 #endif
164-#if defined(__FreeBSD__)
165+#if defined(__FreeBSD_kernel__)
166 return( status & EBUSY ? JNI_TRUE : JNI_FALSE );
167 #endif
168 return(JNI_FALSE);
169@@ -341,7 +341,7 @@
170 ioctl(fd, LPGETSTATUS, &status);
171 return( status & LP_BUSY ? JNI_TRUE : JNI_FALSE );
172 #endif
173-#if defined(__FreeBSD__)
174+#if defined(__FreeBSD_kernel__)
175 printf("ParallelImp.c LPGETSTATUS not defined\n");
176 /*
177 return( status & EBUSY ? JNI_TRUE : JNI_FALSE );
178Index: rxtx/src/I2CImp.c
179===================================================================
180--- rxtx.orig/src/I2CImp.c 2011-02-23 22:53:43.483375685 -0500
181+++ rxtx/src/I2CImp.c 2011-02-23 22:53:52.663072550 -0500
182@@ -120,11 +120,11 @@
183 threads, because it slows things down. Go figure. */
184
185 /* POSIX signal handling functions */
186-#if !defined(__FreeBSD___)
187+#if !defined(__FreeBSD_kernel___)
188 struct sigaction handler;
189 sigaction( SIGIO, NULL, &handler );
190 if( !handler.sa_handler ) signal( SIGIO, SIG_IGN );
191-#endif /* !__FreeBSD__ */
192+#endif /* !__FreeBSD_kernel__ */
193 #if defined(__linux__)
194 /* Lets let people who upgraded kernels know they may have problems */
195 if (uname (&name) == -1)
196@@ -178,7 +178,7 @@
197 ttyset.c_cc[ VMIN ] = 0;
198 ttyset.c_cc[ VTIME ] = 0;
199
200-#ifdef __FreeBSD__
201+#ifdef __FreeBSD_kernel__
202 if( cfsetspeed( &ttyset, B9600 ) < 0 ) goto fail;
203 #else
204 if( cfsetispeed( &ttyset, B9600 ) < 0 ) goto fail;
205@@ -238,7 +238,7 @@
206 if( !translate_data_bits( env, (int *)&(ttyset.c_cflag), dataBits ) ) return; /* dima darwin defime c_cflag as unsigned long */
207 if( !translate_stop_bits( env, (int *)&(ttyset.c_cflag), stopBits ) ) return; /* dima darwin defime c_cflag as unsigned long */
208 if( !translate_parity( env, (int *)&(ttyset.c_cflag), parity ) ) return;/* dima darwin defime c_cflag as unsigned long */
209-#ifdef __FreeBSD__
210+#ifdef __FreeBSD_kernel__
211 if( cfsetspeed( &ttyset, cspeed ) < 0 ) goto fail;
212 #else
213 if( cfsetispeed( &ttyset, cspeed ) < 0 ) goto fail;
214@@ -1220,7 +1220,7 @@
215 return(JNI_FALSE);
216 }
217 #endif
218-#if defined(__FreeBSD__)
219+#if defined(__FreeBSD_kernel__)
220 if(!strcmp(name,"tty0")|| !strcmp(name,"ttyd")||
221 !strcmp(name,"ttyq")|| !strcmp(name,"ttym")||
222 !strcmp(name,"ttyf")|| !strcmp(name,"ttyS")||
223Index: rxtx/src/SerialImp.cpp
224===================================================================
225--- rxtx.orig/src/SerialImp.cpp 2011-02-23 22:53:43.503375023 -0500
226+++ rxtx/src/SerialImp.cpp 2011-02-23 22:53:52.663072550 -0500
227@@ -135,11 +135,11 @@
228 threads, because it slows things down. Go figure. */
229
230 /* POSIX signal handling functions */
231-#if !defined(__FreeBSD___)
232+#if !defined(__FreeBSD_kernel___)
233 struct sigaction handler;
234 sigaction( SIGIO, NULL, &handler );
235 if( !handler.sa_handler ) signal( SIGIO, SIG_IGN );
236-#endif /* !__FreeBSD__ */
237+#endif /* !__FreeBSD_kernel__ */
238 #ifdef DEBUG
239 /* Lets let people who upgraded kernels know they may have problems */
240 if (uname (&name) == -1)
241Index: rxtx/CNI/SerialImp.h
242===================================================================
243--- rxtx.orig/CNI/SerialImp.h 2011-02-23 22:53:43.523374359 -0500
244+++ rxtx/CNI/SerialImp.h 2011-02-23 22:53:52.663072550 -0500
245@@ -97,7 +97,7 @@
246
247 /* glue for unsupported linux speeds see also win32termios.h */
248
249-#if !defined(__APPLE__) && !defined(__FreeBSD__) /* dima */
250+#if !defined(__APPLE__) && !defined(__FreeBSD_kernel__) /* dima */
251 /* this is now handled in SerialImp.c
252 #define B14400 1010001
253 #define B28800 1010002
254@@ -165,7 +165,7 @@
255 # define LOCKFILEPREFIX "LK."
256 # define UUCP
257 #endif /* __sgi__ || sgi */
258-#if defined(__FreeBSD__)
259+#if defined(__FreeBSD_kernel__)
260 # define DEVICEDIR "/dev/"
261 # define LOCKDIR "/var/spool/uucp"
262 # define LOCKFILEPREFIX "LK."
263@@ -176,7 +176,7 @@
264 # define LOCKDIR "/var/spool/uucp"
265 # define LOCKFILEPREFIX "LK."
266 # define UUCP
267-#endif /* __FreeBSD__ */
268+#endif /* __FreeBSD_kernel__ */
269 #if defined(__NetBSD__)
270 # define DEVICEDIR "/dev/"
271 # define LOCKDIR "/usr/spool/uucp"
272Index: rxtx/CNI/SerialImp.c
273===================================================================
274--- rxtx.orig/CNI/SerialImp.c 2011-02-23 22:53:43.543373697 -0500
275+++ rxtx/CNI/SerialImp.c 2011-02-23 22:53:52.663072550 -0500
276@@ -382,7 +382,7 @@
277 ttyset.c_cc[ VMIN ] = 0;
278 ttyset.c_cc[ VTIME ] = 0;
279
280-#ifdef __FreeBSD__
281+#ifdef __FreeBSD_kernel__
282 if( cfsetspeed( &ttyset, B9600 ) < 0 ) goto fail;
283 #else
284 if( cfsetispeed( &ttyset, B9600 ) < 0 ) goto fail;
285@@ -686,13 +686,13 @@
286 return(1);
287 }
288
289-#ifdef __FreeBSD__
290+#ifdef __FreeBSD_kernel__
291 if( cfsetspeed( &ttyset, cspeed ) < 0 )
292 {
293 report( "set_port_params: Cannot Set Speed\n" );
294 return( 1 );
295 }
296-#endif /* __FreeBSD__ */
297+#endif /* __FreeBSD_kernel__ */
298 if( !cspeed )
299 {
300 /* hang up the modem aka drop DTR */
301@@ -4257,7 +4257,7 @@
302 stat(teststring,&mystat);
303 #endif /* __sun__ */
304 /* XXX the following hoses freebsd when it tries to open the port later on */
305-#ifndef __FreeBSD__
306+#ifndef __FreeBSD_kernel__
307 if(S_ISCHR(mystat.st_mode)){
308 fd=::OPEN(teststring,O_RDONLY|O_NONBLOCK);
309 if (fd>0){
diff --git a/recipes-extended/rxtx/files/multiple_property_dirs.patch b/recipes-extended/rxtx/files/multiple_property_dirs.patch
new file mode 100644
index 0000000..6664966
--- /dev/null
+++ b/recipes-extended/rxtx/files/multiple_property_dirs.patch
@@ -0,0 +1,168 @@
1Description: Handles the case when "java.ext.dirs" system property contains
2 more than one directory.
3Author: Philip Ashmore <contact@philipashmore.com>
4Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=646069
5Index: rxtx/src/gnu/io/RXTXCommDriver.java
6===================================================================
7--- rxtx.orig/src/gnu/io/RXTXCommDriver.java 2011-10-28 13:02:43.046717064 -0400
8+++ rxtx/src/gnu/io/RXTXCommDriver.java 2011-10-28 13:02:43.186717068 -0400
9@@ -356,7 +356,7 @@
10 First try to register ports specified in the properties
11 file. If that doesn't exist, then scan for ports.
12 */
13- for (int PortType=CommPortIdentifier.PORT_SERIAL;PortType<=CommPortIdentifier.PORT_PARALLEL;PortType++) {
14+ for (int PortType=CommPortIdentifier.PORT_SERIAL; PortType<=CommPortIdentifier.PORT_PARALLEL; PortType++) {
15 if (!registerSpecifiedPorts(PortType)) {
16 if (!registerKnownPorts(PortType)) {
17 registerScannedPorts(PortType);
18@@ -375,10 +375,18 @@
19 while (tok.hasMoreElements())
20 {
21 String PortName = tok.nextToken();
22-
23- if (testRead(PortName, PortType))
24+ if(debug)
25+ System.out.println("Trying " + PortName + ".");
26+ if (testRead(PortName, PortType)) {
27 CommPortIdentifier.addPortName(PortName,
28 PortType, this);
29+ if(debug)
30+ System.out.println("Success: Read from " + PortName + ".");
31+ }else{
32+ if(debug)
33+ System.out.println("Fail: Cannot read from " + PortName
34+ + ".");
35+ }
36 }
37 }
38
39@@ -402,26 +410,39 @@
40 private boolean registerSpecifiedPorts(int PortType)
41 {
42 String val = null;
43- Properties origp = System.getProperties();//save system properties
44-
45- try
46- {
47+ Properties origp = System.getProperties(); // save system properties
48
49- String ext_dir=System.getProperty("java.ext.dirs")+System.getProperty("file.separator");
50- FileInputStream rxtx_prop=new FileInputStream(ext_dir+"gnu.io.rxtx.properties");
51- Properties p=new Properties();
52- p.load(rxtx_prop);
53- System.setProperties(p);
54- for (Iterator it = p.keySet().iterator(); it.hasNext();) {
55- String key = (String) it.next();
56- System.setProperty(key, p.getProperty(key));
57- }
58- }catch(Exception e){
59- if (debug){
60- System.out.println("The file: gnu.io.rxtx.properties doesn't exists.");
61- System.out.println(e.toString());
62- }//end if
63+ String [] ext_dirs = System.getProperty("java.ext.dirs").split(":");
64+ String fs = System.getProperty("file.separator");
65+ for (int n = 0; n < ext_dirs.length; ++n) {
66+ String ext_file = "?";
67+ try{
68+ ext_file = ext_dirs[n] + fs + "gnu.io.rxtx.properties";
69+ FileInputStream rxtx_prop = new FileInputStream(ext_file);
70+ Properties p=new Properties();
71+ p.load(rxtx_prop);
72+ System.setProperties(p);
73+ for (Iterator it = p.keySet().iterator(); it.hasNext();) {
74+ String key = (String) it.next();
75+ String value = p.getProperty(key);
76+ if(debug) {
77+ System.out.println(key + " -> " + value);
78+ }
79+ System.setProperty(key, value);
80+ }
81+ }catch(Exception e){
82+ if (debug){
83+ System.out.println("The file \"" + ext_file
84+ + "\" doesn't exist.");
85+ System.out.println(e.toString());
86+ }//end if
87+ continue;
88 }//end catch
89+ if (debug){
90+ System.out.println("Read properties from \"" + ext_file
91+ + "\".");
92+ }//end if
93+ }//end for
94
95 if (debug)
96 System.out.println("checking for system-known ports of type "+PortType);
97Index: rxtx/src/SerialImp.c
98===================================================================
99--- rxtx.orig/src/SerialImp.c 2011-10-28 13:02:43.078717065 -0400
100+++ rxtx/src/SerialImp.c 2011-10-28 13:02:43.190717067 -0400
101@@ -4359,7 +4359,11 @@
102
103 if( fd < 0 )
104 {
105- report_verbose( "testRead() open failed\n" );
106+ report_verbose( "testRead() open \"" );
107+ report_verbose( name );
108+ report_verbose( "\" failed: " );
109+ report_verbose( strerror(errno) );
110+ report_verbose( "\n" );
111 ret = JNI_FALSE;
112 goto END;
113 }
114@@ -5095,7 +5099,7 @@
115 exceptions: none
116 comments:
117 ----------------------------------------------------------*/
118-void report_warning(char *msg)
119+void report_warning(const char *msg)
120 {
121 #ifndef DEBUG_MW
122 fprintf(stderr, msg);
123@@ -5113,7 +5117,7 @@
124 exceptions: none
125 comments:
126 ----------------------------------------------------------*/
127-void report_verbose(char *msg)
128+void report_verbose(const char *msg)
129 {
130 #ifdef DEBUG_VERBOSE
131 #ifdef DEBUG_MW
132@@ -5132,7 +5136,7 @@
133 exceptions: none
134 comments:
135 ----------------------------------------------------------*/
136-void report_error(char *msg)
137+void report_error(const char *msg)
138 {
139 #ifndef DEBUG_MW
140 fprintf(stderr, msg);
141@@ -5150,7 +5154,7 @@
142 exceptions: none
143 comments:
144 ----------------------------------------------------------*/
145-void report(char *msg)
146+void report(const char *msg)
147 {
148 #ifdef DEBUG
149 # ifndef DEBUG_MW
150Index: rxtx/src/SerialImp.h
151===================================================================
152--- rxtx.orig/src/SerialImp.h 2011-10-28 13:02:43.162717067 -0400
153+++ rxtx/src/SerialImp.h 2011-10-28 13:02:43.194717067 -0400
154@@ -467,10 +467,10 @@
155 jboolean is_interrupted( struct event_info_struct * );
156 int send_event(struct event_info_struct *, jint, int );
157 void dump_termios(char *,struct termios *);
158-void report_verbose(char *);
159-void report_error(char *);
160-void report_warning(char *);
161-void report(char *);
162+void report_verbose(const char *);
163+void report_error(const char *);
164+void report_warning(const char *);
165+void report(const char *);
166 void throw_java_exception( JNIEnv *, char *, char *, char * );
167 int lock_device( const char * );
168 void unlock_device( const char * );
diff --git a/recipes-extended/rxtx/files/original_debian_changes.patch b/recipes-extended/rxtx/files/original_debian_changes.patch
new file mode 100644
index 0000000..32e9913
--- /dev/null
+++ b/recipes-extended/rxtx/files/original_debian_changes.patch
@@ -0,0 +1,117 @@
1Description: Removes makefile install of RXTXcomm.jar, silences an unnecessary compiling error
2Origin: Mario Joussen <joussen@debian.org>, edited by Scott Howard <showard314@gmail.com> <2010-06-03>
3
4Index: rxtx/src/RS485Imp.c
5===================================================================
6--- rxtx.orig/src/RS485Imp.c 2011-10-31 02:58:18.280985274 -0400
7+++ rxtx/src/RS485Imp.c 2011-10-31 02:58:21.300985346 -0400
8@@ -127,6 +127,7 @@
9 #endif /* !__FreeBSD_kernel__ */
10 #if defined(__linux__)
11 /* Lets let people who upgraded kernels know they may have problems */
12+ /*
13 if (uname (&name) == -1)
14 {
15 fprintf(stderr,"RXTX WARNING: cannot get system name\n");
16@@ -137,6 +138,7 @@
17 fprintf(stderr, "\n\n\nRXTX WARNING: This library was compiled to run with OS release %s and you are currently running OS release %s. In some cases this can be a problem. Try recompiling RXTX if you notice strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the include files that came with the kernel source and not an older copy.\n\n\npress enter to continue\n",UTS_RELEASE,name.release);
18 getchar();
19 }
20+ */
21 #endif /* __linux__ */
22 #endif /* WIN32 */
23 }
24Index: rxtx/src/RawImp.c
25===================================================================
26--- rxtx.orig/src/RawImp.c 2011-10-31 02:58:18.280985274 -0400
27+++ rxtx/src/RawImp.c 2011-10-31 02:58:21.300985346 -0400
28@@ -272,6 +272,7 @@
29 #endif /* !__FreeBSD_kernel__ */
30 #if defined(__linux__)
31 /* Lets let people who upgraded kernels know they may have problems */
32+ /*
33 if (uname (&name) == -1)
34 {
35 fprintf(stderr,"RXTX WARNING: cannot get system name\n");
36@@ -282,6 +283,7 @@
37 fprintf(stderr, "\n\n\nRXTX WARNING: This library was compiled to run with OS release %s and you are currently running OS release %s. In some cases this can be a problem. Try recompiling RXTX if you notice strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the include files that came with the kernel source and not an older copy.\n\n\npress enter to continue\n",UTS_RELEASE,name.release);
38 getchar();
39 }
40+ */
41 #endif /* __linux__ */
42 #endif /* WIN32 */
43 }
44Index: rxtx/src/SerialImp.c
45===================================================================
46--- rxtx.orig/src/SerialImp.c 2011-10-31 02:58:18.284985274 -0400
47+++ rxtx/src/SerialImp.c 2011-10-31 02:58:21.304985346 -0400
48@@ -320,6 +320,7 @@
49 #endif /* DEBUG_TIMING */
50 #if defined(DEBUG) && defined(__linux__)
51 /* Lets let people who upgraded kernels know they may have problems */
52+ /*
53 if (uname (&name) == -1)
54 {
55 report( "RXTX WARNING: cannot get system name\n" );
56@@ -333,6 +334,7 @@
57 report( message );
58 getchar();
59 }
60+ */
61 LEAVE( "RXTXPort:Initialize" );
62 #endif /* DEBUG && __linux__ */
63 }
64Index: rxtx/src/I2CImp.c
65===================================================================
66--- rxtx.orig/src/I2CImp.c 2011-10-31 02:58:18.284985274 -0400
67+++ rxtx/src/I2CImp.c 2011-10-31 02:58:21.304985346 -0400
68@@ -127,6 +127,7 @@
69 #endif /* !__FreeBSD_kernel__ */
70 #if defined(__linux__)
71 /* Lets let people who upgraded kernels know they may have problems */
72+ /*
73 if (uname (&name) == -1)
74 {
75 fprintf(stderr,"RXTX WARNING: cannot get system name\n");
76@@ -137,6 +138,7 @@
77 fprintf(stderr, "\n\n\nRXTX WARNING: This library was compiled to run with OS release %s and you are currently running OS release %s. In some cases this can be a problem. Try recompiling RXTX if you notice strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the include files that came with the kernel source and not an older copy.\n\n\npress enter to continue\n",UTS_RELEASE,name.release);
78 getchar();
79 }
80+ */
81 #endif /* __linux__ */
82 #endif /* WIN32 */
83 }
84Index: rxtx/src/SerialImp.cpp
85===================================================================
86--- rxtx.orig/src/SerialImp.cpp 2011-10-31 02:58:18.284985274 -0400
87+++ rxtx/src/SerialImp.cpp 2011-10-31 02:58:21.304985346 -0400
88@@ -142,6 +142,7 @@
89 #endif /* !__FreeBSD_kernel__ */
90 #ifdef DEBUG
91 /* Lets let people who upgraded kernels know they may have problems */
92+ /*
93 if (uname (&name) == -1)
94 {
95 report("RXTX WARNING: cannot get system name\n");
96@@ -153,6 +154,7 @@
97 name.release);
98 getchar();
99 }
100+ */
101 #endif /* DEBUG */
102 #endif /* __BEOS__ */
103 #endif /* WIN32 */
104Index: rxtx/Makefile.am
105===================================================================
106--- rxtx.orig/Makefile.am 2011-10-31 02:55:54.600981860 -0400
107+++ rxtx/Makefile.am 2011-10-31 02:58:21.304985346 -0400
108@@ -137,7 +137,8 @@
109
110 # create the javadoc files.
111 docs: $(CLASSES)
112- $(JAVADOC) $(javafiles)
113+ mkdir api
114+ cd api && $(JAVADOC) $(javafiles)
115
116 ################ WIN32 CrossCompiling from here down #######################
117
diff --git a/recipes-extended/rxtx/files/port_to_hurd.patch b/recipes-extended/rxtx/files/port_to_hurd.patch
new file mode 100644
index 0000000..80ae705
--- /dev/null
+++ b/recipes-extended/rxtx/files/port_to_hurd.patch
@@ -0,0 +1,16 @@
1Description: Defines __GNU__ to use the FHS
2Author: Scott Howard <showard@debian.org>
3
4Index: rxtx/src/SerialImp.h
5===================================================================
6--- rxtx.orig/src/SerialImp.h 2011-02-23 23:26:14.955993397 -0500
7+++ rxtx/src/SerialImp.h 2011-02-23 23:26:52.684023837 -0500
8@@ -147,7 +147,7 @@
9 };
10
11 /* Ports known on the OS */
12-#if defined(__linux__) || defined(__FreeBSD_kernel__)
13+#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
14 /*
15 This is a small hack to get mark and space parity working on older systems
16 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533
diff --git a/recipes-extended/rxtx/files/sys_io_h_check.patch b/recipes-extended/rxtx/files/sys_io_h_check.patch
new file mode 100644
index 0000000..5072f1d
--- /dev/null
+++ b/recipes-extended/rxtx/files/sys_io_h_check.patch
@@ -0,0 +1,35 @@
1Description: sys/io.h does not exist on all systems
2Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=609152
3Author: Scott Howard <showard@debian.org>
4
5Index: rxtx/configure.in
6===================================================================
7--- rxtx.orig/configure.in 2011-02-23 23:01:09.596613286 -0500
8+++ rxtx/configure.in 2011-02-23 23:02:41.269525630 -0500
9@@ -71,6 +71,7 @@
10 AC_CHECK_HEADERS(sys/time.h)
11 AC_CHECK_HEADERS(sys/signal.h)
12 AC_CHECK_HEADERS(signal.h)
13+AC_CHECK_HEADERS(sys/io.h)
14 AC_CHECK_HEADERS(termios.h)
15 AC_CHECK_HEADERS(grp.h)
16 AC_CHECK_HEADERS(pwd.h)
17Index: rxtx/src/RawImp.c
18===================================================================
19--- rxtx.orig/src/RawImp.c 2011-02-23 23:04:29.641932242 -0500
20+++ rxtx/src/RawImp.c 2011-02-23 23:05:40.487353587 -0500
21@@ -99,11 +99,9 @@
22 # include <linux/serial.h>
23 # include <linux/version.h>
24 #endif
25-#ifndef __APPLE__ /* dima */
26-#ifndef PPC
27-#include <sys/io.h>
28-#endif /* PPC */
29-#endif /* dima */
30+#ifdef HAVE_SYS_IO_H
31+# include <sys/io.h>
32+#endif
33
34 extern int errno;
35 #include "I2CImp.h"
diff --git a/recipes-extended/rxtx/files/ttyACM_port.patch b/recipes-extended/rxtx/files/ttyACM_port.patch
new file mode 100644
index 0000000..da133c9
--- /dev/null
+++ b/recipes-extended/rxtx/files/ttyACM_port.patch
@@ -0,0 +1,28 @@
1Description: Allows for the enumeration of many additional ports, including ttyACM for Arduino Unos
2Author: Scott Howard <showard314@gmail.com>
3
4Index: rxtx/src/gnu/io/RXTXCommDriver.java
5===================================================================
6--- rxtx.orig/src/gnu/io/RXTXCommDriver.java 2010-10-04 23:14:47.236148507 -0400
7+++ rxtx/src/gnu/io/RXTXCommDriver.java 2010-10-04 23:18:56.976108303 -0400
8@@ -574,20 +574,7 @@
9 if(osName.equals("Linux"))
10 {
11 String[] Temp = {
12- "ttyS", // linux Serial Ports
13 "ttySA", // for the IPAQs
14- "ttyUSB", // for USB frobs
15- "rfcomm", // bluetooth serial device
16- "ttyircomm", // linux IrCommdevices (IrDA serial emu)
17- };
18- CandidatePortPrefixes=Temp;
19- }
20- else if(osName.equals("Linux-all-ports"))
21- {
22- /* if you want to enumerate all ports ~5000
23- possible, then replace the above with this
24- */
25- String[] Temp = {
26 "comx", // linux COMMX synchronous serial card
27 "holter", // custom card for heart monitoring
28 "modem", // linux symbolic link to modem.
diff --git a/recipes-extended/rxtx/files/uninstall_target.patch b/recipes-extended/rxtx/files/uninstall_target.patch
new file mode 100644
index 0000000..a0e8c55
--- /dev/null
+++ b/recipes-extended/rxtx/files/uninstall_target.patch
@@ -0,0 +1,18 @@
1Description: adds uninstall target to Makefile
2Author: Scott Howard <showard@debian.org>
3Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=646069
4Index: rxtx/Makefile.am
5===================================================================
6--- rxtx.orig/Makefile.am 2011-10-31 02:43:21.532963961 -0400
7+++ rxtx/Makefile.am 2011-10-31 02:46:03.348967808 -0400
8@@ -129,6 +129,10 @@
9 done` $(RXTX_PATH)
10 $(INSTALL_PROGRAM) $(JARTARGET) $(JHOME)/
11
12+uninstall:
13+ cd $(RXTX_PATH) && $(RM) librxtx*
14+ $(RM) $(JHOME)/$(JARTARGET)
15+
16 clean-generic:
17 rm -rf $(DEST) $(TOP)/$(CLASSTOP)
18 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
diff --git a/recipes-extended/rxtx/files/zsystem_init_exception.patch b/recipes-extended/rxtx/files/zsystem_init_exception.patch
new file mode 100644
index 0000000..6421574
--- /dev/null
+++ b/recipes-extended/rxtx/files/zsystem_init_exception.patch
@@ -0,0 +1,19 @@
1Description: print exception if initialization fails
2Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=472053
3Author: Jan Niehusmann <jan@gondor.com>
4
5Index: rxtx/src/gnu/io/RXTXPort.java
6===================================================================
7--- rxtx.orig/src/gnu/io/RXTXPort.java 2011-02-03 20:48:21.824924891 -0500
8+++ rxtx/src/gnu/io/RXTXPort.java 2011-02-03 20:50:04.058464228 -0500
9@@ -86,7 +86,9 @@
10 {
11 try {
12 z = new Zystem();
13- } catch ( Exception e ) {}
14+ } catch ( Exception e ) {
15+ throw new Error(e.toString());
16+ }
17
18 if(debug )
19 z.reportln( "RXTXPort {}");
diff --git a/recipes-extended/rxtx/rxtx_2.2.0.bb b/recipes-extended/rxtx/rxtx_2.2.0.bb
new file mode 100644
index 0000000..28603e3
--- /dev/null
+++ b/recipes-extended/rxtx/rxtx_2.2.0.bb
@@ -0,0 +1,48 @@
1DESCRIPTION = "Full Java CommAPI implementation"
2DEPENDS = "fastjar-native"
3LICENSE = "RXTXv2.1"
4LIC_FILES_CHKSUM = "file://COPYING;md5=32303a23463f90b12a7d1dafb8deabf4"
5PR = "r2"
6
7SRC_URI = "http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2.zip \
8 file://zsystem_init_exception.patch \
9 file://kfreebsd_port.patch \
10 file://ttyACM_port.patch \
11 file://original_debian_changes.patch \
12 file://kfreebsd_libpthread.patch \
13 file://sys_io_h_check.patch \
14 file://port_to_hurd.patch \
15 file://multiple_property_dirs.patch \
16 file://uninstall_target.patch"
17
18SRC_URI[md5sum] = "7eedb18e3f33a427e2b0e9be8ce3f94c"
19SRC_URI[sha256sum] = "3c30373e760f444def3650c76c5a00ae12fb1d860ec008750d084f4880495b03"
20
21S = "${WORKDIR}/rxtx-2.2pre2"
22
23INSANE_SKIP_${PN} += "dev-so"
24
25inherit autotools java-library
26
27JARFILENAME = "RXTXcomm.jar"
28EXTRA_OEMAKE += "RXTX_PATH=${D}${libdir_jni} \
29 JHOME=${D}${datadir_java}/ext"
30
31do_configure_prepend() {
32 # Ugly but don't complain to me, but upstream ;-)
33 sed -e 's,bin/javah,bin/gjavah,g' \
34 -e 's,bin/jar,bin/fastjar,g' \
35 -e 's,\$(TOP)/libtool,\$(TOP)/\${host_alias}-libtool,g' -i ${S}/configure.in
36 rm -f ${S}/acinclude.m4 \
37 ${S}/aclocal.m4 \
38 ${S}/ltconfig \
39 ${S}/ltmain.sh
40}
41
42do_install_prepend() {
43 install -d ${D}${libdir_jni}
44 install -d ${D}${datadir_java}/ext
45}
46
47FILES_${PN} += "${libdir_jni}"
48FILES_${PN}-dbg += "${libdir_jni}/.debug"