diff --git a/dev-embedded/arduino/arduino-1.7.4.recipe b/dev-embedded/arduino/arduino-1.7.4.recipe new file mode 100644 index 000000000..4cae59ddb --- /dev/null +++ b/dev-embedded/arduino/arduino-1.7.4.recipe @@ -0,0 +1,201 @@ +SUMMARY="Open-source electronic prototyping platform allowing to create interactive electronic objects" +DESCRIPTION="Arduino is an open-source tool used for building electronics projects. +Arduino consists of a physical programmable circuit board (often referred to as a micro-controller) \ +and a development environment, or IDE (Integrated Development Environment) that runs on your computer, \ +used to write and upload computer code to the board." + +HOMEPAGE="http://arduino.org" +LICENSE="GNU GPL v2" +COPYRIGHT="2015 Arduino S.r.l. - Italy" + +SRC_URI="http://download.arduino.org/IDE/1.7.4/arduino-1.7.4.org-linux32.tar.xz" +CHECKSUM_SHA256="80611ec38c3176785717b39a454842b21d5d18664d8ba8051048a91f45f18762" +SRC_URI_2="git+https://github.com/scream3r/java-simple-serial-connector#f5564869f8a70503c29c0d24609245321ba39b2c" +SRC_URI_3="svn+https://github.com/arduino-org/Arduino/trunk/app/src/processing/app" +SRC_URI_4="svn+https://github.com/arduino-org/Arduino/trunk/arduino-core/src/processing" + +REVISION="1" + +ARCHITECTURES="x86 ?x86_64" +if [ $effectiveTargetArchitecture != x86_gcc2 ]; then + ARCHITECTURES="$ARCHITECTURES x86_gcc2" +else + ARCHITECTURES="$ARCHITECTURES !x86_gcc2" +fi +SECONDARY_ARCHITECTURES="x86" + +PATCHES="arduino-1.7.4.patchset" +PATCHES_2="jssc_2.8.0.patchset" +PATCHES_3="JFileChooser-1.7.4.patchset" +PATCHES_4="SettingsFolder-1.7.4.patchset" + +PROVIDES=" + arduino$secondaryArchSuffix = $portVersion + app:Arduino$secondaryArchSuffix = $portVersion + " + +REQUIRES=" + haiku$secondaryArchSuffix + openjdk$secondaryArchSuffix + cmd:avrdude$secondaryArchSuffix + avr_libc$secondaryArchSuffix + avr_gcc$secondaryArchSuffix + avr_binutils$secondaryArchSuffix + " +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + openjdk$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:gcc + cmd:make + cmd:java + cmd:java_config + cmd:javac + cmd:jar + " + +SOURCE_DIR="arduino-1.7.4-linux32" + +DISABLE_SOURCE_PACKAGE=yes + +BUILD() +{ + cd haiku + make + + mkdir -p $sourceDir2/build/jssc + + javac -encoding ISO-8859-1 $sourceDir2/src/java/jssc/*.java + cp $sourceDir2/src/java/jssc/*.class $sourceDir2/build/jssc + + mkdir -p $sourceDir2/build/libs/haiku + cd $sourceDir2/build/libs/haiku + + gcc -shared \ + -I/boot/system/lib/openjdk/include \ + -I/boot/system/lib/x86/openjdk/include \ + -I/boot/system/lib/openjdk/include/haiku \ + -I/boot/system/lib/x86/openjdk/include/haiku \ + $sourceDir2/src/cpp/_nix_based/jssc.cpp \ + -o $sourceDir2/build/libs/haiku/libjSSC-2.8_x86.so + + cp -r $sourceDir2/src/java/libs/* $sourceDir2/build/libs + + cd $sourceDir2/build + jar cf jssc-2.8.0.jar jssc libs + + mkdir -p $sourceDir2/build/processing/app + cp -f $sourceDir2/src/java/jssc/SerialPortList.java $sourceDir2/build/processing/app + sed -i 's|package jssc;|package processing.app;|1' \ + $sourceDir2/build/processing/app/SerialPortList.java + sed -i '/import java.util.regex.Pattern;/a import jssc.SerialNativeInterface;' \ + $sourceDir2/build/processing/app/SerialPortList.java + + javac -encoding ISO-8859-1 -cp ./jssc-2.8.0.jar:$sourceDir/lib/arduino-core.jar \ + $sourceDir2/build/processing/app/SerialPortList.java + rm $sourceDir2/build/processing/app/SerialPortList.java + + cd $sourceDir + javac -encoding ISO-8859-1 -cp java/lib/rt.jar:java/lib/tools.jar:./lib/pde.jar:./lib/arduino-core.jar \ + $sourceDir3/Base.java $sourceDir3/Sketch.java + + mkdir -p $sourceDir3/processing/app + cp -f $sourceDir3/*.class $sourceDir3/processing/app + + javac -encoding ISO-8859-1 \ + -cp java/lib/rt.jar:java/lib/tools.jar:./lib/pde.jar:./lib/arduino-core.jar:./lib/jna.jar \ + $sourceDir4/app/Platform.java + + mkdir -p $sourceDir4/processing/app + cp -f $sourceDir4/app/*.class $sourceDir4/processing/app +} + +INSTALL() +{ + arduinoDir=$appsDir/Arduino + mkdir -p $arduinoDir + + cp -r examples $arduinoDir + cp -r libraries $arduinoDir + cp -r reference $arduinoDir + cp -r lib $arduinoDir + cp -r tools $arduinoDir + + mkdir -p $arduinoDir/hardware/arduino + cp -r hardware/arduino/avr $arduinoDir/hardware/arduino + + #Patch for AVR tools + sed -i "s|^compiler.path=.*|compiler.path=$binDir/|g" \ + $arduinoDir/hardware/arduino/avr/platform.txt + sed -i "s|^tools.avrdude.cmd.path=.*|tools.avrdude.cmd.path=$binDir/avrdude|g" \ + $arduinoDir/hardware/arduino/avr/platform.txt + sed -i "s|^tools.avrdude.config.path=.*|tools.avrdude.config.path=/boot/system/settings/avrdude.conf|g" \ + $arduinoDir/hardware/arduino/avr/platform.txt + #Patch for SAM tools + #sed -i "s|^compiler.path=.*|compiler.path=$binDir/|g" \ + # $arduinoDir/hardware/arduino/sam/platform.txt + #Patch for SAMD tools + #sed -i "s|^compiler.path=.*|compiler.path=$binDir/|g" \ + # $arduinoDir/hardware/arduino/samd/platform.txt + + #Disable check for update + sed -i 's|^update.check.*|update.check = false|g' $arduinoDir/lib/preferences.txt + #Set default serial port + sed -i 's|^serial.port=.*|serial.port=/dev/ports/usb0|g' $arduinoDir/lib/preferences.txt + #Add command for opening + echo "browser = /bin/open" >> $arduinoDir/lib/preferences.txt + echo "launcher = /bin/open" >> $arduinoDir/lib/preferences.txt + + #Add fake libastylej.so library + rm $arduinoDir/lib/libastylej.so + ln -s $libDir/libroot.so $arduinoDir/lib/libastylej.so + + cp -f $sourceDir2/build/jssc-2.8.0.jar $arduinoDir/lib + + #Add patched SerialList class into arduino-core.jar + cd $sourceDir2/build + jar -uf $arduinoDir/lib/arduino-core.jar \ + processing/app/SerialPortList.class \ + processing/app/SerialPortList$1.class + + #Add patch for JFileChooser using + cd $sourceDir3 + jar -uf $arduinoDir/lib/pde.jar \ + processing/app/*.class + + #Add patch for settings directory + cd $sourceDir4 + jar -uf $arduinoDir/lib/arduino-core.jar \ + processing/app/*.class + + cd $sourceDir + + #Generate launcher script + echo '#!/bin/sh +APPDIR="$(dirname -- "$(readlink -f -- "${0}")" )" +cd "$APPDIR" +for LIB in \ + java/lib/rt.jar \ + java/lib/tools.jar \ + lib/*.jar \ + ; +do + CLASSPATH="${CLASSPATH}:${LIB}" +done +export CLASSPATH +LD_LIBRARY_PATH=`pwd`/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} +export LD_LIBRARY_PATH +export PATH="${APPDIR}/java/bin:${PATH}" +java processing.app.Base "$@" +' > $arduinoDir/arduino.sh + + chmod +x $arduinoDir/arduino.sh + + #Copy binary launcher + cp "haiku/Arduino IDE" $arduinoDir + + cp revisions.txt $arduinoDir + + addAppDeskbarSymlink "$arduinoDir/Arduino IDE" +} diff --git a/dev-embedded/arduino/patches/JFileChooser-1.7.4.patchset b/dev-embedded/arduino/patches/JFileChooser-1.7.4.patchset new file mode 100644 index 000000000..bbd8aef19 --- /dev/null +++ b/dev-embedded/arduino/patches/JFileChooser-1.7.4.patchset @@ -0,0 +1,88 @@ +From d9128679f6b93378adbd23d7ce20c57468ab147c Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Thu, 11 Jun 2015 18:25:51 +1000 +Subject: Use JFileChooser instead of FileDialog for open files + + +diff --git a/Base.java b/Base.java +index 76ba797..1e930d7 100644 +--- a/Base.java ++++ b/Base.java +@@ -656,30 +656,21 @@ public class Base { + */ + public void handleOpenPrompt() throws Exception { + // get the frontmost window frame for placing file dialog +- FileDialog fd = new FileDialog(activeEditor, _("Open an Arduino sketch..."), FileDialog.LOAD); +- File lastFolder = new File(Preferences.get("last.folder", getSketchbookFolder().getAbsolutePath())); +- if (lastFolder.exists() && lastFolder.isFile()) { +- lastFolder = lastFolder.getParentFile(); +- } +- fd.setDirectory(lastFolder.getAbsolutePath()); +- +- // Only show .pde files as eligible bachelors +- fd.setFilenameFilter(new FilenameFilter() { +- public boolean accept(File dir, String name) { +- return name.toLowerCase().endsWith(".ino") +- || name.toLowerCase().endsWith(".pde"); +- } +- }); ++ JFileChooser fd = new JFileChooser(Preferences.get("last.folder", Base.getSketchbookFolder().getAbsolutePath())); ++ fd.setDialogTitle(_("Open an Arduino sketch...")); ++ fd.setFileSelectionMode(JFileChooser.FILES_ONLY); ++ fd.setFileFilter(new FileNameExtensionFilter(_("Sketches (*.ino, *.pde)"), "ino", "pde")); + +- fd.setVisible(true); ++ Dimension preferredSize = fd.getPreferredSize(); ++ fd.setPreferredSize(new Dimension(preferredSize.width + 200, preferredSize.height + 200)); + +- String directory = fd.getDirectory(); +- String filename = fd.getFile(); ++ int returnVal = fd.showOpenDialog(activeEditor); + +- // User canceled selection +- if (filename == null) return; ++ if (returnVal != JFileChooser.APPROVE_OPTION) { ++ return; ++ } + +- File inputFile = new File(directory, filename); ++ File inputFile = fd.getSelectedFile(); + + Preferences.set("last.folder", inputFile.getAbsolutePath()); + handleOpen(inputFile); +diff --git a/Sketch.java b/Sketch.java +index ca8d13c..a937988 100644 +--- a/Sketch.java ++++ b/Sketch.java +@@ -790,16 +790,22 @@ public class Sketch { + } + + // get a dialog, select a file to add to the sketch +- FileDialog fd = new FileDialog(editor, _("Select an image or other data file to copy to your sketch"), FileDialog.LOAD); +- fd.setVisible(true); ++ JFileChooser fd = new JFileChooser(Preferences.get("last.folder", Base.getSketchbookFolder().getAbsolutePath())); ++ fd.setDialogTitle(_("Select an image or other data file to copy to your sketch")); ++ fd.setFileSelectionMode(JFileChooser.FILES_ONLY); ++ ++ Dimension preferredSize = fd.getPreferredSize(); ++ fd.setPreferredSize(new Dimension(preferredSize.width + 200, preferredSize.height + 200)); ++ ++ int returnVal = fd.showOpenDialog(editor); + +- String directory = fd.getDirectory(); +- String filename = fd.getFile(); +- if (filename == null) return; ++ if (returnVal != JFileChooser.APPROVE_OPTION) { ++ return; ++ } + + // copy the file into the folder. if people would rather + // it move instead of copy, they can do it by hand +- File sourceFile = new File(directory, filename); ++ File sourceFile = fd.getSelectedFile(); + + // now do the work of adding the file + boolean result = addFile(sourceFile); +-- +2.2.2 + diff --git a/dev-embedded/arduino/patches/SettingsFolder-1.7.4.patchset b/dev-embedded/arduino/patches/SettingsFolder-1.7.4.patchset new file mode 100644 index 000000000..fef7efd00 --- /dev/null +++ b/dev-embedded/arduino/patches/SettingsFolder-1.7.4.patchset @@ -0,0 +1,24 @@ +From c7895860292ccb31e6b7418520e27c5b95fc3a48 Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Thu, 11 Jun 2015 19:54:35 +1000 +Subject: Move preferences to haiku settings folder + + +diff --git a/app/Platform.java b/app/Platform.java +index 3c46c09..9d5e6dc 100644 +--- a/app/Platform.java ++++ b/app/Platform.java +@@ -81,8 +81,8 @@ public class Platform { + + public File getSettingsFolder() throws Exception { + // otherwise make a .processing directory int the user's home dir +- File home = new File(System.getProperty("user.home")); +- File dataFolder = new File(home, ".arduino15"); ++ File settings = new File(System.getProperty("user.home")+"/config/settings/"); ++ File dataFolder = new File(settings, "Arduino15"); + return dataFolder; + + /* +-- +2.2.2 + diff --git a/dev-embedded/arduino/patches/arduino-1.7.4.patchset b/dev-embedded/arduino/patches/arduino-1.7.4.patchset new file mode 100644 index 000000000..6778f74cc --- /dev/null +++ b/dev-embedded/arduino/patches/arduino-1.7.4.patchset @@ -0,0 +1,423 @@ +From e675b2348ba66659539ca8e96e3a0f4ac9362b22 Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Wed, 10 Jun 2015 23:31:37 +1000 +Subject: Add binary launcher + + +diff --git a/haiku/MainApp.cpp b/haiku/MainApp.cpp +new file mode 100644 +index 0000000..4518f05 +--- /dev/null ++++ b/haiku/MainApp.cpp +@@ -0,0 +1,197 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++#include "MainApp.h" ++#define APPSIGNATURE "application/x-vnd.ArduinoIDE" ++#define TARGET "arduino.sh" ++ ++SimpleLauncherApp::SimpleLauncherApp(int argc, char **argv) : BApplication(APPSIGNATURE) ++{ ++// InstallMimeType(APPSIGNATURE, "text/x-processing", "Proecssing source code", "pde"); ++} ++ ++SimpleLauncherApp::~SimpleLauncherApp() ++{ ++ ++} ++ ++ ++BPath ++SimpleLauncherApp::MyPath(const char *dir) ++{ ++ app_info inf; ++ be_app->GetAppInfo(&inf); ++ BPath bpath = BPath(&(inf.ref)); ++ BPath par; ++ bpath.GetParent(&par); ++ par.Append(dir); ++ return(par); ++} ++ ++void ++SimpleLauncherApp::RefsReceived(BMessage *pmsg) ++{ ++ if (pmsg->HasMessenger("TrackerViewToken")) { ++ pmsg->FindMessenger("TrackerViewToken", &fTrackerMessenger); ++ } ++ ++ uint32 type; ++ int32 count; ++ status_t ret = pmsg->GetInfo("refs", &type, &count); ++ if (ret != B_OK || type != B_REF_TYPE) ++ return; ++ ++ entry_ref ref; ++ for (int32 i = 0; i < count; i++) { ++ if (pmsg->FindRef("refs", i, &ref) == B_OK) ++ { ++ BPath file=BPath(&ref); ++ char temp[1024]; ++ sprintf(temp,"%s//%s \"%s\" &",MyPath("").Path(), TARGET, file.Path()); ++ system(temp); ++ Quit(); ++ } ++ } ++} ++ ++ ++void ++SimpleLauncherApp::ArgvReceived(int32 argc, char **argv) ++{ ++ BMessage *pmsg = NULL; ++ for (int32 i = 1; i < argc; i++) { ++ entry_ref ref; ++ status_t err = get_ref_for_path(argv[i], &ref); ++ if (err == B_OK) { ++ if (!pmsg) { ++ pmsg = new BMessage; ++ pmsg->what = B_REFS_RECEIVED; ++ } ++ pmsg->AddRef("refs", &ref); ++ } ++ } ++ if (pmsg) { ++ RefsReceived(pmsg); ++ delete pmsg; ++ } ++} ++ ++void ++SimpleLauncherApp::ReadyToRun() ++{ ++ char temp[1024]; ++ sprintf(temp,"%s//%s &",MyPath("").Path(), TARGET); ++ system(temp); ++ Quit(); ++} ++ ++void ++SimpleLauncherApp::InstallMimeType(const char *app, const char *mimetxt, const char *text, const char *ext) ++{ ++ // install mime type of documents ++ BMimeType mime(mimetxt); ++ status_t ret = mime.InitCheck(); ++ if (ret != B_OK) { ++ fprintf(stderr, "Could not init native document mime type (%s): %s.\n", ++ mimetxt, strerror(ret)); ++ return; ++ } ++ ++ ret = mime.Install(); ++ if (ret != B_OK && ret != B_FILE_EXISTS) { ++ fprintf(stderr, "Could not install native document mime type (%s): %s.\n", ++ mimetxt, strerror(ret)); ++ return; ++ } ++ // set preferred app ++ ret = mime.SetPreferredApp(app); ++ if (ret != B_OK) { ++ fprintf(stderr, "Could not set native document preferred app: %s\n", ++ strerror(ret)); ++ } ++ ++ // set descriptions ++ ret = mime.SetShortDescription(text); ++ if (ret != B_OK) { ++ fprintf(stderr, "Could not set short description of mime type: %s\n", ++ strerror(ret)); ++ } ++ ret = mime.SetLongDescription(text); ++ if (ret != B_OK) { ++ fprintf(stderr, "Could not set long description of mime type: %s\n", ++ strerror(ret)); ++ } ++ ++ // set extensions ++ BMessage message; ++ ++ char extn[128]; ++ char *extptr = extn, *ptr; ++ ++ for( ptr = (char*)ext; *ptr!=0; ptr++){ ++ *extptr=*ptr; ++ if(*(ptr+1)==' ' || *(ptr+1)==0) { ++ *(extptr+1)=0; ++ message.AddString("extensions", extn); ++ extptr = extn; ++ if(*(ptr+1)==' ') ++ ptr++; ++ continue; ++ } ++ extptr++; ++ } ++ ret = mime.SetFileExtensions(&message); ++ if (ret != B_OK) { ++ fprintf(stderr, "Could not set extensions of mime type: %s\n", ++ strerror(ret)); ++ } ++ ++/* // set sniffer rule ++ char snifferRule[32]; ++ ret = mime.SetSnifferRule("0.50 (\"MZ\")"); ++ if (ret != B_OK) { ++ BString parseError; ++ BMimeType::CheckSnifferRule(snifferRule, &parseError); ++ fprintf(stderr, "Could not set sniffer rule of mime type: %s\n", ++ parseError.String()); ++ }*/ ++ ++ // set mime icon ++ BResources* resources = be_app->AppResources(); ++ // does not need to be freed (belongs to BApplication base) ++ if (resources != NULL) { ++ size_t size; ++ BString iconame("BEOS:"); ++ iconame.Append(mimetxt); ++ const void* iconData = resources->LoadResource('VICN', iconame.String(), &size); ++ if (iconData != NULL && size > 0) { ++ if (mime.SetIcon(reinterpret_cast(iconData), size) ++ != B_OK) { ++ fprintf(stderr, "Could not set vector icon of mime type.\n"); ++ } ++ } else { ++ fprintf(stderr, "Could not find icon in app resources " ++ "(data: %p, size: %ld).\n", iconData, size); ++ } ++ } else ++ fprintf(stderr, "Could not find app resources.\n"); ++} ++ ++ ++int main(int argc, char **argv) ++{ ++ SimpleLauncherApp application(argc,argv); ++ application.Run(); ++ return 0; ++} ++ ++ +diff --git a/haiku/MainApp.h b/haiku/MainApp.h +new file mode 100644 +index 0000000..1199bec +--- /dev/null ++++ b/haiku/MainApp.h +@@ -0,0 +1,24 @@ ++#ifndef DOSBOXLAUNCHER_H ++#define DOSBOXLAUNCHER_H ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++class SimpleLauncherApp : public BApplication { ++ public: ++ SimpleLauncherApp(int argc, char **argv); ++ ~SimpleLauncherApp(); ++ void RefsReceived(BMessage *pmsg); ++ void ArgvReceived(int32 argc, char **argv); ++ virtual void ReadyToRun(); ++ void InstallMimeType(const char *app, const char *mimetxt, const char *text, const char *ext); ++ BPath MyPath(const char *dir); ++ BMessenger fTrackerMessenger; ++}; ++ ++ ++#endif +diff --git a/haiku/Makefile b/haiku/Makefile +new file mode 100644 +index 0000000..4371da4 +--- /dev/null ++++ b/haiku/Makefile +@@ -0,0 +1,17 @@ ++CFLAGS= ++LIBS=-lroot -lbe ++CC=g++ ++OBJS = MainApp.o ++ ++all: Arduino ++ ++Arduino: $(OBJS) ++ $(CC) -o "Arduino IDE" $^ $(LIBS) ++ rc resource.rdef ++ xres -o "Arduino IDE" resource.rsrc ++ ++.cpp.o: ++ $(CC) $(CFLAGS) -c $^ ++ ++clean: ++ rm -f "Arduino IDE" $(OBJS) +diff --git a/haiku/resource.rdef b/haiku/resource.rdef +new file mode 100644 +index 0000000..b795392 +--- /dev/null ++++ b/haiku/resource.rdef +@@ -0,0 +1,152 @@ ++resource app_flags B_MULTIPLE_LAUNCH; ++resource app_version { ++ major = 1, ++ middle = 7, ++ minor = 4, ++ ++ variety = B_APPV_DEVELOPMENT, ++ internal = 0, ++ ++ short_info = "Arduino IDE", ++ long_info = "Arduino IDE" ++}; ++ ++resource(1, "BEOS:APP_SIG") (#'MIMS') "application/x-vnd.ArduinoIDE"; ++ ++resource(1, "BEOS:FILE_TYPES") message { ++ "types" = "text/x-arduino", ++ "types" = "text/x-source-code" ++}; ++ ++resource(3, "BEOS:text/x-processing") #'VICN' array { ++ $"6E6369660705010200060338D2F73CD163BF82B23B84A94B88504870C901BFDE" ++ $"F4BDFFFFFFFFE7EEFB020106023E49240000000000003CAAAA4940004A30007C" ++ $"7588ADFFCEE5FF040192020006023A55A7BAC22B3F0DA23E958646C2EB4870EB" ++ $"00010101FF5296CB0100969CEE03FDFEFE150606AE0BB40BBF4D33C3AEB75CC1" ++ $"72BDEFC606C13EC804CA27BD82C117B920C51BBB40BF06B8073AB6BC0605AE02" ++ $"B57D3EB9B9C3EFB7BB44BBB751BD75C936CA8DC1B0402F0A093B593D5BBFCDC9" ++ $"3D455BC516C5F060465B435D4544510A045A425E3F5A3D574008022E45373C08" ++ $"02364441390802364B463B08023A4E4A3E08032D422E4430450803373839393A" ++ $"3B0009BEC0B3EABEC0B3EAC1D2B3A5C74DB6B5C4FBB4ACC9B9B8C2CB53BF05CB" ++ $"36BBD9CB7CC1E6C89BC704CA77C4D0C6C0C93BC12CCB11C40CCABABD99CB92B7" ++ $"5CC7A4B9DBCA3BB4F7C537B41EBE4FB3C1C1B2B46DBB2AB89EB648B61BB831BA" ++ $"5FB4EABEC0B3EABC89B418BEC0B3EA0208BB38BB6BBD16BB54B94FBB75B73BBE" ++ $"D5B789BCF0B6D0C0E3BA45C388B840C30BBC6C4BBFB9C10DBE99C2D9C0B347C4" ++ $"33C3A7C257C3C650C3AEC837C044C7E9C228C896BE65C5A7BBBAC772BC61C36E" ++ $"BAC9BFB9BE0CC0E9BC19BEBFBC8B0005BB13BCEABB13BCEABCCDBCB6BEE8BF89" ++ $"BE2CBE21BE33C117BAB5C21CBC89C297B918C1CFB8E9BE61B817BFD3B954BD93" ++ $"BB13BCEABA2ABCFEBB13BCEA0204BA36BF21BB0DBF20BA31BF69BA35BFF8BA34" ++ $"BFB0BB11BFFBBCCABFF8BBEEBFF9BCBFBFB5BCBBBF22BCE4BF5BBBE4BF1E0005" ++ $"C3D3BCEAC3D3BCEAC585BCACC6C6C010C72DBE5DC67CC18EC35AC21CC4CCC288" ++ $"C210C1CDC08ABF90C126C0ADC12ABE49C3D3BCEAC250BD06C3D3BCEA020CC382" ++ $"BE49C3C9BE47C37EBE90C37FBF1FC382BED8C338BF23C2A9BF2148BF1FC2A4BF" ++ $"69C2A9BFF7C2A7BFB048BFFBC37FBFFAC337BFF7C38DC043C390C0DDC369C09D" ++ $"C3D2C0E0C457C0DDC415C0E0C45CC092C459BFFAC456C046C4A1BFF6C530BFF8" ++ $"C4E8BFFAC534BFB0C530BF22C532BF69C4E9BF1EC45ABF1FC4A1BF22C456BED8" ++ $"C458BE49C45ABE91C410BE450009BB38BB6BBB38BB6BBD16BB54BFB9BE0CBEBF" ++ $"BC8BC0E9BC19C5A7BBBAC36EBAC9C772BC61C837C044C896BE65C7E9C228C433" ++ $"C3A750C3AEC257C3C6BFB9C10DC0B347BE99C2D9BA45C388BC6C4BB840C30BB7" ++ $"3BBED5B6D0C0E3B789BCF0BB38BB6BB94FBB75BB38BB6B0005BB13BCEABB13BC" ++ $"EABA2ABCFEB8E9BE61B954BD93B817BFD3BAB5C21CB918C1CFBC89C297BEE8BF" ++ $"89BE33C117BE2CBE21BB13BCEABCCDBCB6BB13BCEA0204C3D3BCEAC585BCACC2" ++ $"50BD06C08ABF90C12ABE49C126C0ADC35AC21CC210C1CDC4CCC288C6C6C010C6" ++ $"7CC18EC72DBE5D020CC382BE49C37EBE90C3C9BE47C458BE49C410BE45C45ABE" ++ $"91C45ABF1FC456BED8C4A1BF22C530BF22C4E9BF1EC532BF69C530BFF8C534BF" ++ $"B0C4E8BFFAC459BFFAC4A1BFF6C456C046C457C0DDC45CC092C415C0E0C390C0" ++ $"DDC3D2C0E0C369C09DC37FBFFAC38DC043C337BFF7C2A9BFF748BFFBC2A7BFB0" ++ $"C2A9BF21C2A4BF6948BF1FC37FBF1FC338BF23C382BED80204BA36BF21BA31BF" ++ $"69BB0DBF20BCBBBF22BBE4BF1EBCE4BF5BBCCABFF8BCBFBFB5BBEEBFF9BA35BF" ++ $"F8BB11BFFBBA34BFB0120A03020203000A0001011001178400040A020101000A" ++ $"0001001001178400040A010100000A040304060738201B16FF01178100040A04" ++ $"02060438201B001601178200040A04010538201B16FF01178100040A00010838" ++ $"2B1116FF01178100040A00010938231916FF01178100040A00010838251E16FF" ++ $"01178100040A00010938283116FF01178100040A05020A0B023ED68500000000" ++ $"00003EE7FBC07E244872CD0A05020C0D023ED6850000000000003EE7FBC07E24" ++ $"4872CD0A05020E0F023ED6850000000000003EE7FBC07E244872CD0A06031011" ++ $"12023ED6850000000000003EE7FBC07E244872CD0A060113023ED68500000000" ++ $"00003EE7FBC07E244872CD0A060114023ED6850000000000003EE7FBC07E2448" ++ $"72CD" ++}; ++ ++resource(4, "BEOS:text/x-arduino") #'VICN' array { ++ $"6E636966070200060338D2F73CD163BF82B23B84A94B88504870C900FFEFA5BD" ++ $"FFFCC0FFFFF8900501020106023E49240000000000003CAAAA4940004A30007C" ++ $"F1B706FFFFFCC0040192020016023A55A6BAC2293F0DA33E958646C2EB47A1D6" ++ $"0001FF9E0301969C03FDFEFE160606AE0BB40BBF4D33C3AEB75CC172BDEFC606" ++ $"C13EC804CA27BD82C117B920C51BBB40BF06B8073AB6BC0605AE02B57D3EB9B9" ++ $"C3EFB7BB44BBB751BD75C936CA8DC1B0402F0A093B593D5BBFCDC93D455BC516" ++ $"C5F060465B435D4544510A045A425E3F5A3D574008022E40BDB53308023142BE" ++ $"34BC0308023444C0E4BB5108023746C0D8BD7508023A48C270BDB508023D4A4C" ++ $"BD820802404CC408BFE50009BEC0B3EABEC0B3EAC1D2B3A4C74DB6B5C4FBB4AB" ++ $"C9B8B8C1CB52BF04CB35BBD9CB7CC1E6C89BC704CA77C4D0C6BFC93AC12BCB11" ++ $"C40BCAB9BD99CB92B75BC7A3B9DBCA3AB4F7C537B41DBE4EB3C0C1B2B46CBB2A" ++ $"B89EB648B61AB830BA5FB4EABEC0B3EABC88B418BEC0B3EA0208BB37BB6ABD16" ++ $"BB53B94EBB75B73BBED5B788BCF0B6CFC0E2BA45C388B840C30ABC6B4BBFB8C1" ++ $"0CBE99C2D8C0B347C433C3A6C257C3C550C3ADC837C043C7E9C227C896BE65C5" ++ $"A6BBB9C771BC60C36EBAC8BFB8BE0CC0E9BC19BEBFBC8B0005BB12BCE9BB12BC" ++ $"E9BCCDBCB6BEE7BF89BE2BBE20BE33C116BAB5C21CBC88C297B918C1CFB8E8BE" ++ $"60B816BFD3B953BD92BB12BCE9BA2ABCFEBB12BCE90204BA36BF21BB0DBF1FBA" ++ $"30BF68BA35BFF7BA34BFB0BB11BFFABCCABFF7BBEDBFF8BCBFBFB4BCBABF22BC" ++ $"E43FBBE4BF1D0005C3D3BCE9C3D3BCE9C585BCABC6C6C00FC72DBE5CC67CC18D" ++ $"C359C21CC4CCC288C20FC1CDC08ABF8FC125C0ACC129BE49C3D3BCE9C250BD05" ++ $"C3D3BCE9020CC382BE49C3C9BE46C37EBE8FC37FBF1EC382BED8C338BF23C2A8" ++ $"BF2148BF1EC2A3BF68C2A8BFF6C2A6BFB048BFFAC37FBFF9C337BFF6C38CC042" ++ $"C38FC0DCC369C09DC3D2C0DFC456C0DCC414C0DFC45BC091C458BFF9C455C045" ++ $"C4A1BFF5C530BFF7C4E8BFF9C534BFB0C530BF22C532BF68C4E9BF1DC459BF1E" ++ $"C4A1BF22C455BED8C457BE49C459BE90C40FBE440009BB37BB6ABB37BB6ABD16" ++ $"BB53BFB8BE0CBEBFBC8BC0E9BC19C5A6BBB9C36EBAC8C771BC60C837C043C896" ++ $"BE65C7E9C227C433C3A650C3ADC257C3C5BFB8C10CC0B347BE99C2D8BA45C388" ++ $"BC6B4BB840C30AB73BBED5B6CFC0E2B788BCF0BB37BB6AB94EBB75BB37BB6A00" ++ $"05BB12BCE9BB12BCE9BA2ABCFEB8E8BE60B953BD92B816BFD3BAB5C21CB918C1" ++ $"CFBC88C297BEE7BF89BE33C116BE2BBE20BB12BCE9BCCDBCB6BB12BCE90204C3" ++ $"D3BCE9C585BCABC250BD05C08ABF8FC129BE49C125C0ACC359C21CC20FC1CDC4" ++ $"CCC288C6C6C00FC67CC18DC72DBE5C020CC382BE49C37EBE8FC3C9BE46C457BE" ++ $"49C40FBE44C459BE90C459BF1EC455BED8C4A1BF22C530BF22C4E9BF1DC532BF" ++ $"68C530BFF7C534BFB0C4E8BFF9C458BFF9C4A1BFF5C455C045C456C0DCC45BC0" ++ $"91C414C0DFC38FC0DCC3D2C0DFC369C09DC37FBFF9C38CC042C337BFF6C2A8BF" ++ $"F648BFFAC2A6BFB0C2A8BF21C2A3BF6848BF1EC37FBF1EC338BF23C382BED802" ++ $"04BA36BF21BA30BF68BB0DBF1FBCBABF22BBE4BF1DBCE43FBCCABFF7BCBFBFB4" ++ $"BBEDBFF8BA35BFF7BB11BFFABA34BFB00E0A03020203000A0101011001178400" ++ $"040A020101000A0101001001178400040A000100000A04040604080A1815FF01" ++ $"178100040A04040604080A18001501178200040A04030907051815FF01178100" ++ $"040A05020B0C023E7F0C0000000000003EA1F9491F1A48D76E0A05020D0E023E" ++ $"7F0C0000000000003EA1F9491F1A48D76E0A05020F10023E7F0C000000000000" ++ $"3EA1F9491F1A48D76E0A0603111213023E7F0C0000000000003EA1F9491F1A48" ++ $"D76E0A060114023E7F0C0000000000003EA1F9491F1A48D76E0A060115023E7F" ++ $"0C0000000000003EA1F9491F1A48D76E" ++}; ++ ++resource vector_icon array { ++ $"6E636966020301969C03FDFEFE0B0009BEC0B3EABEC0B3EAC1D2B3A5C74DB6B5" ++ $"C4FBB4ACC9B9B8C2CB53BF05CB36BBD9CB7CC1E6C89BC704CA77C4D0C6C0C93B" ++ $"C12CCB11C40CCABABD99CB92B75CC7A4B9DBCA3BB4F7C537B41EBE4FB3C1C1B2" ++ $"B46DBB2AB89EB648B61BB831BA5FB4EABEC0B3EABC89B418BEC0B3EA0208BB38" ++ $"BB6BBD16BB54B94FBB75B73BBED5B789BCF0B6D0C0E3BA45C388B840C30BBC6C" ++ $"4BBFB9C10DBE99C2D9C0B347C433C3A7C257C3C650C3AEC837C044C7E9C228C8" ++ $"96BE65C5A7BBBAC772BC61C36EBAC9BFB9BE0CC0E9BC19BEBFBC8B0005BB13BC" ++ $"EABB13BCEABCCDBCB6BEE8BF89BE2CBE21BE33C117BAB5C21CBC89C297B918C1" ++ $"CFB8E9BE61B817BFD3B954BD93BB13BCEABA2ABCFEBB13BCEA0204BA36BF21BB" ++ $"0DBF20BA31BF69BA35BFF8BA34BFB0BB11BFFBBCCABFF8BBEEBFF9BCBFBFB5BC" ++ $"BBBF22BCE4BF5BBBE4BF1E0005C3D3BCEAC3D3BCEAC585BCACC6C6C010C72DBE" ++ $"5DC67CC18EC35AC21CC4CCC288C210C1CDC08ABF90C126C0ADC12ABE49C3D3BC" ++ $"EAC250BD06C3D3BCEA020CC382BE49C3C9BE47C37EBE90C37FBF1FC382BED8C3" ++ $"38BF23C2A9BF2148BF1FC2A4BF69C2A9BFF7C2A7BFB048BFFBC37FBFFAC337BF" ++ $"F7C38DC043C390C0DDC369C09DC3D2C0E0C457C0DDC415C0E0C45CC092C459BF" ++ $"FAC456C046C4A1BFF6C530BFF8C4E8BFFAC534BFB0C530BF22C532BF69C4E9BF" ++ $"1EC45ABF1FC4A1BF22C456BED8C458BE49C45ABE91C410BE450009BB38BB6BBB" ++ $"38BB6BBD16BB54BFB9BE0CBEBFBC8BC0E9BC19C5A7BBBAC36EBAC9C772BC61C8" ++ $"37C044C896BE65C7E9C228C433C3A750C3AEC257C3C6BFB9C10DC0B347BE99C2" ++ $"D9BA45C388BC6C4BB840C30BB73BBED5B6D0C0E3B789BCF0BB38BB6BB94FBB75" ++ $"BB38BB6B0005BB13BCEABB13BCEABA2ABCFEB8E9BE61B954BD93B817BFD3BAB5" ++ $"C21CB918C1CFBC89C297BEE8BF89BE33C117BE2CBE21BB13BCEABCCDBCB6BB13" ++ $"BCEA0204C3D3BCEAC585BCACC250BD06C08ABF90C12ABE49C126C0ADC35AC21C" ++ $"C210C1CDC4CCC288C6C6C010C67CC18EC72DBE5D020CC382BE49C37EBE90C3C9" ++ $"BE47C458BE49C410BE45C45ABE91C45ABF1FC456BED8C4A1BF22C530BF22C4E9" ++ $"BF1EC532BF69C530BFF8C534BFB0C4E8BFFAC459BFFAC4A1BFF6C456C046C457" ++ $"C0DDC45CC092C415C0E0C390C0DDC3D2C0E0C369C09DC37FBFFAC38DC043C337" ++ $"BFF7C2A9BFF748BFFBC2A7BFB0C2A9BF21C2A4BF6948BF1FC37FBF1FC338BF23" ++ $"C382BED80204BA36BF21BA31BF69BB0DBF20BCBBBF22BBE4BF1EBCE4BF5BBCCA" ++ $"BFF8BCBFBFB5BBEEBFF9BA35BFF8BB11BFFBBA34BFB0060A00020001000A0002" ++ $"0203000A00020405000A0103060708000A010109000A01010A00" ++}; ++ +-- +2.2.2 + diff --git a/dev-embedded/arduino/patches/jssc_2.8.0.patchset b/dev-embedded/arduino/patches/jssc_2.8.0.patchset new file mode 100644 index 000000000..057274d7c --- /dev/null +++ b/dev-embedded/arduino/patches/jssc_2.8.0.patchset @@ -0,0 +1,135 @@ +From c1ec0feff48494daf1020c6bd0e4942533a44737 Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Thu, 11 Jun 2015 18:18:38 +1000 +Subject: Add haiku support for jssc + + +diff --git a/src/cpp/_nix_based/jssc.cpp b/src/cpp/_nix_based/jssc.cpp +index 634b620..b642cd1 100644 +--- a/src/cpp/_nix_based/jssc.cpp ++++ b/src/cpp/_nix_based/jssc.cpp +@@ -42,7 +42,10 @@ + #ifdef __APPLE__ + #include //Needed for IOSSIOSPEED in Mac OS X (Non standard baudrate) + #endif +- ++#ifdef __HAIKU__ ++ #define TIOCOUTQ -1 ++ #define TIOCM_RNG 0200 ++#endif + #include + #include "../jssc_SerialNativeInterface.h" + +@@ -692,9 +695,14 @@ const jint INTERRUPT_PARITY = 8192; + + const jint EV_CTS = 8; + const jint EV_DSR = 16; +-const jint EV_RING = 256; ++#ifdef __HAIKU__ ++const jint EV_RLSD = 32; ++const jint EV_RXCHAR = 256; ++#else ++const jint EV_RING 256 + const jint EV_RLSD = 32; + const jint EV_RXCHAR = 1; ++#endif + //const jint EV_RXFLAG = 2; //Not supported + const jint EV_TXEMPTY = 4; + const jint events[] = {INTERRUPT_BREAK, +diff --git a/src/cpp/jssc_SerialNativeInterface.h b/src/cpp/jssc_SerialNativeInterface.h +index 7029b1b..fcd7bb2 100644 +--- a/src/cpp/jssc_SerialNativeInterface.h ++++ b/src/cpp/jssc_SerialNativeInterface.h +@@ -43,6 +43,8 @@ extern "C" { + #define jssc_SerialNativeInterface_OS_SOLARIS 2L + #undef jssc_SerialNativeInterface_OS_MAC_OS_X + #define jssc_SerialNativeInterface_OS_MAC_OS_X 3L ++#undef jssc_SerialNativeInterface_OS_HAIKU ++#define jssc_SerialNativeInterface_OS_HAIKU 4L + #undef jssc_SerialNativeInterface_ERR_PORT_BUSY + #define jssc_SerialNativeInterface_ERR_PORT_BUSY -1LL + #undef jssc_SerialNativeInterface_ERR_PORT_NOT_FOUND +diff --git a/src/java/jssc/SerialNativeInterface.java b/src/java/jssc/SerialNativeInterface.java +index c5264f5..8ded600 100644 +--- a/src/java/jssc/SerialNativeInterface.java ++++ b/src/java/jssc/SerialNativeInterface.java +@@ -43,6 +43,7 @@ public class SerialNativeInterface { + public static final int OS_WINDOWS = 1; + public static final int OS_SOLARIS = 2;//since 0.9.0 + public static final int OS_MAC_OS_X = 3;//since 0.9.0 ++ public static final int OS_HAIKU = 4;//since 0.9.0 + + private static int osType = -1; + +@@ -87,7 +88,12 @@ public class SerialNativeInterface { + String tmpFolder = System.getProperty("java.io.tmpdir"); + + //since 2.3.0 -> +- String libRootFolder = new File(userHome).canWrite() ? userHome : tmpFolder; ++ String libRootFolder; ++ if(osName.equals("Haiku")){ ++ libRootFolder = tmpFolder; ++ } else { ++ libRootFolder = new File(userHome).canWrite() ? userHome : tmpFolder; ++ } + //<- since 2.3.0 + + String javaLibPath = System.getProperty("java.library.path");//since 2.1.0 +@@ -104,6 +110,10 @@ public class SerialNativeInterface { + osName = "solaris"; + osType = OS_SOLARIS; + } ++ else if(osName.equals("Haiku")){ ++ osName = "haiku"; ++ osType = OS_HAIKU; ++ } + else if(osName.equals("Mac OS X") || osName.equals("Darwin")){//os.name "Darwin" since 2.6.0 + osName = "mac_os_x"; + osType = OS_MAC_OS_X; +diff --git a/src/java/jssc/SerialPort.java b/src/java/jssc/SerialPort.java +index e5f43b4..8a1149e 100644 +--- a/src/java/jssc/SerialPort.java ++++ b/src/java/jssc/SerialPort.java +@@ -264,6 +264,7 @@ public class SerialPort { + checkPortOpened("setEventsMask()"); + if(SerialNativeInterface.getOsType() == SerialNativeInterface.OS_LINUX || + SerialNativeInterface.getOsType() == SerialNativeInterface.OS_SOLARIS || ++ SerialNativeInterface.getOsType() == SerialNativeInterface.OS_HAIKU || + SerialNativeInterface.getOsType() == SerialNativeInterface.OS_MAC_OS_X){//since 0.9.0 + linuxMask = mask; + if(mask > 0){ +@@ -298,6 +299,7 @@ public class SerialPort { + checkPortOpened("getEventsMask()"); + if(SerialNativeInterface.getOsType() == SerialNativeInterface.OS_LINUX || + SerialNativeInterface.getOsType() == SerialNativeInterface.OS_SOLARIS || ++ SerialNativeInterface.getOsType() == SerialNativeInterface.OS_HAIKU || + SerialNativeInterface.getOsType() == SerialNativeInterface.OS_MAC_OS_X){//since 0.9.0 + return linuxMask; + } +@@ -1041,6 +1043,7 @@ public class SerialPort { + private EventThread getNewEventThread() { + if(SerialNativeInterface.getOsType() == SerialNativeInterface.OS_LINUX || + SerialNativeInterface.getOsType() == SerialNativeInterface.OS_SOLARIS || ++ SerialNativeInterface.getOsType() == SerialNativeInterface.OS_HAIKU || + SerialNativeInterface.getOsType() == SerialNativeInterface.OS_MAC_OS_X){//since 0.9.0 + return new LinuxEventThread(); + } +diff --git a/src/java/jssc/SerialPortList.java b/src/java/jssc/SerialPortList.java +index 5af9a95..87a7ee4 100644 +--- a/src/java/jssc/SerialPortList.java ++++ b/src/java/jssc/SerialPortList.java +@@ -47,6 +47,11 @@ public class SerialPortList { + PORTNAMES_PATH = "/dev/"; + break; + } ++ case SerialNativeInterface.OS_HAIKU: { ++ PORTNAMES_REGEXP = Pattern.compile("(pc_serial|usb|serial)[0-9]{1,3}"); ++ PORTNAMES_PATH = "/dev/ports"; ++ break; ++ } + case SerialNativeInterface.OS_SOLARIS: { + PORTNAMES_REGEXP = Pattern.compile("[0-9]*|[a-z]*"); + PORTNAMES_PATH = "/dev/term/"; +-- +2.2.2 +