Skip to content

Commit

Permalink
Merge pull request #3522 from gohai/arm-3.0-for-ben2
Browse files Browse the repository at this point in the history
Assortment of patches from my arm-3.0 branch (v2)
  • Loading branch information
benfry committed Jul 31, 2015
2 parents fe091a2 + 9550918 commit 22647c5
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 27 deletions.
9 changes: 9 additions & 0 deletions app/src/processing/app/Library.java
Expand Up @@ -70,6 +70,7 @@ public boolean accept(File dir, String name) {
if (name.equals("linux")) return false;
if (name.equals("linux32")) return false;
if (name.equals("linux64")) return false;
if (name.equals("linux-armv6hf")) return false;
if (name.equals("android")) return false;
}
return true;
Expand Down Expand Up @@ -156,6 +157,14 @@ private Library(File folder, String groupName) {
nativeLibraryFolder = hostLibrary;
}
// System.out.println("3 native lib folder now " + nativeLibraryFolder);

if (hostPlatform.equals("linux") && System.getProperty("os.arch").equals("arm")) {
hostLibrary = new File(libraryFolder, "linux-armv6hf");
if (hostLibrary.exists()) {
nativeLibraryFolder = hostLibrary;
}
}

// save that folder for later use
nativeLibraryPath = nativeLibraryFolder.getAbsolutePath();

Expand Down
73 changes: 48 additions & 25 deletions build/build.xml
Expand Up @@ -24,6 +24,21 @@
<echo message="The tools.jar file is not required to build Processing." />
</target>

<!-- detetect Raspberry Pi and friends -->
<condition property="linux-arm32" value="linux-arm32">
<and>
<equals arg1="${platform}" arg2="linux" />
<equals arg1="${os.arch}" arg2="arm" />
<equals arg1="${sun.arch.data.model}" arg2="32" />
</and>
</condition>

<target name="check-linux-arm32" if="linux-arm32">
<!-- there is currently no JRE available -->
<property name="jre.download.jdk" value="true" />
<property name="jre.downloader" value="linux-arm-vfp-hflt.tar.gz" />
</target>

<!-- Require Java 8 everywhere. -->
<fail message="Unsupported Java version: ${java.version}. To build, make sure that Java 8 (aka Java 1.8) is installed.">
<condition>
Expand All @@ -46,14 +61,15 @@
<property name="jdk.update" value="72" />
<property name="jdk.build" value="14" />
-->
<!-- Switching to 8 because updates for 7 end April 2015 -->
<!-- Switching to 8 because updates for 7 ended April 2015 -->
<property name="jdk.version" value="8" />
<property name="jdk.update" value="51" />
<property name="jdk.build" value="16" />
<property name="jdk.short" value="${jdk.version}u${jdk.update}" />
<property name="jdk.esoteric" value="1.${jdk.version}.0_${jdk.update}" />

<!-- Figure out the JRE download location for Linux and Windows. -->
<!--
<condition property="jre.file"
value="jre-${jdk.short}-${platform}-i586.tar.gz">
<equals arg1="${sun.arch.data.model}" arg2="32" />
Expand All @@ -62,26 +78,7 @@
value="jre-${jdk.short}-${platform}-x64.tar.gz">
<equals arg1="${sun.arch.data.model}" arg2="64" />
</condition>

<!-- for the full name from processing.org/downloads -->
<condition property="jre.download"
value="${jdk.short}-${platform}-i586.tar.gz">
<equals arg1="${sun.arch.data.model}" arg2="32" />
</condition>
<condition property="jre.download"
value="${jdk.short}-${platform}-x64.tar.gz">
<equals arg1="${sun.arch.data.model}" arg2="64" />
</condition>

<!-- for use with the Ant Task -->
<condition property="jre.downloader"
value="${platform}-i586.tar.gz">
<equals arg1="${sun.arch.data.model}" arg2="32" />
</condition>
<condition property="jre.downloader"
value="${platform}-x64.tar.gz">
<equals arg1="${sun.arch.data.model}" arg2="64" />
</condition>
-->

<!-- JDK location for Mac OS X -->
<!--
Expand Down Expand Up @@ -219,10 +216,22 @@

<target name="jre-download" depends="jre-check, downloader-setup"
unless="jre.tgz.downloaded">
<!-- we normally download a JRE, except on arm -->
<property name="jre.download.jdk" value="false" />

<condition property="jre.downloader"
value="${platform}-i586.tar.gz">
<equals arg1="${sun.arch.data.model}" arg2="32" />
</condition>
<condition property="jre.downloader"
value="${platform}-x64.tar.gz">
<equals arg1="${sun.arch.data.model}" arg2="64" />
</condition>

<downloader version="${jdk.version}"
update="${jdk.update}"
build="${jdk.build}"
jdk="false"
jdk="${jre.download.jdk}"
flavor="${jre.downloader}"
path="${jre.tgz.path}" />
</target>
Expand Down Expand Up @@ -719,7 +728,7 @@
<fail message="wrong platform (${os.name})" />
</target>

<target name="linux-build" depends="ignore-tools, revision-check, linux-check-os, jre-download, subprojects-build" description="Build Linux version">
<target name="linux-build" depends="ignore-tools, check-linux-arm32, revision-check, linux-check-os, jre-download, subprojects-build" description="Build Linux version">
<mkdir dir="linux/work" />

<copy todir="linux/work">
Expand Down Expand Up @@ -796,13 +805,27 @@
We only want to move when the folder didn't exist before
<move file="linux/jre1.7.0_40" tofile="linux/work/java" />
-->

<!-- use the jre subfolder when having downloaded a JDK file -->
<condition property="jre.dir" value="jdk${jdk.esoteric}/jre/">
<!-- property might not be set, but it is for arm -->
<equals arg1="${jre.download.jdk}" arg2="true" />
</condition>
<condition property="jre.dir" value="jre${jdk.esoteric}/">
<not>
<equals arg1="${jre.download.jdk}" arg2="true" />
</not>
</condition>

<exec executable="rsync" dir="linux">
<arg value="-a" />
<arg value="--delete" />
<arg value="jre${jdk.esoteric}/" />
<arg value="${jre.dir}" />
<arg value="work/java" />
</exec>
<delete dir="linux/jre${jdk.esoteric}" />

<delete dir="linux/jre${jdk.esoteric}" failonerror="false" />
<delete dir="linux/jdk${jdk.esoteric}" failonerror="false" />

<!-- Remove unused JRE bloat. -->
<delete failonerror="true">
Expand Down
2 changes: 1 addition & 1 deletion build/linux/processing.desktop
Expand Up @@ -6,5 +6,5 @@ Exec=processing %F
Icon=/opt/processing/lib/icons/pde-256.png
Terminal=false
Type=Application
Categories=AudioVideo;Video;Graphics;Developer;
Categories=Development;AudioVideo;Video;Graphics;Developer;
StartupWMClass=Processing
10 changes: 9 additions & 1 deletion core/build.xml
Expand Up @@ -32,20 +32,28 @@
</condition>
<!--<echo message="compiler is ${build.compiler}" />-->

<!-- JavaFX got removed from the Oracle's JDK for arm -->
<condition property="fx.unavailable" value="true">
<equals arg1="${os.arch}" arg2="arm" />
</condition>

<!-- link against apple.jar for the ThinkDifferent class -->
<mkdir dir="bin" />
<javac source="1.7"
target="1.7"
encoding="UTF-8"
includeAntRuntime="false"
debug="true"
srcdir="src" destdir="bin"
destdir="bin"
classpath="apple.jar;
library/jogl-all.jar;
library/gluegen-rt.jar"
nowarn="true">
<!-- kinda gross, but if not using the JDT, this just ignored anyway -->
<compilerclasspath path="${jdt.jar}; ../java/mode/jdtCompilerAdapter.jar" />
<src path="src" />
<include name="processing/**" />
<exclude name="processing/javafx/**" if="fx.unavailable" />
</javac>

<!-- Copy the jnilib to the bin folder so it's included. -->
Expand Down
Binary file not shown.

0 comments on commit 22647c5

Please sign in to comment.