diff -Ncwr processing.orig/app/src/processing/app/openbsd/Platform.java processing/app/src/processing/app/openbsd/Platform.java *** processing.orig/app/src/processing/app/openbsd/Platform.java Thu Jan 1 09:00:00 1970 --- processing/app/src/processing/app/openbsd/Platform.java Wed Nov 12 20:46:47 2008 *************** *** 0 **** --- 1,104 ---- + /* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ + + /* + Part of the Processing project - http://processing.org + + Copyright (c) 2008 Ben Fry and Casey Reas + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + package processing.app.openbsd; + + import java.io.File; + + import javax.swing.UIManager; + + import processing.app.Preferences; + + + /** + * Used by Base for platform-specific tweaking, for instance finding the + * sketchbook location using the Windows registry, or OS X event handling. + */ + public class Platform extends processing.app.Platform { + + // TODO Need to be smarter here since KDE people ain't gonna like that GTK. + // It may even throw a weird exception at 'em for their trouble. + public void setLookAndFeel() throws Exception { + // Linux is by default even uglier than metal (Motif?). + // Actually, i'm using native menus, so they're even uglier + // and Motif-looking (Lesstif?). Ick. Need to fix this. + //String lfname = UIManager.getCrossPlatformLookAndFeelClassName(); + //UIManager.setLookAndFeel(lfname); + + // For 0120, trying out the gtk+ look and feel as the default. + // This is available in Java 1.4.2 and later, and it can't possibly + // be any worse than Metal. (Ocean might also work, but that's for + // Java 1.5, and we aren't going there yet) + UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); + } + + + public void openURL(String url) throws Exception { + String launcher = Preferences.get("launcher.openbsd"); + if (launcher != null) { + Runtime.getRuntime().exec(new String[] { launcher, url }); + } + } + + + public boolean openFolderAvailable() { + if (Preferences.get("launcher") != null) { + return true; + } + + // Attempt to use gnome-open + try { + Process p = Runtime.getRuntime().exec(new String[] { "gnome-open" }); + /*int result =*/ p.waitFor(); + // Not installed will throw an IOException (JDK 1.4.2, Ubuntu 7.04) + Preferences.set("launcher", "gnome-open"); + return true; + } catch (Exception e) { } + + // Attempt with kde-open + try { + Process p = Runtime.getRuntime().exec(new String[] { "kde-open" }); + /*int result =*/ p.waitFor(); + Preferences.set("launcher", "kde-open"); + return true; + } catch (Exception e) { } + + return false; + } + + + public void openFolder(File file) throws Exception { + if (openFolderAvailable()) { + String lunch = Preferences.get("launcher"); + try { + String[] params = new String[] { lunch, file.getAbsolutePath() }; + //processing.core.PApplet.println(params); + /*Process p =*/ Runtime.getRuntime().exec(params); + /*int result =*/ //p.waitFor(); + } catch (Exception e) { + e.printStackTrace(); + } + } else { + System.out.println("not available"); + } + } + } diff -Ncwr processing.orig/build/openbsd/dist/processing processing/build/openbsd/dist/processing *** processing.orig/build/openbsd/dist/processing Thu Jan 1 09:00:00 1970 --- processing/build/openbsd/dist/processing Wed Nov 12 19:55:31 2008 *************** *** 0 **** --- 1,17 ---- + #!/bin/sh + + APPDIR="$(dirname -- "${0}")" + + for LIB in \ + java/lib/rt.jar \ + java/lib/tools.jar \ + lib/*.jar \ + ; + do + CLASSPATH="${CLASSPATH}:${APPDIR}/${LIB}" + done + export CLASSPATH + + export PATH="${APPDIR}/java/bin:${PATH}" + + java processing.app.Base diff -Ncwr processing.orig/build/openbsd/dist.sh processing/build/openbsd/dist.sh *** processing.orig/build/openbsd/dist.sh Thu Jan 1 09:00:00 1970 --- processing/build/openbsd/dist.sh Thu Nov 13 20:35:58 2008 *************** *** 0 **** --- 1,70 ---- + #!/bin/sh + + REVISION=`head -n 1 ../../todo.txt | awk '{print $1}'` + + ./make.sh + + echo Creating openbsd distribution for revision $REVISION... + + # remove any old boogers + rm -rf processing + rm -rf processing-* + + mkdir processing + cp -r ../shared/lib processing/ + cp -r ../shared/libraries processing/ + cp -r ../shared/tools processing/ + cp ../../app/lib/antlr.jar processing/lib/ + cp ../../app/lib/ecj.jar processing/lib/ + cp ../../app/lib/jna.jar processing/lib/ + cp ../shared/revisions.txt processing/ + + echo Extracting examples... + unzip -q -d processing/ ../shared/examples.zip + + echo Extracting reference... + unzip -q -d processing/ ../shared/reference.zip + + # add the libraries folder with source + cp -r ../../net processing/libraries/ + cp -r ../../opengl processing/libraries/ + cp -r ../../serial processing/libraries/ + cp -r ../../pdf processing/libraries/ + cp -r ../../dxf processing/libraries/ + + # link java (jdk) files + ln -s /usr/local/jdk-1.5.0 processing/java + + # grab pde.jar and export from the working dir + cp work/lib/pde.jar processing/lib/ + cp work/lib/core.jar processing/lib/ + + # get platform-specific goodies from the dist dir + install -m 755 dist/processing processing/processing + + # make sure notes.txt is unix LFs + # the 2> is because the app is a little chatty + dos2unix processing/revisions.txt 2> /dev/null + dos2unix processing/lib/preferences.txt 2> /dev/null + + # remove boogers + find processing -name "*~" -exec rm -f {} ';' + find processing -name ".DS_Store" -exec rm -f {} ';' + find processing -name "._*" -exec rm -f {} ';' + find processing -name "Thumbs.db" -exec rm -f {} ';' + + # clean out the cvs entries + find processing -name "CVS" -exec rm -rf {} ';' 2> /dev/null + find processing -name ".cvsignore" -exec rm -rf {} ';' + find processing -name ".svn" -exec rm -rf {} 2> /dev/null ';' + + # zip it all up for release + echo Creating tarball and finishing... + P5=processing-$REVISION + mv processing $P5 + + tar cfz $P5.tgz $P5 + # nah, keep the new directory around + #rm -rf $P5 + + #echo Done. diff -Ncwr processing.orig/build/openbsd/make.sh processing/build/openbsd/make.sh *** processing.orig/build/openbsd/make.sh Thu Jan 1 09:00:00 1970 --- processing/build/openbsd/make.sh Wed Nov 12 20:54:24 2008 *************** *** 0 **** --- 1,216 ---- + #!/bin/sh + + + ### -- SETUP WORK DIR ------------------------------------------- + + if test -d work + then + BUILD_PREPROC=false + else + echo Setting up directories to build for OpenBSD... + BUILD_PREPROC=true + + mkdir work + cp -r ../shared/lib work/ + cp -r ../shared/libraries work/ + cp -r ../shared/tools work/ + + cp ../../app/lib/antlr.jar work/lib/ + cp ../../app/lib/ecj.jar work/lib/ + cp ../../app/lib/jna.jar work/lib/ + + echo Extracting examples... + unzip -q -d work/ ../shared/examples.zip + + echo Extracting reference... + unzip -q -d work/ ../shared/reference.zip + + cp -r ../../net work/libraries/ + cp -r ../../opengl work/libraries/ + cp -r ../../serial work/libraries/ + cp -r ../../video work/libraries/ + cp -r ../../pdf work/libraries/ + cp -r ../../dxf work/libraries/ + + install -m 755 dist/processing work/processing + + ln -s /usr/local/jdk-1.5.0 `pwd`/work/java + fi + + cd ../.. + + + ### -- BUILD CORE ---------------------------------------------- + + + echo Building processing.core + + cd core + + #CLASSPATH="../build/openbsd/work/java/lib/rt.jar" + #export CLASSPATH + + perl preproc.pl + mkdir -p bin + ../build/openbsd/work/java/bin/java \ + -cp ../build/openbsd/work/java/lib/tools.jar \ + com.sun.tools.javac.Main \ + -d bin -source 1.5 -target 1.5 \ + src/processing/core/*.java src/processing/xml/*.java + #find bin -name "*~" -exec rm -f {} ';' + rm -f ../build/openbsd/work/lib/core.jar + cd bin && zip -rq ../../build/openbsd/work/lib/core.jar \ + processing/core/*.class processing/xml/*.class && cd .. + + # back to base processing dir + cd .. + + + ### -- BUILD PREPROC ------------------------------------------------ + + echo Building PDE for JDK 1.5... + + cd app + + # long path is to avoid requiring java to be in your PATH + echo Building antlr grammar code... + + # first build the default java goop + ../build/openbsd/work/java/bin/java \ + -cp ../build/openbsd/work/lib/antlr.jar antlr.Tool \ + -o src/antlr/java \ + src/antlr/java/java.g + + # hack to get around path mess + cp src/antlr/java/JavaTokenTypes.txt src/processing/app/preproc/ + + # now build the pde stuff that extends the java classes + # this is totally ugly and needs to be fixed + # the problem is that -glib doesn't set the main path properly, + # so it's necessary to cd into the antlr/java folder, otherwise + # the JavaTokenTypes.txt file won't be found + cd src/antlr/java + ../../../../build/openbsd/work/java/bin/java \ + -cp ../../../../build/openbsd/work/lib/antlr.jar antlr.Tool \ + -o ../../processing/app/preproc \ + -glib java.g \ + ../../processing/app/preproc/pde.g + cd ../../.. + + # return to the root of the p5 folder + cd .. + + + ### -- BUILD PDE ------------------------------------------------ + + cd app + + rm -rf ../build/openbsd/work/classes + mkdir ../build/openbsd/work/classes + + ../build/openbsd/work/java/bin/java \ + -cp ../build/openbsd/work/java/lib/tools.jar \ + com.sun.tools.javac.Main \ + -source 1.5 -target 1.5 \ + -classpath ../build/openbsd/work/lib/core.jar:../build/openbsd/work/lib/antlr.jar:../build/openbsd/work/lib/ecj.jar:../build/openbsd/work/lib/jna.jar:../build/openbsd/work/java/lib/tools.jar \ + -d ../build/openbsd/work/classes \ + src/processing/app/*.java \ + src/processing/app/debug/*.java \ + src/processing/app/openbsd/*.java \ + src/processing/app/preproc/*.java \ + src/processing/app/syntax/*.java \ + src/processing/app/tools/*.java \ + src/antlr/*.java \ + src/antlr/java/*.java + + cd ../build/openbsd/work/classes + rm -f ../lib/pde.jar + zip -0rq ../lib/pde.jar . + cd ../../../.. + + + ### -- BUILD LIBRARIES ------------------------------------------------ + + cd build/openbsd + + PLATFORM=openbsd + + JAVAC="../build/openbsd/work/java/bin/java -cp ../build/openbsd/work/java/lib/tools.jar com.sun.tools.javac.Main -source 1.5 -target 1.5" + CORE=../build/$PLATFORM/work/lib/core.jar + LIBRARIES=../build/$PLATFORM/work/libraries + + # move to processing/build + cd .. + + # SERIAL LIBRARY + echo Building serial library... + cd ../serial + mkdir -p bin + $JAVAC \ + -classpath "library/RXTXcomm.jar:$CORE" \ + -d bin src/processing/serial/*.java + rm -f library/serial.jar + find bin -name "*~" -exec rm -f {} ';' + cd bin && zip -rq ../library/serial.jar processing/serial/*.class && cd .. + mkdir -p $LIBRARIES/serial/library/ + cp library/serial.jar $LIBRARIES/serial/library/ + + + # NET LIBRARY + echo Building net library... + cd ../net + mkdir -p bin + $JAVAC \ + -classpath "$CORE" \ + -d bin src/processing/net/*.java + rm -f library/net.jar + find bin -name "*~" -exec rm -f {} ';' + cd bin && zip -rq ../library/net.jar processing/net/*.class && cd .. + mkdir -p $LIBRARIES/net/library/ + cp library/net.jar $LIBRARIES/net/library/ + + + # OPENGL LIBRARY + echo Building OpenGL library... + cd ../opengl + mkdir -p bin + $JAVAC \ + -classpath "library/jogl.jar:$CORE" \ + -d bin src/processing/opengl/*.java + rm -f library/opengl.jar + find bin -name "*~" -exec rm -f {} ';' + cd bin && zip -rq ../library/opengl.jar processing/opengl/*.class && cd .. + mkdir -p $LIBRARIES/opengl/library/ + cp library/opengl.jar $LIBRARIES/opengl/library/ + + + # PDF LIBRARY + echo Building PDF library... + cd ../pdf + mkdir -p bin + $JAVAC \ + -classpath "library/itext.jar:$CORE" \ + -d bin src/processing/pdf/*.java + rm -f library/pdf.jar + find bin -name "*~" -exec rm -f {} ';' + cd bin && zip -rq ../library/pdf.jar processing/pdf/*.class && cd .. + mkdir -p $LIBRARIES/pdf/library/ + cp library/pdf.jar $LIBRARIES/pdf/library/ + + + # DXF LIBRARY + echo Building DXF library... + cd ../dxf + mkdir -p bin + $JAVAC \ + -classpath "$CORE" \ + -d bin src/processing/dxf/*.java + rm -f library/dxf.jar + find bin -name "*~" -exec rm -f {} ';' + cd bin && zip -rq ../library/dxf.jar processing/dxf/*.class && cd .. + mkdir -p $LIBRARIES/dxf/library/ + cp library/dxf.jar $LIBRARIES/dxf/library/ + + + echo + echo Done. diff -Ncwr processing.orig/build/openbsd/run.sh processing/build/openbsd/run.sh *** processing.orig/build/openbsd/run.sh Thu Jan 1 09:00:00 1970 --- processing/build/openbsd/run.sh Wed Nov 12 19:55:32 2008 *************** *** 0 **** --- 1,3 ---- + #!/bin/sh + + cd work && ./processing && cd ..