[sikuli] 05/30: Refreshed patches
Gilles Filippini
pini at alioth.debian.org
Mon Nov 4 09:03:00 UTC 2013
This is an automated email from the git hooks/post-receive script.
pini pushed a commit to branch master
in repository sikuli.
commit 2c422db2f00c56fa4f282cf1e2db0b67bdf7c299
Author: Gilles Filippini <pini at debian.org>
Date: Thu Oct 31 14:37:22 2013 +0100
Refreshed patches
install-extension.patch
native.patch
setTextAndMnemonic.patch
tess3.patch
---
debian/patches/install-extension.patch | 43 ++++----
debian/patches/native.patch | 174 +++++++++++--------------------
debian/patches/setTextAndMnemonic.patch | 89 ++++++----------
debian/patches/tess3.patch | 44 +-------
4 files changed, 120 insertions(+), 230 deletions(-)
diff --git a/debian/patches/install-extension.patch b/debian/patches/install-extension.patch
index 6d1b9cb..55523ee 100644
--- a/debian/patches/install-extension.patch
+++ b/debian/patches/install-extension.patch
@@ -1,23 +1,26 @@
Description: Fix extensions installation in user space
+ Patch introduced for release 1.0~x~rc2. Forgot what the rationals are.
Author: Gilles Filippini <pini at debian.org>
-Index: sikuli/sikuli-script/src/main/java/org/sikuli/script/ExtensionManager.java
+Index: sikuli/basics/src/main/java/org/sikuli/basics/ExtensionManager.java
===================================================================
---- sikuli.orig/sikuli-script/src/main/java/org/sikuli/script/ExtensionManager.java 2011-09-22 23:37:18.000000000 +0200
-+++ sikuli/sikuli-script/src/main/java/org/sikuli/script/ExtensionManager.java 2011-09-26 11:52:00.000000000 +0200
-@@ -132,13 +132,14 @@
- File targetFile = new File(extPath, extName);
- if(targetFile.exists())
- targetFile.delete();
-- if( !localFile.renameTo(targetFile) ){
-+ Runtime.getRuntime().exec("mv " + localFile.getAbsolutePath() + " " + targetFile.getAbsolutePath()).waitFor();
-+ if( !targetFile.exists() ){
- Debug.error("Failed to install " + localFile.getName() + " to " + targetFile.getAbsolutePath());
- return false;
- }
- addExtension(name, url_, version_);
- }
-- catch(IOException e){
-+ catch(Exception e){
- Debug.error("Failed to download " + url_);
- e.printStackTrace();
- return false;
+--- sikuli.orig/basics/src/main/java/org/sikuli/basics/ExtensionManager.java 2013-10-19 16:33:08.000000000 +0200
++++ sikuli/basics/src/main/java/org/sikuli/basics/ExtensionManager.java 2013-10-19 16:55:19.000000000 +0200
+@@ -60,12 +60,16 @@
+ if (targetFile.exists()) {
+ targetFile.delete();
+ }
+- if (!localFile.renameTo(targetFile)) {
++ Runtime.getRuntime().exec("mv " + localFile.getAbsolutePath() + " " + targetFile.getAbsolutePath()).waitFor();
++ if( !targetFile.exists() ){
+ Debug.error("ExtensionManager: Failed to install " + localFile.getName() + " to " + targetFile.getAbsolutePath());
+ return false;
+ }
+ addExtension(name, localFile.getAbsolutePath(), version);
+- } catch (IOException e) {
++ // Java 7
++ // catch (IOException | InterruptException e) {
++ // Java 6
++ } catch (Exception e) {
+ Debug.error("ExtensionManager: Failed to download " + url);
+ return false;
+ }
diff --git a/debian/patches/native.patch b/debian/patches/native.patch
index 4c6effa..5a68f7b 100644
--- a/debian/patches/native.patch
+++ b/debian/patches/native.patch
@@ -1,130 +1,72 @@
Description: Use System's native library loader
- Sikuli upstream binary archives come with the native library loader
- mx-native-loader from http://opensource.mxtelecom.com/ which permits
- to embed native libraries into the jar archive.
- This is not compatible with the Debian policy for java. Hence native
+ Sikuli upstream binary archives come with a custom native library loader
+ which is not compatible with the Debian policy for java. Hence native
libraries are shipped in their own binary package and we use the standard
native library loader.
Author: Gilles Filippini <pini at debian.org>
-Index: sikuli/sikuli-script/src/main/java/org/sikuli/script/VDictProxy.java
+Index: sikuli/api/src/main/java/org/sikuli/script/Finder.java
===================================================================
---- sikuli.orig/sikuli-script/src/main/java/org/sikuli/script/VDictProxy.java 2012-02-13 23:18:12.000000000 +0100
-+++ sikuli/sikuli-script/src/main/java/org/sikuli/script/VDictProxy.java 2012-02-13 23:18:28.000000000 +0100
-@@ -12,7 +12,6 @@
- import java.util.HashMap;
- import java.util.Map;
- import java.util.List;
--import com.wapmx.nativeutils.jniloader.NativeLoader;
-
- public class VDictProxy<T> {
- private long _instance;
-@@ -22,10 +21,10 @@
- // load libScreenMatchProxy.{so,jnilib}
- //System.loadLibrary("ScreenMatchProxy");
- try{
-- NativeLoader.loadLibrary("VDictProxy");
-+ System.loadLibrary("VDictProxy");
- Debug.info("VDictProxy loaded.");
- }
-- catch(IOException e){
-+ catch(Exception e){
- e.printStackTrace();
- }
- }
-Index: sikuli/sikuli-script/src/main/java/org/sikuli/script/Finder.java
+--- sikuli.orig/api/src/main/java/org/sikuli/script/Finder.java 2013-10-22 13:45:45.000000000 +0200
++++ sikuli/api/src/main/java/org/sikuli/script/Finder.java 2013-10-22 13:45:45.000000000 +0200
+@@ -31,7 +31,7 @@
+
+ //TODO Vision.setParameter("GPU", 1);
+ static {
+- FileManager.loadLibrary("VisionProxy");
++ System.loadLibrary("VisionProxy");
+ }
+
+ /**
+Index: sikuli/api/src/main/java/org/sikuli/script/TextRecognizer.java
===================================================================
---- sikuli.orig/sikuli-script/src/main/java/org/sikuli/script/Finder.java 2012-02-13 23:18:12.000000000 +0100
-+++ sikuli/sikuli-script/src/main/java/org/sikuli/script/Finder.java 2012-02-13 23:18:28.000000000 +0100
-@@ -18,8 +18,6 @@
- import org.sikuli.script.natives.TARGET_TYPE;
- import org.sikuli.script.natives.Vision;
-
--import com.wapmx.nativeutils.jniloader.NativeLoader;
--
- public class Finder implements Iterator<Match>{
- private Region _region = null;
- private Pattern _pattern = null;
-@@ -30,10 +28,10 @@
-
- static {
- try{
-- NativeLoader.loadLibrary("VisionProxy");
-+ System.loadLibrary("VisionProxy");
- Debug.info("Sikuli vision engine loaded.");
- }
-- catch(IOException e){
-+ catch(Exception e){
- e.printStackTrace();
- }
- //Vision.setParameter("GPU", 1);
-Index: sikuli/sikuli-script/src/main/java/org/sikuli/script/TextRecognizer.java
+--- sikuli.orig/api/src/main/java/org/sikuli/script/TextRecognizer.java 2013-10-22 13:45:45.000000000 +0200
++++ sikuli/api/src/main/java/org/sikuli/script/TextRecognizer.java 2013-10-22 13:45:45.000000000 +0200
+@@ -25,7 +25,7 @@
+ protected static TextRecognizer _instance = null;
+
+ static {
+- FileManager.loadLibrary("VisionProxy");
++ System.loadLibrary("VisionProxy");
+ }
+
+ protected TextRecognizer() {
+Index: sikuli/basics/src/main/java/org/sikuli/basics/LinuxHotkeyManager.java
===================================================================
---- sikuli.orig/sikuli-script/src/main/java/org/sikuli/script/TextRecognizer.java 2012-02-13 23:18:12.000000000 +0100
-+++ sikuli/sikuli-script/src/main/java/org/sikuli/script/TextRecognizer.java 2012-02-13 23:18:28.000000000 +0100
-@@ -17,18 +17,16 @@
- import org.sikuli.script.natives.OCRWord;
- import org.sikuli.script.natives.OCRWords;
-
--import com.wapmx.nativeutils.jniloader.NativeLoader;
--
- // Singleton
- public class TextRecognizer {
- protected static TextRecognizer _instance = null;
-
- static {
- try{
-- NativeLoader.loadLibrary("VisionProxy");
-+ System.loadLibrary("VisionProxy");
- TextRecognizer tr = TextRecognizer.getInstance();
- }
-- catch(IOException e){
-+ catch(Exception e){
- e.printStackTrace();
- }
- }
-Index: sikuli/sikuli-script/src/main/java/org/sikuli/script/internal/hotkey/LinuxHotkeyManager.java
-===================================================================
---- sikuli.orig/sikuli-script/src/main/java/org/sikuli/script/internal/hotkey/LinuxHotkeyManager.java 2012-02-13 23:18:12.000000000 +0100
-+++ sikuli/sikuli-script/src/main/java/org/sikuli/script/internal/hotkey/LinuxHotkeyManager.java 2012-02-13 23:18:28.000000000 +0100
-@@ -15,16 +15,15 @@
- import org.sikuli.script.HotkeyListener;
- import org.sikuli.script.HotkeyEvent;
-
--import com.wapmx.nativeutils.jniloader.NativeLoader;
- import jxgrabkey.HotkeyConflictException;
- import jxgrabkey.JXGrabKey;
+--- sikuli.orig/basics/src/main/java/org/sikuli/basics/LinuxHotkeyManager.java 2013-10-22 13:45:45.000000000 +0200
++++ sikuli/basics/src/main/java/org/sikuli/basics/LinuxHotkeyManager.java 2013-10-22 13:45:45.000000000 +0200
+@@ -17,7 +17,7 @@
public class LinuxHotkeyManager extends HotkeyManager {
static{
- try{
-- NativeLoader.loadLibrary("JXGrabKey");
+- FileManager.loadLibrary("JXGrabKey");
+ System.loadLibrary("JXGrabKey");
- }
-- catch(IOException e){
-+ catch(Exception e){
- Debug.error("Can't load native lib JXGrabKey");
- e.printStackTrace();
- }
-Index: sikuli/sikuli-script/src/main/native/vision.i
-===================================================================
---- sikuli.orig/sikuli-script/src/main/native/vision.i 2012-02-13 23:18:12.000000000 +0100
-+++ sikuli/sikuli-script/src/main/native/vision.i 2012-02-13 23:18:28.000000000 +0100
-@@ -13,14 +13,14 @@
- %include "typemaps.i"
- %include "various.i"
+ }
--%pragma(java) jniclassimports=%{
-- import com.wapmx.nativeutils.jniloader.NativeLoader;
--%}
-+//%pragma(java) jniclassimports=%{
-+// import com.wapmx.nativeutils.jniloader.NativeLoader;
-+//%}
+ class HotkeyData {
+Index: sikuli/basics/src/main/java/org/sikuli/basics/VDictProxy.java
+===================================================================
+--- sikuli.orig/basics/src/main/java/org/sikuli/basics/VDictProxy.java 2013-10-22 13:45:45.000000000 +0200
++++ sikuli/basics/src/main/java/org/sikuli/basics/VDictProxy.java 2013-10-22 13:45:45.000000000 +0200
+@@ -18,7 +18,7 @@
+ private Map<Integer, T> _i2obj = new HashMap<Integer, T>();
- %pragma(java) jniclasscode=%{
static {
- try {
-- NativeLoader.loadLibrary("VisionProxy");
-+ System.loadLibrary("VisionProxy");
- } catch (Exception e) {
- System.err.println("Failed to load VisionProxy.\n" + e);
- }
+- FileManager.loadLibrary("VDictProxy");
++ System.loadLibrary("VDictProxy");
+ }
+
+ public VDictProxy(){
+Index: sikuli/basics/src/main/java/org/sikuli/basics/ResourceLoader.java
+===================================================================
+--- sikuli.orig/basics/src/main/java/org/sikuli/basics/ResourceLoader.java 2013-10-22 13:45:45.000000000 +0200
++++ sikuli/basics/src/main/java/org/sikuli/basics/ResourceLoader.java 2013-10-22 13:47:07.000000000 +0200
+@@ -133,6 +133,9 @@
+ @Override
+ public void check(String what) {
+ mem = "check";
++ if (what.equals(Settings.SIKULI_LIB)) {
++ return;
++ }
+ if (!what.equals(Settings.SIKULI_LIB)) {
+ log(-1, "Currently only Sikuli libs supported!");
+ return;
diff --git a/debian/patches/setTextAndMnemonic.patch b/debian/patches/setTextAndMnemonic.patch
index a59f56c..85a9d07 100644
--- a/debian/patches/setTextAndMnemonic.patch
+++ b/debian/patches/setTextAndMnemonic.patch
@@ -2,63 +2,42 @@ Description: Fix deprecated DefaultComponentFactory#setTextAndMnemonic
Replace the deprecated method with MnemonicUtils#configure.
Author: Gilles Filippini <pini at debian.org>
Bug-Debian: http://bugs.debian.org/711310
-Index: sikuli/sikuli-ide/src/main/java/org/sikuli/ide/PreferencesWin.java
+Index: sikuli/ide/src/main/java/org/sikuli/ide/PreferencesWin.java
===================================================================
---- sikuli.orig/sikuli-ide/src/main/java/org/sikuli/ide/PreferencesWin.java 2013-06-07 08:02:38.000000000 +0200
-+++ sikuli/sikuli-ide/src/main/java/org/sikuli/ide/PreferencesWin.java 2013-06-07 08:02:38.000000000 +0200
-@@ -33,6 +33,7 @@
- import javax.swing.event.ChangeEvent;
- import javax.swing.event.ChangeListener;
+--- sikuli.orig/ide/src/main/java/org/sikuli/ide/PreferencesWin.java 2013-10-19 15:26:22.000000000 +0200
++++ sikuli/ide/src/main/java/org/sikuli/ide/PreferencesWin.java 2013-10-19 15:26:22.000000000 +0200
+@@ -8,6 +8,7 @@
+
+ import org.sikuli.basics.PreferencesUser;
import com.jgoodies.forms.factories.DefaultComponentFactory;
+import com.jgoodies.common.swing.MnemonicUtils;
- import org.jdesktop.layout.*;
-
- import org.sikuli.script.Debug;
-@@ -496,8 +497,8 @@
-
- private void initComponentsI18n() {
- // JFormDesigner - Component i18n initialization - DO NOT MODIFY //GEN-BEGIN:initI18n
-- DefaultComponentFactory.setTextAndMnemonic(_titleAppearance, I18N._I("PreferencesWin.titleAppearance.textWithMnemonic"));
-- DefaultComponentFactory.setTextAndMnemonic(_titleIndentation, I18N._I("PreferencesWin.titleIndentation.textWithMnemonic"));
-+ MnemonicUtils.configure(_titleAppearance, I18N._I("PreferencesWin.titleAppearance.textWithMnemonic"));
-+ MnemonicUtils.configure(_titleIndentation, I18N._I("PreferencesWin.titleIndentation.textWithMnemonic"));
- _lblHotkey.setText(I18N._I("prefCaptureHotkey"));
- _lblDelay.setText(I18N._I("prefCaptureDelay"));
- _lblDelaySecs.setText(I18N._I("prefSeconds"));
-Index: sikuli/sikuli-ide/CMakeLists.txt
-===================================================================
---- sikuli.orig/sikuli-ide/CMakeLists.txt 2013-06-07 08:02:38.000000000 +0200
-+++ sikuli/sikuli-ide/CMakeLists.txt 2013-06-07 08:02:38.000000000 +0200
-@@ -48,6 +48,7 @@
- SET(SWINGX_JAR "/usr/share/java/swingx-core.jar")
- SET(MAC_WIDGETS_JAR "/usr/share/java/mac_widgets.jar")
- SET(FORMS_JAR "/usr/share/java/forms.jar")
-+SET(COMMON_JAR "/usr/share/java/jgoodies-common.jar")
-
-
- FILE(MAKE_DIRECTORY ${BINARY_DIR})
-@@ -79,7 +80,7 @@
- SET(ARGS "")
-
- SET(CLASSPATH
-- ${SIKULI_SCRIPT_JAR}${SEP}${JUNIT_JAR}${SEP}${SWING_LAYOUT_JAR}${SEP}${COMMONS_CLI_JAR}${SEP}${JSON_SIMPLE_JAR}${SEP}${SWINGX_JAR}${SEP}${MAC_WIDGETS_JAR}${SEP}${FORMS_JAR}${SEP}/usr/share/java/jython.jar
-+ ${SIKULI_SCRIPT_JAR}${SEP}${JUNIT_JAR}${SEP}${SWING_LAYOUT_JAR}${SEP}${COMMONS_CLI_JAR}${SEP}${JSON_SIMPLE_JAR}${SEP}${SWINGX_JAR}${SEP}${MAC_WIDGETS_JAR}${SEP}${FORMS_JAR}${SEP}${COMMON_JAR}${SEP}/usr/share/java/jython.jar
- )
-
- SET(JAR_FILE sikuli-ide.jar)
-@@ -141,6 +142,7 @@
- ${SWING_LAYOUT_JAR} ${COMMONS_CLI_JAR}
- ${BINARY_DIR}/${JAR_FILE} ${JSON_SIMPLE_JAR}
- ${SWINGX_JAR} ${MAC_WIDGETS_JAR} ${FORMS_JAR}
-+ ${COMMON_JAR}
- )
+ import java.awt.*;
+ import java.awt.event.*;
+ import java.util.Arrays;
+@@ -414,8 +415,8 @@
- ## Windows Package
-Index: sikuli/sikuli-ide/target/linux/Sikuli-IDE/sikuli-ide.sh
+ private void initComponentsI18n() {
+ // JFormDesigner - Component i18n initialization - DO NOT MODIFY //GEN-BEGIN:initI18n
+- DefaultComponentFactory.setTextAndMnemonic(_titleAppearance, SikuliIDEI18N._I("PreferencesWin.titleAppearance.textWithMnemonic"));
+- DefaultComponentFactory.setTextAndMnemonic(_titleIndentation, SikuliIDEI18N._I("PreferencesWin.titleIndentation.textWithMnemonic"));
++ MnemonicUtils.configure(_titleAppearance, SikuliIDEI18N._I("PreferencesWin.titleAppearance.textWithMnemonic"));
++ MnemonicUtils.configure(_titleIndentation, SikuliIDEI18N._I("PreferencesWin.titleIndentation.textWithMnemonic"));
+ _lblHotkey.setText(SikuliIDEI18N._I("prefCaptureHotkey"));
+ _lblDelay.setText(SikuliIDEI18N._I("prefCaptureDelay"));
+ _lblDelaySecs.setText(SikuliIDEI18N._I("prefSeconds"));
+Index: sikuli/ide/pom.xml
===================================================================
---- sikuli.orig/sikuli-ide/target/linux/Sikuli-IDE/sikuli-ide.sh 2013-06-07 08:02:38.000000000 +0200
-+++ sikuli/sikuli-ide/target/linux/Sikuli-IDE/sikuli-ide.sh 2013-06-07 08:03:30.000000000 +0200
-@@ -1,2 +1,2 @@
- #!/bin/sh
--LC_NUMERIC=C exec /usr/bin/java -cp "/usr/share/java/jna.jar:/usr/share/java/asm3.jar:/usr/share/java/asm3-commons.jar:/usr/share/java/antlr3-runtime.jar:/usr/share/java/libconstantine-java.jar:/usr/share/java/jython.jar:/usr/share/java/commons-cli.jar:/usr/share/java/JXGrabKey.jar:/usr/share/java/json_simple.jar:/usr/share/java/swing-layout.jar:/usr/share/java/swingx-core.jar:/usr/share/java/forms.jar:/usr/share/java/mac_widgets.jar:/usr/share/java/junit.jar:/usr/share/sikuli/sikuli-id [...]
-+LC_NUMERIC=C exec /usr/bin/java -cp "/usr/share/java/jna.jar:/usr/share/java/asm3.jar:/usr/share/java/asm3-commons.jar:/usr/share/java/antlr3-runtime.jar:/usr/share/java/libconstantine-java.jar:/usr/share/java/jython.jar:/usr/share/java/commons-cli.jar:/usr/share/java/JXGrabKey.jar:/usr/share/java/json_simple.jar:/usr/share/java/swing-layout.jar:/usr/share/java/swingx-core.jar:/usr/share/java/forms.jar:/usr/share/java/jgoodies-common.jar:/usr/share/java/mac_widgets.jar:/usr/share/java/j [...]
+--- sikuli.orig/ide/pom.xml 2013-10-19 15:26:22.000000000 +0200
++++ sikuli/ide/pom.xml 2013-10-19 15:26:22.000000000 +0200
+@@ -124,6 +124,11 @@
+ <version>1.2.1</version>
+ </dependency>
+ <dependency>
++ <groupId>com.jgoodies</groupId>
++ <artifactId>common</artifactId>
++ <version>1.4.0</version>
++ </dependency>
++ <dependency>
+ <groupId>com.explodingpixels</groupId>
+ <artifactId>mac_widgets</artifactId>
+ <version>0.9.5</version>
diff --git a/debian/patches/tess3.patch b/debian/patches/tess3.patch
index 74c3742..1bd27b4 100644
--- a/debian/patches/tess3.patch
+++ b/debian/patches/tess3.patch
@@ -2,42 +2,11 @@ Description: Tesseract 3.02 support
This patch applies against tesseract3 branch of sikuli to bring support
for the 3.02 version of tesseract.
Author: Gilles Filippini <pini at debian.org>
-Index: sikuli/cmake_modules/FindTesseract.cmake
+Index: sikuli/vision-proxy/src/tessocr.cpp
===================================================================
---- sikuli.orig/cmake_modules/FindTesseract.cmake 2012-02-15 01:02:23.000000000 +0100
-+++ sikuli/cmake_modules/FindTesseract.cmake 2012-02-15 10:10:54.000000000 +0100
-@@ -21,23 +21,14 @@
- ${Tesseract_PKGCONF_INCLUDE_DIRS}
- )
-
--SET(TESSERACT_COMPONENTS
-- api cutil textord ccstruct dict training ccutil
-- image viewer classify main wordrec
--)
--
--FOREACH(LIB ${TESSERACT_COMPONENTS})
-- find_library(Tesseract_${LIB}_LIBRARY
-- NAMES libtesseract_${LIB}.a
-- HINTS "${Tesseract_DIR}/lib"
-+find_library(Tesseract_LIBRARY
-+ NAMES tesseract
-+ HINTS "${Tesseract_DIR}/lib"
- "/usr/lib"
- "/usr/local/lib"
- ${Tesseract_PKGCONF_LIBRARY_DIRS}
- )
-
-- set(Tesseract_LIBRARY ${Tesseract_LIBRARY} ${Tesseract_${LIB}_LIBRARY})
--ENDFOREACH(LIB ${TESSERACT_COMPONENTS})
--
-
- # Set the include dir variables and the libraries and let libfind_process do the rest.
- # NOTE: Singular variables for this library, plural for libraries this this lib depends on.
-Index: sikuli/sikuli-script/src/main/native/tessocr.cpp
-===================================================================
---- sikuli.orig/sikuli-script/src/main/native/tessocr.cpp 2012-02-15 01:02:23.000000000 +0100
-+++ sikuli/sikuli-script/src/main/native/tessocr.cpp 2012-02-15 10:10:07.000000000 +0100
-@@ -404,10 +404,9 @@
+--- sikuli.orig/vision-proxy/src/tessocr.cpp 2013-10-19 16:09:02.000000000 +0200
++++ sikuli/vision-proxy/src/tessocr.cpp 2013-10-19 16:09:52.000000000 +0200
+@@ -404,7 +404,7 @@
//we have to use setenv instead.
setenv("TESSDATA_PREFIX", datapath, 1);
#endif
@@ -45,7 +14,4 @@ Index: sikuli/sikuli-script/src/main/native/tessocr.cpp
+ int ret = _tessAPI.Init(datapath, _lang.c_str(), OEM_TESSERACT_ONLY);
//cout << (ret==0?"done":"failed") << endl;
-- _tessAPI.SetAccuracyVSpeed(AVS_MOST_ACCURATE); // FIXME: doesn't work?
- isInitialized = true;
- }
-
+ // _tessAPI.SetAccuracyVSpeed(AVS_MOST_ACCURATE); // FIXME: doesn't work?
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/sikuli.git
More information about the pkg-java-commits
mailing list