From 5010de0bee1566c876d4ed6d41d8ec5ae553c42d Mon Sep 17 00:00:00 2001
From: Geert Stappers <stappers@debian.org>
Date: Sun, 21 May 2017 09:13:20 +0200
Subject: [PATCH] Refreshed debian/patches where needed

* install_jar_links.patch
* permission_fix.patch
* remove_copying_binaries.patch
* remove_update_warning.patch
* wrapper_for_deb.patch
---
 debian/patches/install_jar_links.patch       | 15 +++----
 debian/patches/permission_fix.patch          | 15 ++++---
 debian/patches/remove_copying_binaries.patch | 61 ++++++++++++++++++----------
 debian/patches/remove_update_warning.patch   | 22 +++++-----
 debian/patches/wrapper_for_deb.patch         | 17 ++++----
 5 files changed, 74 insertions(+), 56 deletions(-)

diff --git a/debian/patches/install_jar_links.patch b/debian/patches/install_jar_links.patch
index 2d52e3d..25c2abf 100644
--- a/debian/patches/install_jar_links.patch
+++ b/debian/patches/install_jar_links.patch
@@ -1,17 +1,18 @@
 Description: Prevents ant from following symlinks and including library jars
  in debian package
 Author: Scott Howard <showard314@gmail.com>
+Last-Update: 2017-05-21
 
 Index: arduino/build/build.xml
 ===================================================================
---- arduino.orig/build/build.xml	2012-03-11 19:09:34.365223497 -0400
-+++ arduino/build/build.xml	2012-03-11 19:15:03.717231325 -0400
-@@ -21,7 +21,7 @@
- 	     value="linux64"><os family="unix" arch="amd64" /></condition>
- 
+--- arduino.orig/build/build.xml
++++ arduino/build/build.xml
+@@ -92,7 +92,7 @@
+   <property name="arduinoOTA-VERSION" value="1.1.1" />
+
    <!-- Libraries required for running arduino -->
 -  <fileset dir=".." id="runtime.jars">
 +  <fileset dir=".." id="runtime.jars" followsymlinks="no">
-     <include name="core/core.jar" />
+     <include name="arduino-core/arduino-core.jar" />
      <include name="app/pde.jar" />
-     <include name="app/lib/ecj.jar" />
+     <include name="app/lib/*.jar" />
diff --git a/debian/patches/permission_fix.patch b/debian/patches/permission_fix.patch
index d6aa9c1..a094f62 100644
--- a/debian/patches/permission_fix.patch
+++ b/debian/patches/permission_fix.patch
@@ -4,12 +4,11 @@ Description: Uses pkexec to add user to groups dailout and tty
 Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652523
 Index: arduino/build/linux/dist/arduino
 ===================================================================
---- arduino.orig/build/linux/dist/arduino	2011-12-27 12:17:18.675536651 -0500
-+++ arduino/build/linux/dist/arduino	2011-12-27 12:17:29.255536904 -0500
-@@ -1,4 +1,18 @@
--#!/bin/sh
-+#!/bin/bash
-+
+--- arduino.orig/build/linux/dist/arduino
++++ arduino/build/linux/dist/arduino
+@@ -1,5 +1,18 @@
+ #!/usr/bin/env bash
+
 +if [[ `id -u` -ne 0 ]]; then
 +#    for group in dialout tty; do
 +    for group in dialout; do
@@ -23,6 +22,6 @@ Index: arduino/build/linux/dist/arduino
 +    fi
 +fi
 +
-  
  APPDIR=/usr/share/arduino
- 
+
+ for LIB in \
diff --git a/debian/patches/remove_copying_binaries.patch b/debian/patches/remove_copying_binaries.patch
index 2393136..1033231 100644
--- a/debian/patches/remove_copying_binaries.patch
+++ b/debian/patches/remove_copying_binaries.patch
@@ -1,32 +1,49 @@
 Description: Arduino copies precompiled binaries into the build tree,
  stop that
 Author: Scott Howard <showard@debian.org>
+Last-Update: 2017-05-21
+
 Index: arduino/build/build.xml
 ===================================================================
---- arduino.orig/build/build.xml	2012-03-11 19:15:03.000000000 -0400
-+++ arduino/build/build.xml	2012-03-11 19:18:01.245235543 -0400
-@@ -353,24 +353,9 @@
+--- arduino.orig/build/build.xml
++++ arduino/build/build.xml
+@@ -707,39 +707,9 @@
    </target>
- 
-   <target name="linux32-build" depends="linux-build" description="Build linux (32-bit) version">
--    <!-- Unzip AVR tools -->
--    <exec executable="tar" dir="linux/work/hardware">
--      <arg value="-xjf"/>
--      <arg value="../../avr_tools_linux32.tar.bz2"/>
--    </exec>
+
+   <target name="linux32-build" depends="linux-libastyle-x86" description="Build linux (32-bit) version">
+-    <antcall target="linux-jvm-${linux-bundle-jvm-task}">
+-      <param name="JVM" value="${LINUX32_BUNDLED_JVM}"/>
+-    </antcall>
+-
+-    <antcall target="build-arduino-builder" />
+-
+-    <antcall target="avr-toolchain-bundle">
+-      <param name="unpack_target" value="untar"/>
+-      <param name="gcc_archive_file" value="avr-gcc-${AVRGCC-VERSION}-i686-pc-linux-gnu.tar.bz2"/>
+-      <param name="gcc_version" value="${AVRGCC-VERSION}"/>
+-      <param name="avrdude_archive_file" value="avrdude-${AVRDUDE-VERSION}-i686-pc-linux-gnu.tar.bz2"/>
+-      <param name="avrdude_version" value="${AVRDUDE-VERSION}"/>
+-      <param name="arduinoOTA_archive_file" value="arduinoOTA-${arduinoOTA-VERSION}-linux_386.tar.bz2"/>
+-      <param name="arduinoOTA_version" value="${arduinoOTA-VERSION}"/>
+-    </antcall>
    </target>
- 
-   <target name="linux64-build" depends="linux-build" description="Build linux (64-bit) version">
--    <copy tofile="linux/work/hardware/tools/avrdude" file="linux/dist/tools/avrdude64" overwrite="true" />
--    <copy tofile="linux/work/lib/librxtxSerial.so" file="linux/dist/lib/librxtxSerial64.so" overwrite="true" />
+
+   <target name="linux64-build" depends="linux-libastyle-x86" description="Build linux (64-bit) version">
+-    <antcall target="linux-jvm-${linux-bundle-jvm-task}">
+-      <param name="JVM" value="${LINUX64_BUNDLED_JVM}"/>
+-    </antcall>
 -
--    <chmod perm="755" file="linux/work/hardware/tools/avrdude" />
+-    <antcall target="build-arduino-builder" />
 -
--    <!-- Unzip AVR tools -->
--    <exec executable="tar" dir="linux/work/hardware">
--      <arg value="-xjf"/>
--      <arg value="../../avr_tools_linux64.tar.bz2"/>
--    </exec>
+-    <antcall target="avr-toolchain-bundle">
+-      <param name="unpack_target" value="untar"/>
+-      <param name="gcc_archive_file" value="avr-gcc-${AVRGCC-VERSION}-x86_64-pc-linux-gnu.tar.bz2"/>
+-      <param name="gcc_version" value="${AVRGCC-VERSION}"/>
+-      <param name="avrdude_archive_file" value="avrdude-${AVRDUDE-VERSION}-x86_64-pc-linux-gnu.tar.bz2"/>
+-      <param name="avrdude_version" value="${AVRDUDE-VERSION}"/>
+-      <param name="arduinoOTA_archive_file" value="arduinoOTA-${arduinoOTA-VERSION}-linux_amd64.tar.bz2"/>
+-      <param name="arduinoOTA_version" value="${arduinoOTA-VERSION}"/>
+-    </antcall>
    </target>
-   
-   <target name="linux32-run" depends="linux32-build" 
+
+   <target name="linux-jvm-noop"/>
diff --git a/debian/patches/remove_update_warning.patch b/debian/patches/remove_update_warning.patch
index c0ae899..92ffd5b 100644
--- a/debian/patches/remove_update_warning.patch
+++ b/debian/patches/remove_update_warning.patch
@@ -1,33 +1,33 @@
 Description: Remove the notification if a new upstream version is available
 Author: Scott Howard <showard314@gmail.com>
 Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=603818
+Last-Update: 2017-05-21
 
 Index: arduino/app/src/processing/app/UpdateCheck.java
 ===================================================================
---- arduino.orig/app/src/processing/app/UpdateCheck.java	2012-03-11 19:09:34.000000000 -0400
-+++ arduino/app/src/processing/app/UpdateCheck.java	2012-03-11 19:14:55.381231127 -0400
-@@ -98,27 +98,6 @@
-         }
+--- arduino.orig/app/src/processing/app/UpdateCheck.java
++++ arduino/app/src/processing/app/UpdateCheck.java
+@@ -100,26 +100,6 @@ public class UpdateCheck implements Runn
        }
-       Preferences.set("update.last", String.valueOf(now));
--
+       PreferencesData.set("update.last", String.valueOf(now));
+ 
 -      String prompt =
--        _("A new version of Arduino is available,\n" +
+-        tr("A new version of Arduino is available,\n" +
 -          "would you like to visit the Arduino download page?");
 -        
 -      if (base.activeEditor != null) {
--        if (latest > Base.REVISION) {
--          Object[] options = { _("Yes"), _("No") };
+-        if (latest > BaseNoGui.REVISION) {
+-          Object[] options = { tr("Yes"), tr("No") };
 -          int result = JOptionPane.showOptionDialog(base.activeEditor,
 -                                                    prompt,
--                                                    _("Update"),
+-                                                    tr("Update"),
 -                                                    JOptionPane.YES_NO_OPTION,
 -                                                    JOptionPane.QUESTION_MESSAGE,
 -                                                    null,
 -                                                    options,
 -                                                    options[0]);
 -          if (result == JOptionPane.YES_OPTION) {
--            Base.openURL(_("http://www.arduino.cc/en/Main/Software"));
+-            Base.openURL(tr("http://www.arduino.cc/en/Main/Software"));
 -          }
 -        }
 -      }
diff --git a/debian/patches/wrapper_for_deb.patch b/debian/patches/wrapper_for_deb.patch
index 481a125..e36e050 100644
--- a/debian/patches/wrapper_for_deb.patch
+++ b/debian/patches/wrapper_for_deb.patch
@@ -1,23 +1,24 @@
 Description: Tells the wrapper where to look for things in debian.
 Author: Scott Howard <showard314@gmail.com>
+Last-Update: 2017-05-21
 
 Index: arduino/build/linux/dist/arduino
 ===================================================================
---- arduino.orig/build/linux/dist/arduino	2012-11-05 13:55:44.000000000 -0500
-+++ arduino/build/linux/dist/arduino	2012-11-05 14:09:21.032594011 -0500
+--- arduino.orig/build/linux/dist/arduino
++++ arduino/build/linux/dist/arduino
 @@ -1,6 +1,6 @@
- #!/bin/sh
-  
+ #!/usr/bin/env bash
+ 
 -APPDIR="$(dirname -- "$(readlink -f -- "${0}")" )"
 +APPDIR=/usr/share/arduino
  
- cd "$APPDIR"
-  
-@@ -14,7 +14,7 @@
+ for LIB in \
+     "$APPDIR"/java/lib/rt.jar \
+@@ -12,7 +12,7 @@ do
  done
  export CLASSPATH
  
--LD_LIBRARY_PATH=`pwd`/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
+-LD_LIBRARY_PATH=$APPDIR/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
 +LD_LIBRARY_PATH="/usr/lib/jni${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
  export LD_LIBRARY_PATH
  
-- 
2.11.0

