[sikuli] 06/21: New patch no-vnc-package.patch
Gilles Filippini
pini at debian.org
Sat Nov 7 12:11:54 UTC 2015
This is an automated email from the git hooks/post-receive script.
pini pushed a commit to branch master
in repository sikuli.
commit 7fb35c376730fb18366a3afa24515f9be0107372
Author: Gilles Filippini <pini at debian.org>
Date: Mon Nov 2 15:18:37 2015 +0100
New patch no-vnc-package.patch
Drop dependancy against non-free VNC package.
---
debian/changelog | 2 +
debian/patches/no-vnc-package.patch | 155 ++++++++++++++++++++++++++++++++++++
debian/patches/series | 2 +-
3 files changed, 158 insertions(+), 1 deletion(-)
diff --git a/debian/changelog b/debian/changelog
index 02b8e7e..b902ae0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ sikulix (1.1.0-1) UNRELEASED; urgency=medium
* New upstream release.
* Refresh patches.
+ * New patch no-vnc-package.patch to drop dependency against non-free
+ VNC package (removed from upstream source tree).
* Disable patch jruby-compat-1.9.patch (probably not needed anymore).
* Drop patch fix-image-path.patch (applied upstream).
diff --git a/debian/patches/no-vnc-package.patch b/debian/patches/no-vnc-package.patch
new file mode 100644
index 0000000..5f63f96
--- /dev/null
+++ b/debian/patches/no-vnc-package.patch
@@ -0,0 +1,155 @@
+Description: remove non free VNC package
+ The VNC package was removed from upstream source tree because of its
+ non-free license which prevents commercial redistribution:
+ This software may not be resold without the express permission of
+ the InterOperability Lab.
+ This patch remove the code using this VNC package.
+Author: Gilles Filippini <pini at debian.org>
+Index: sikuli/API/src/main/java/org/sikuli/script/Region.java
+===================================================================
+--- sikuli.orig/API/src/main/java/org/sikuli/script/Region.java
++++ sikuli/API/src/main/java/org/sikuli/script/Region.java
+@@ -17,7 +17,6 @@ import java.util.List;
+ import org.sikuli.basics.Debug;
+ import org.sikuli.basics.Settings;
+
+-import edu.unh.iol.dlc.VNCScreen;
+ import java.util.ArrayList;
+ import java.util.Collections;
+ import java.util.Comparator;
+@@ -238,13 +237,7 @@ public class Region {
+ // crop to the screen with the largest intersection
+ screenRect = new Rectangle(0, 0, 0, 0);
+ screenOn = null;
+- boolean isVNC;
+- if (iscr == null) {
+- isVNC = scr instanceof VNCScreen;
+- } else {
+- isVNC = iscr instanceof VNCScreen;
+- }
+- if (!isVNC) {
++ if (true) {
+ for (int i = 0; i < Screen.getNumberScreens(); i++) {
+ screen = Screen.getScreen(i);
+ rect = regionOnScreen(screen);
+@@ -255,17 +248,6 @@ public class Region {
+ }
+ }
+ }
+- } else {
+- for (int i = 0; i < VNCScreen.getNumberScreens(); i++) {
+- screen = VNCScreen.getScreen(i);
+- rect = regionOnScreen(screen);
+- if (rect != null) {
+- if (rect.width * rect.height > screenRect.width * screenRect.height) {
+- screenRect = rect;
+- screenOn = screen;
+- }
+- }
+- }
+ }
+ if (screenOn != null) {
+ x = screenRect.x;
+@@ -2835,9 +2817,7 @@ public class Region {
+ float score = (float) (img.getLastSeenScore() - 0.01);
+ if (this.contains(r)) {
+ Finder f = null;
+- if (this.scr instanceof VNCScreen) {
+- f = new Finder(new VNCScreen().capture(r), r);
+- } else {
++ if (true) {
+ f = new Finder(base.getSub(r.getRect()), r);
+ if (Debug.shouldHighlight()) {
+ if (this.scr.getW() > w + 10 && this.scr.getH() > h + 10)
+Index: sikuli/JRubyGem/lib/sikulix/sikulix.rb
+===================================================================
+--- sikuli.orig/JRubyGem/lib/sikulix/sikulix.rb
++++ sikuli/JRubyGem/lib/sikulix/sikulix.rb
+@@ -9,7 +9,6 @@ module Sikulix
+ # 'private' for avoiding of unexpected effects when
+ # 'include Sikulix' is used.
+ java_import java.net.Socket
+- java_import Java.edu.unh.iol.dlc.ConnectionController
+ java_import org.sikuli.script.Sikulix
+ java_import org.sikuli.script.Screen
+ java_import org.sikuli.script.Region
+@@ -109,64 +108,12 @@ module Sikulix
+ $SIKULI_SCREEN = Screen.new
+ # Screen used for undotted methods.
+ $DEFAULT_SCREEN = $SIKULI_SCREEN
+- # Pool of screens of remote machines connected via VNC.
+- $VNC_SCREEN_POOL = []
+- # ConnectionController instance
+- @connection_controller = false
+-
+- # Initializes connections to remote machines
+- # *args - sequence of address[:port] strings. Default port - 5900
+- # example:
+- # initVNCPool("192.168.2.3:5901", "192.168.4.3")
+- def initVNCPool(*args)
+- if @connection_controller
+- Debug.log(3, 'VNC Pool already initialized, free it first!')
+- return
+- end
+-
+- sockets = args.map do |str|
+- address, port = str.scan(/([^:]+):?(.+)?/)[0]
+- port = port ? port.to_i : 5900
+- s = Socket.new(address, port)
+- s.setSoTimeout(1000)
+- s.setKeepAlive(true)
+- s
+- end
+-
+- @connection_controller = ConnectionController.new(*sockets)
+- sockets.each_index do |id|
+- @connection_controller.openConnection(id)
+- @connection_controller.setPixelFormat(id, 'Truecolor', 32, 0)
+- @connection_controller.start(id)
+- end
+-
+- # sleep left here to wait for buffering
+- # it seems that there is no methods in ConnectionController class
+- # with which we can check if connection is ready
+- # so we will sleep according to ConnectionController author`s example
+-
+- sleep 2
+-
+- # that import isn`t in the top of a module because
+- # there is static section in it which requires
+- # ConnectionController instance to exist
+- java_import Java.edu.unh.iol.dlc.VNCScreen
+-
+- sockets.each_index do |id|
+- $VNC_SCREEN_POOL << VNCScreen.new(id)
+- end
+-
+- Debug.log(3, "Pool of #{$SCREEN_POOL} vnc connections initialized")
+- end
+
+ # Replaces default screen for which all undotted methods are
+ # called with another screen
+ # example:
+ # setDefaultScreen($SIKULI_SCREEN)
+ # click(Location(10,10)) <- click will be performed on local screen
+- #
+- # setDefaultScreen($VNC_SCREEN_POOL[0])
+- # click(Location(10,10)) <- click will be performed on remote screen num 0
+ def setDefaultScreen(screen)
+ if screen.respond_to?(:click)
+ $DEFAULT_SCREEN = screen
+@@ -174,14 +121,6 @@ module Sikulix
+ end
+ end
+
+- # Closes all the connections to remote nodes
+- # You should call that method when all actions are performed
+- # Connections shouldn`t be left opened
+- def freeVNCPool
+- $VNC_SCREEN_POOL.each { @connection_controller.close_connection(0) }
+- @connection_controller = false
+- end
+-
+ # This is an alternative for method generation using define_method
+ # # Generate hash of ('method name'=>method)
+ # # for all possible "undotted" methods.
diff --git a/debian/patches/series b/debian/patches/series
index 6a457d3..335ba5f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -13,4 +13,4 @@ pom-removed-modules.patch
python-shebang.patch
#no-gem-maven-plugin.patch
dependency-opencv.patch
-
+no-vnc-package.patch
--
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