From nobody@FreeBSD.org  Tue Jul 12 13:50:42 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B573E106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 12 Jul 2011 13:50:42 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 8D0838FC15
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 12 Jul 2011 13:50:42 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p6CDog5M095281
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 12 Jul 2011 13:50:42 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p6CDogYh095280;
	Tue, 12 Jul 2011 13:50:42 GMT
	(envelope-from nobody)
Message-Id: <201107121350.p6CDogYh095280@red.freebsd.org>
Date: Tue, 12 Jul 2011 13:50:42 GMT
From: Warren Block <wblock@wonkity.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] devel/arduino: use realpath instead of readlink -f
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         158832
>Category:       ports
>Synopsis:       [patch] devel/arduino: use realpath instead of readlink -f
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    rea
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 12 14:00:22 UTC 2011
>Closed-Date:    Thu Aug 04 00:55:48 UTC 2011
>Last-Modified:  Thu Aug  4 01:00:21 UTC 2011
>Originator:     Warren Block
>Release:        8-stable
>Organization:
>Environment:
FreeBSD lightning 8.2-STABLE FreeBSD 8.2-STABLE #0: Sat Jul  9 08:21:18 MDT 2011     root@lightning:/usr/obj/usr/src/sys/LIGHTNING  i386
>Description:
Versions of FreeBSD's readlink from before January 2011 did not support the -f "canonicalize" option.  The Arduino startup script uses readlink -f, so change this to the native realpath(1) which should work on all versions of FreeBSD.
>How-To-Repeat:
Attempt to start the Arduino IDE.  FreeBSD 7.4-RELEASE and 8.2-RELEASE will fail due to the unknown -f option to readlink:

readlink: illegal option -- f
usage: readlink [-n] [file ...]
usage: dirname string [...]
Exception in thread "main" java.lang.NoClassDefFoundError: processing/app/Base
>Fix:
Apply patch.

Patch attached with submission follows:

diff --git a/Makefile b/Makefile
index 7758dd1..4997192 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@
 
 PORTNAME=	arduino
 PORTVERSION=	0022
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	devel java lang
 MASTER_SITES=	GOOGLE_CODE
 EXTRACT_SUFX=	.tgz
@@ -25,7 +25,7 @@ SUB_LIST=	PORTNAME=${PORTNAME}
 
 DESKTOP_ENTRIES=	"Arduino" "Arduino IDE" \
 			${PREFIX}/${PORTNAME}/reference/img/logo.png \
-			"arduino" "Development;IDE;" false
+			"arduino" "Development;IDE;" "false"
 
 .if !defined(NOPORTDOCS)
 OPTIONS+=	REFDOCS "Install the reference documents" on
@@ -65,8 +65,9 @@ post-extract:
 	@${RM} ${WRKSRC}/lib/librxtxSerial.so
 	@${LN} -s ${JAVA_HOME}/lib/${ARCH}/librxtxSerial.so ${WRKSRC}/lib/
 
-	@${REINPLACE_CMD} 's|stk500|arduino|g' ${WRKSRC}/hardware/arduino/boards.txt
-	@${RM} ${WRKSRC}/hardware/arduino/boards.txt.bak
+	@${REINPLACE_CMD} -i "" -e 's|stk500|arduino|g' ${WRKSRC}/hardware/arduino/boards.txt
+
+	@${REINPLACE_CMD} -i "" -e 's|readlink -f|realpath|g' ${WRKSRC}/arduino
 
 post-patch:
 	@${RM} ${WRKSRC}/hardware/arduino/bootloaders/atmega8/*.orig


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->rea 
Responsible-Changed-By: rea 
Responsible-Changed-When: Wed Jul 20 04:59:11 UTC 2011 
Responsible-Changed-Why:  
Grabbing PR. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=158832 

From: Eygene Ryabinkin <rea@FreeBSD.org>
To: FreeBSD GNATS followup <bug-followup@freebsd.org>
Cc:  
Subject: Re: ports/158832: [patch] devel/arduino: use realpath instead of
 readlink -f
Date: Thu, 21 Jul 2011 16:59:24 +0400

 --3MwIy2ne0vdjdPXF
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 I have slightly modified variant of the patch.  Functionally is does
 the same, but keeps Makefile DRY.  Please, take a look:
   http://codelabs.ru/fbsd/ports/arduino/0022-use-realpath.diff
 
 Tinderbox builds for patchedd arduino are fine:
  - http://gpf.codelabs.ru/tb-logs/mine-9/arduino-0022_2.log
  - http://gpf.codelabs.ru/tb-logs/mine-8/arduino-0022_2.log
  - http://gpf.codelabs.ru/tb-logs/mine-7/arduino-0022_2.log
 --=20
 Eygene Ryabinkin                                        ,,,^..^,,,
 [ Life's unfair - but root password helps!           | codelabs.ru ]
 [ 82FE 06BC D497 C0DE 49EC  4FF0 16AF 9EAE 8152 ECFB | freebsd.org ]
 
 --3MwIy2ne0vdjdPXF
 Content-Type: application/pgp-signature
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.17 (FreeBSD)
 
 iF4EAREIAAYFAk4oIqwACgkQFq+eroFS7Pu3WQEAhmrQ2WtsqyeJ30oXiVAXwPJl
 pAclkVDg4q+GkbcdHP0A/0z5cseV8GOX94XNaTsDDqgT2hhOhuNNjj3Al1m7jpfH
 =iqxT
 -----END PGP SIGNATURE-----
 
 --3MwIy2ne0vdjdPXF--

From: Warren Block <wblock@wonkity.com>
To: bug-followup@FreeBSD.org, Eygene Ryabinkin <rea@FreeBSD.org>
Cc:  
Subject: Re: ports/158832: [patch] devel/arduino: use realpath instead of
 readlink -f
Date: Fri, 29 Jul 2011 17:44:37 -0600 (MDT)

 Looks good to me, please commit.
State-Changed-From-To: open->closed 
State-Changed-By: rea 
State-Changed-When: Thu Aug 4 00:55:29 UTC 2011 
State-Changed-Why:  
Fix committed, thanks for submission! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=158832 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/158832: commit references a PR
Date: Thu,  4 Aug 2011 00:55:16 +0000 (UTC)

 rea         2011-08-04 00:54:51 UTC
 
   FreeBSD ports repository
 
   Modified files:
     devel/arduino        Makefile 
   Log:
   devel/arduino: fix two issues
   
    - use realpath instead of 'readlink -f': support of "-f" is the
      recent addition, so realpath will work in more FreeBSD versions;
   
    - add missing "-e" to the REINPLACE_CMD and get rid of .bak file
      creation.
   
   PR: ports/158832
   Approved-by: Warren Block <wblock@wonkity.com> (maintainer), garga (mentor)
   Feature-safe: yes
   
   Revision  Changes    Path
   1.7       +6 -4      ports/devel/arduino/Makefile
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
