Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Oct 2012 06:40:35 GMT
From:      Craig Leres <leres@ee.lbl.gov>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/172684: [PATCH] devel/arduino-mk: Update to 0.10
Message-ID:  <201210140640.q9E6eZK9066727@red.freebsd.org>
Resent-Message-ID: <201210140650.q9E6o0GU044702@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         172684
>Category:       ports
>Synopsis:       [PATCH] devel/arduino-mk: Update to 0.10
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 14 06:50:00 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Craig Leres
>Release:        8.2-RELEASE
>Organization:
Lawrence Berkeley National Laboratory
>Environment:
FreeBSD hot.ee.lbl.gov 8.2-RELEASE FreeBSD 8.2-RELEASE #13: Wed Jun 13 18:31:18 PDT 2012     leres@hot.ee.lbl.gov:/usr/src/8.2-RELEASE/sys/amd64/compile/LBLIPV6  amd64

>Description:
Upgrade to from 0.8 to 0.10; add OptionsNG for DOCS and EXAMPLES.
>How-To-Repeat:

>Fix:
Please see the attached patch.

Note: files/Makefile, files/blink2.pde and files/patch-Arduino.mk are all obsolete and should be removed.

Patch attached with submission follows:

--- Makefile.orig	2012-10-13 23:32:14.000000000 -0700
+++ Makefile	2012-10-13 23:26:59.000000000 -0700
@@ -6,7 +6,7 @@
 #
 
 PORTNAME=	arduino-mk
-PORTVERSION=	0.8
+PORTVERSION=	0.10
 CATEGORIES=	devel
 MASTER_SITES=	http://mjo.tc/atelier/2009/02/acli/
 DISTNAME=	${PORTNAME}_${PORTVERSION}
@@ -26,35 +26,47 @@
 
 NO_BUILD=	yes
 
-PLIST_FILES=	arduino/lib/Arduino.mk \
-		arduino/tools/ard-parse-boards
+OPTIONS_DEFINE+=	DOCS EXAMPLES
 
-.if !defined(NOPORTEXAMPLES)
-PLIST_FILES+=	${EXAMPLESDIR_REL}/Makefile \
-		${EXAMPLESDIR_REL}/blink2.pde
-PLIST_DIRS+=	${EXAMPLESDIR_REL}
+.include <bsd.port.options.mk>
+
+.if empty(PORT_OPTIONS:MDOCS)
+PLIST_SUB+=	REFDOCS="@comment "
+.else
+PLIST_SUB+=	REFDOCS=""
 .endif
 
-.include <bsd.port.pre.mk>
+.if empty(PORT_OPTIONS:MEXAMPLES)
+PLIST_SUB+=	EXAMPLES="@comment "
+.else
+PLIST_SUB+=	EXAMPLES=""
+.endif
 
 ARDUINO_CMD=	${FILESDIR}/version.sh ${PREFIX}/arduino/lib/version.txt
 OLD_BOARDS_TXT=	/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/boards.txt
 NEW_BOARDS_TXT=	${PREFIX}/arduino/hardware/arduino/boards.txt
 
+INSLIST=	AnalogInOutSerial Blink BlinkWithoutDelay Fade HelloWorld \
+		WebServer master_reader toneMelody
 post-patch:
 	@ARDUINO="`$(ARDUINO_CMD)`" && \
 	    ${REINPLACE_CMD} -e "s|%%ARDUINO%%|$${ARDUINO}|g" \
-	    ${WRKSRC}/Arduino.mk
+	    ${WRKSRC}/arduino-mk/Arduino.mk
 	@${REINPLACE_CMD} -e "s|'${OLD_BOARDS_TXT}'|'${NEW_BOARDS_TXT}'|g" \
-	    ${WRKSRC}/ard-parse-boards
+	    ${WRKSRC}/bin/ard-parse-boards
 
 do-install:
-	${INSTALL_DATA} ${WRKSRC}/Arduino.mk ${PREFIX}/arduino/lib
-	${INSTALL_SCRIPT} ${WRKSRC}/ard-parse-boards ${PREFIX}/arduino/tools
-.if !defined(NOPORTEXAMPLES)
+	${MKDIR} ${PREFIX}/${PORTNAME}/bin
+	${INSTALL_DATA} ${WRKSRC}/arduino-mk/Arduino.mk ${PREFIX}/${PORTNAME}
+	${INSTALL_SCRIPT} ${WRKSRC}/bin/ard-parse-boards ${PREFIX}/${PORTNAME}/bin
+	${INSTALL_SCRIPT} ${WRKSRC}/bin/ard-reset-arduino ${PREFIX}/${PORTNAME}/bin
+.if ${PORT_OPTIONS:MEXAMPLES}
 	${MKDIR} ${EXAMPLESDIR}
-	${INSTALL_DATA} ${FILESDIR}/Makefile ${EXAMPLESDIR}
-	${INSTALL_DATA} ${FILESDIR}/blink2.pde ${EXAMPLESDIR}
+	(cd ${WRKSRC}/examples && ${COPYTREE_SHARE} "${INSLIST}" ${EXAMPLESDIR})
+.endif
+.if ${PORT_OPTIONS:MDOCS}
+	${MKDIR} ${DOCSDIR}
+	${INSTALL_DATA} ${WRKSRC}/README.md ${DOCSDIR}
 .endif
 
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
--- distinfo.orig	2012-10-13 23:32:09.000000000 -0700
+++ distinfo	2012-09-17 19:16:57.000000000 -0700
@@ -1,2 +1,2 @@
-SHA256 (arduino-mk_0.8.tar.gz) = 9510a8cceb8c3a2e093ec8162b0694e6c7a466e75ded8d1ab3592ae0825f1e0c
-SIZE (arduino-mk_0.8.tar.gz) = 16432
+SHA256 (arduino-mk_0.10.tar.gz) = 95a6c15667d4577a22270b4fc046678e974a4babb7ae1ce4673ecaed02ee9a5d
+SIZE (arduino-mk_0.10.tar.gz) = 25394
--- /dev/null	2012-10-13 23:26:47.000000000 -0700
+++ files/patch-arduino-mk-Arduino.mk	2012-09-17 19:22:57.000000000 -0700
@@ -0,0 +1,52 @@
+--- arduino-mk/Arduino.mk.orig	2012-09-17 10:41:19.000000000 -0700
++++ arduino-mk/Arduino.mk	2012-09-17 19:21:52.000000000 -0700
+@@ -160,7 +160,7 @@
+ #
+ #    ARDUINO_LIBS - A list of any libraries used by the sketch (we
+ #                   assume these are in
+-#                   $(ARDUINO_DIR)/hardware/libraries 
++#                   $(ARDUINO_DIR)/libraries 
+ #
+ #    ARDUINO_PORT - The port where the Arduino can be found (only needed
+ #                   when uploading
+@@ -287,7 +287,7 @@
+ #
+ # Arduino version number
+ ifndef ARDUINO_VERSION
+-ARDUINO_VERSION = 100
++ARDUINO_VERSION = %%ARDUINO%%
+ endif
+ 
+ ########################################################################
+@@ -448,12 +448,12 @@
+ ########################################################################
+ # Local sources
+ #
+-LOCAL_C_SRCS    = $(wildcard *.c)
+-LOCAL_CPP_SRCS  = $(wildcard *.cpp)
+-LOCAL_CC_SRCS   = $(wildcard *.cc)
+-LOCAL_PDE_SRCS  = $(wildcard *.pde)
+-LOCAL_INO_SRCS  = $(wildcard *.ino)
+-LOCAL_AS_SRCS   = $(wildcard *.S)
++LOCAL_C_SRCS    ?= $(wildcard *.c)
++LOCAL_CPP_SRCS  ?= $(wildcard *.cpp)
++LOCAL_CC_SRCS   ?= $(wildcard *.cc)
++LOCAL_PDE_SRCS  ?= $(wildcard *.pde)
++LOCAL_INO_SRCS  ?= $(wildcard *.ino)
++LOCAL_AS_SRCS   ?= $(wildcard *.S)
+ LOCAL_OBJ_FILES = $(LOCAL_C_SRCS:.c=.o)   $(LOCAL_CPP_SRCS:.cpp=.o) \
+ 		$(LOCAL_CC_SRCS:.cc=.o)   $(LOCAL_PDE_SRCS:.pde=.o) \
+ 		$(LOCAL_INO_SRCS:.ino=.o) $(LOCAL_AS_SRCS:.S=.o)
+@@ -593,7 +593,11 @@
+ 
+ # the pde -> cpp -> o file
+ $(OBJDIR)/%.cpp: %.pde
+-	$(ECHO) '#include "WProgram.h"' > $@
++	$(ECHO) '#if ARDUINO >= 100' > $@
++	$(ECHO) '#include "Arduino.h"' >> $@
++	$(ECHO) '#else' >> $@
++	$(ECHO) '#include "WProgram.h"' >> $@
++	$(ECHO) '#endif' >> $@
+ 	$(CAT)  $< >> $@
+ 
+ # the ino -> cpp -> o file
--- /dev/null	2012-10-13 23:26:47.000000000 -0700
+++ pkg-plist	2012-10-13 21:31:29.000000000 -0700
@@ -0,0 +1,38 @@
+arduino-mk/Arduino.mk
+arduino-mk/bin/ard-parse-boards
+arduino-mk/bin/ard-reset-arduino
+@dirrm arduino-mk/bin
+@dirrm arduino-mk
+%%EXAMPLES%%%%EXAMPLESDIR%%/AnalogInOutSerial/AnalogInOutSerial.ino
+%%EXAMPLES%%%%EXAMPLESDIR%%/AnalogInOutSerial/Makefile
+%%EXAMPLES%%%%EXAMPLESDIR%%/Blink/Blink.ino
+%%EXAMPLES%%%%EXAMPLESDIR%%/Blink/Makefile
+%%EXAMPLES%%%%EXAMPLESDIR%%/BlinkWithoutDelay/._.DS_Store
+%%EXAMPLES%%%%EXAMPLESDIR%%/BlinkWithoutDelay/.DS_Store
+%%EXAMPLES%%%%EXAMPLESDIR%%/BlinkWithoutDelay/BlinkWithoutDelay.ino
+%%EXAMPLES%%%%EXAMPLESDIR%%/BlinkWithoutDelay/Makefile
+%%EXAMPLES%%%%EXAMPLESDIR%%/Fade/Fade.ino
+%%EXAMPLES%%%%EXAMPLESDIR%%/Fade/Makefile
+%%EXAMPLES%%%%EXAMPLESDIR%%/HelloWorld/HelloWorld.ino
+%%EXAMPLES%%%%EXAMPLESDIR%%/HelloWorld/Makefile
+%%EXAMPLES%%%%EXAMPLESDIR%%/master_reader/Makefile
+%%EXAMPLES%%%%EXAMPLESDIR%%/master_reader/master_reader.ino
+%%EXAMPLES%%%%EXAMPLESDIR%%/toneMelody/Makefile
+%%EXAMPLES%%%%EXAMPLESDIR%%/toneMelody/pitches.h
+%%EXAMPLES%%%%EXAMPLESDIR%%/toneMelody/toneMelody.ino
+%%EXAMPLES%%%%EXAMPLESDIR%%/WebServer/Makefile
+%%EXAMPLES%%%%EXAMPLESDIR%%/WebServer/WebServer.ino
+%%EXAMPLES%%@dirrm %%EXAMPLESDIR%%/toneMelody
+%%EXAMPLES%%@dirrm %%EXAMPLESDIR%%/master_reader
+%%EXAMPLES%%@dirrm %%EXAMPLESDIR%%/WebServer
+%%EXAMPLES%%@dirrm %%EXAMPLESDIR%%/HelloWorld
+%%EXAMPLES%%@dirrm %%EXAMPLESDIR%%/Fade
+%%EXAMPLES%%@dirrm %%EXAMPLESDIR%%/BlinkWithoutDelay/build-cli/libs/Ethernet
+%%EXAMPLES%%@dirrm %%EXAMPLESDIR%%/BlinkWithoutDelay/build-cli/libs
+%%EXAMPLES%%@dirrm %%EXAMPLESDIR%%/BlinkWithoutDelay/build-cli
+%%EXAMPLES%%@dirrm %%EXAMPLESDIR%%/BlinkWithoutDelay
+%%EXAMPLES%%@dirrm %%EXAMPLESDIR%%/Blink
+%%EXAMPLES%%@dirrm %%EXAMPLESDIR%%/AnalogInOutSerial
+%%EXAMPLES%%@dirrm %%EXAMPLESDIR%%
+%%REFDOCS%%%%DOCSDIR%%/README.md
+%%REFDOCS%%@dirrm %%DOCSDIR%%


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210140640.q9E6eZK9066727>