--- Makefile (revision 433106) +++ Makefile (working copy) @@ -11,12 +11,15 @@ MAINTAINER= leres@ee.lbl.gov COMMENT= Open-source electronics prototyping platform +LICENSE= GPLv2 LGPL21 +LICENSE_COMB= multi + RUN_DEPENDS= ${JAVA_HOME}/jre/lib/ext/RXTXcomm.jar:comms/rxtx \ ${LOCALBASE}/bin/avrdude:devel/avrdude \ ${LOCALBASE}/avr/include/avr/io.h:devel/avr-libc WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} -USES= dos2unix tar:tgz +USES= dos2unix tar:tgz kmod DOS2UNIX_REGEX= .*\(\.\(c|cpp|h|hex|html|ino|lst|txt\)|Makefile\) USE_JAVA= yes @@ -28,20 +31,27 @@ USE_LDCONFIG= ${PREFIX}/arduino/lib SUB_FILES= arduino pkg-message -SUB_LIST= PORTNAME=${PORTNAME} LINUXBASE=${LINUXBASE} +SUB_LIST= PORTNAME=${PORTNAME} LINUXBASE=${PREFIX} +# Confirmed for ARCHS below. Arm, PowerPC and Sparc untested. (Feedback welcome) +ONLY_FOR_ARCHS= i386 amd64 + REINPLACE_ARGS= -i "" DESKTOP_ENTRIES= "Arduino" "Arduino IDE" \ ${PREFIX}/${PORTNAME}/logo.png \ - "arduino" "Development;IDE;" "false" + "arduino" "Development;IDE;" false -OPTIONS_DEFINE= ATMEGA644P DOCS EXAMPLES +OPTIONS_DEFINE= ATMEGA644P DOCS EXAMPLES UARDUNO ATMEGA644P_DESC= ATmega644p patches DOCS_DESC= Install the reference documents +UARDUNO_DESC= Kernel module for Arduino Uno USB interface INSLIST= arduino hardware lib libraries logo.png revisions.txt tools +# Add serial drivers for those who are new to this. +UARDUNO_RUN_DEPENDS+= ${KMODDIR}/uarduno.ko:comms/uarduno + .include .if ${PORT_OPTIONS:MATMEGA644P} @@ -87,9 +97,26 @@ @${LN} -s ${PREFIX}/bin ${WRKSRC}/hardware/tools/avr/bin @${LN} -s ${PREFIX}/etc ${WRKSRC}/hardware/tools/avr/etc + # Remove broken jar, and Linux C6 based libraries. @${RM} ${WRKSRC}/lib/RXTXcomm.jar + + # This port relys on comms/RXTX working without Linux C6 compatibility. + @${RM} ${WRKSRC}/lib/librxtxSerial.so + @${RM} ${WRKSRC}/lib/librxtxSerial64.so + + # Map the RXTX port for our use @${LN} -s ${JAVA_HOME}/jre/lib/ext/RXTXcomm.jar ${WRKSRC}/lib/RXTXcomm.jar + +# Add in links to the libraries compiled in RXTX for the above jar to use based on architecture. +.if ${ARCH} == i386 + @${LN} -s ${JAVA_HOME}/jre/lib/i386/librxtxSerial.so ${WRKSRC}/lib/librxtxSerial.so +.endif + +.if ${ARCH} == amd64 + @${LN} -s ${JAVA_HOME}/jre/lib/amd64/librxtxSerial.so ${WRKSRC}/lib/librxtxSerial64.so +.endif + @${MV} ${WRKSRC}/reference/img/logo.png ${WRKSRC}/ @${RM} -r ${WRKSRC}/reference/img/ @@ -96,7 +123,6 @@ do-install: ${MKDIR} ${STAGEDIR}${PREFIX}/${PORTNAME} (cd ${WRKSRC}/ && ${COPYTREE_SHARE} "${INSLIST}" ${STAGEDIR}${PREFIX}/${PORTNAME} ${FIND_EXPR}) - ${CHMOD} +x ${STAGEDIR}${PREFIX}/${PORTNAME}/arduino ${INSTALL_SCRIPT} ${WRKDIR}/arduino ${STAGEDIR}${PREFIX}/bin/ .include --- distinfo (revision 433106) +++ distinfo (working copy) @@ -1,2 +1,3 @@ +TIMESTAMP = 1486141688 SHA256 (arduino-1.0.6-linux32.tgz) = f059a572231abafb92099a3a404c0a41502c3413668610676c40029384edc658 SIZE (arduino-1.0.6-linux32.tgz) = 21162427 --- files/arduino.in (revision 433106) +++ files/arduino.in (working copy) @@ -5,4 +5,4 @@ PATH="%%LINUXBASE%%/usr/bin:${PATH}" export PATH -exec %%PREFIX%%/%%PORTNAME%%/arduino %%PREFIX%%/%%PORTNAME%% +exec '%%PREFIX%%/%%PORTNAME%%/arduino' $@ --- files/patch-arduino (nonexistent) +++ files/patch-arduino (working copy) @@ -0,0 +1,13 @@ +--- arduino.orig 2014-09-16 09:45:33.000000000 -0400 ++++ arduino 2017-02-03 12:10:04.614525000 -0500 +@@ -15,8 +15,9 @@ + export CLASSPATH + + LD_LIBRARY_PATH=`pwd`/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} ++ + export LD_LIBRARY_PATH + + export PATH="${APPDIR}/java/bin:${PATH}" + +-java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel processing.app.Base "$@" ++java -Dgnu.io.rxtx.CheckLPT=false -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel processing.app.Base "$@" --- files/patch-hardware-arduino-cores-arduino-HardwareSerial.cpp (revision 433106) +++ files/patch-hardware-arduino-cores-arduino-HardwareSerial.cpp (working copy) @@ -1,6 +1,6 @@ ---- hardware/arduino/cores/arduino/HardwareSerial.cpp.orig 2013-05-17 12:48:38.000000000 -0700 -+++ hardware/arduino/cores/arduino/HardwareSerial.cpp 2013-06-30 12:21:21.000000000 -0700 -@@ -89,7 +89,7 @@ +--- hardware/arduino/cores/arduino/HardwareSerial.cpp.orig 2014-09-16 13:45:33 UTC ++++ hardware/arduino/cores/arduino/HardwareSerial.cpp +@@ -89,7 +89,7 @@ struct ring_buffer inline void store_char(unsigned char c, ring_buffer *buffer) { @@ -9,7 +9,7 @@ // if we should be storing the received character into the location // just before the tail (meaning that the head would advance to the -@@ -124,14 +124,14 @@ +@@ -124,14 +124,14 @@ inline void store_char(unsigned char c, unsigned char c = UDR0; store_char(c, &rx_buffer); } else { @@ -26,7 +26,7 @@ }; #else #error UDR not defined -@@ -150,7 +150,7 @@ +@@ -150,7 +150,7 @@ inline void store_char(unsigned char c, unsigned char c = UDR1; store_char(c, &rx_buffer1); } else { @@ -35,7 +35,7 @@ }; } #endif -@@ -165,7 +165,7 @@ +@@ -165,7 +165,7 @@ inline void store_char(unsigned char c, unsigned char c = UDR2; store_char(c, &rx_buffer2); } else { @@ -44,7 +44,7 @@ }; } #endif -@@ -180,7 +180,7 @@ +@@ -180,7 +180,7 @@ inline void store_char(unsigned char c, unsigned char c = UDR3; store_char(c, &rx_buffer3); } else { @@ -53,7 +53,7 @@ }; } #endif -@@ -365,7 +365,6 @@ +@@ -365,7 +365,6 @@ try_again: void HardwareSerial::begin(unsigned long baud, byte config) { uint16_t baud_setting; @@ -61,7 +61,7 @@ bool use_u2x = true; #if F_CPU == 16000000UL -@@ -459,7 +458,7 @@ +@@ -459,7 +458,7 @@ void HardwareSerial::flush() size_t HardwareSerial::write(uint8_t c) { --- pkg-plist (revision 433106) +++ pkg-plist (working copy) @@ -1,4 +1,7 @@ +@mode 755 arduino/arduino +bin/arduino +@mode %%EXAMPLES%%arduino/examples/01.Basics/AnalogReadSerial/AnalogReadSerial.ino %%EXAMPLES%%arduino/examples/01.Basics/BareMinimum/BareMinimum.ino %%EXAMPLES%%arduino/examples/01.Basics/Blink/Blink.ino @@ -565,7 +568,6 @@ arduino/lib/ecj.jar arduino/lib/jna.jar arduino/lib/keywords.txt -arduino/lib/librxtxSerial.so arduino/lib/librxtxSerial64.so arduino/lib/pde.jar arduino/lib/preferences.txt @@ -1265,4 +1267,3 @@ arduino/tools/Mangler/make.sh arduino/tools/Mangler/src/Mangler.java arduino/tools/howto.txt -bin/arduino