From lennox@cs.columbia.edu  Wed Apr 23 15:52:43 2008
Return-Path: <lennox@cs.columbia.edu>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 214611065672
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 23 Apr 2008 15:52:43 +0000 (UTC)
	(envelope-from lennox@cs.columbia.edu)
Received: from cnr.cs.columbia.edu (cnr.cs.columbia.edu [128.59.19.133])
	by mx1.freebsd.org (Postfix) with ESMTP id B07698FC19
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 23 Apr 2008 15:52:42 +0000 (UTC)
	(envelope-from lennox@cs.columbia.edu)
Received: from cnr.cs.columbia.edu (localhost [127.0.0.1])
	by cnr.cs.columbia.edu (8.13.6/8.13.6) with ESMTP id m3NFe2w7012817
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 23 Apr 2008 11:40:02 -0400 (EDT)
	(envelope-from lennox@cnr.cs.columbia.edu)
Received: (from root@localhost)
	by cnr.cs.columbia.edu (8.13.6/8.13.6/Submit) id m3NFe1ac012814;
	Wed, 23 Apr 2008 11:40:01 -0400 (EDT)
	(envelope-from lennox)
Message-Id: <200804231540.m3NFe1ac012814@cnr.cs.columbia.edu>
Date: Wed, 23 Apr 2008 11:40:01 -0400 (EDT)
From: Jonathan Lennox <lennox@cs.columbia.edu>
Reply-To: Jonathan Lennox <lennox@cs.columbia.edu>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: graphics/ImageMagick doesn't extract if archivers/lzmautils is installed
X-Send-Pr-Version: 3.113
X-GNATS-Notify: mi@aldan.algebra.com

>Number:         123018
>Category:       ports
>Synopsis:       graphics/ImageMagick doesn't extract if archivers/lzmautils is installed
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    miwi
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 23 16:00:02 UTC 2008
>Closed-Date:    Mon Apr 28 14:33:58 UTC 2008
>Last-Modified:  Mon Apr 28 14:33:58 UTC 2008
>Originator:     Jonathan Lennox
>Release:        FreeBSD 5.5-RELEASE-p20 i386
>Organization:
Columbia University
>Environment:
System: FreeBSD cnr.cs.columbia.edu 5.5-RELEASE-p20 FreeBSD 5.5-RELEASE-p20 #27: Thu Apr 17 12:35:22 EDT 2008 lennox@cnr.cs.columbia.edu:/usr/obj/usr/src/sys/CNR i386


	
>Description:

The graphics/ImageMagick port now uses the lzma-compressed distribution
archive of the port.

It has an EXTRACT_DEPENDS on archivers/lzma, checking for the lzma executable. 

Unfortunately, the archivers/lzmautils port also provides an lzma
executable, with a different syntax for its command-line options.  (The
archivers/lzmautils port is a dependency of archivers/gtar, which I believe
is why it happened to be installed on my system.)

Thus, if archivers/lzmautils is installed, ImageMagick's EXTRACT_DEPENDS is
satisfied, but the extraction fails, like this:

===>  Extracting for ImageMagick-6.4.0.7
=> MD5 Checksum OK for ImageMagick-6.4.0-7.tar.lzma.
=> SHA256 Checksum OK for ImageMagick-6.4.0-7.tar.lzma.
===>   ImageMagick-6.4.0.7 depends on executable: lzma - found
===>   ImageMagick-6.4.0.7 depends on file: /usr/local/bin/perl5.8.8 - found
/usr/local/bin/lzma: invalid option -- s
tar: Error opening archive: Empty input file: Inappropriate file type or format
*** Error code 1

Stop in /usr/ports/graphics/ImageMagick.


>How-To-Repeat:
        portinstall archivers/lzmautils
        portinstall graphics/ImageMagick

>Fix:

The following patch causes the ImageMagick makefile to detect whether
archivers/lzma or archivers/lzmautils is installed, and adjust its
extraction command accordingly.  (archivers/lzmautils provides lzcat,
whereas archivers/lzma does not.)

A separate question is which port ImageMagick should use for its
EXTRACT_DEPENDS.

--- graphics/ImageMagick/Makefile.orig	Wed Apr 23 11:24:03 2008
+++ graphics/ImageMagick/Makefile	Wed Apr 23 11:29:59 2008
@@ -30,8 +30,6 @@ EXTRACT_DEPENDS=	lzma:${PORTSDIR}/archiv
 
 WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION:R}
 
-EXTRACT_CMD=	${LOCALBASE}/bin/lzma d
-EXTRACT_BEFORE_ARGS=	-so
 USE_PERL5=	yes
 USE_GNOME=	gnomehack gnometarget pkgconfig
 USE_AUTOTOOLS=	libltdl:15
@@ -79,6 +77,16 @@ OPTIONS=	X11				"X11 support" on \
 		IMAGEMAGICK_GSLIB	"libgs (Postscript SHLIB) support" off
 
 .include <bsd.port.pre.mk>
+
+# ${LOCALBASE}/bin/lzma from archivers/lzma and from archivers/lzmautils have different syntaxes.
+.if exists(${LOCALBASE}/bin/lzcat)
+# archivers/lzmautils
+EXTRACT_CMD=	${LOCALBASE}/bin/lzcat
+.else
+# archivers/lzma
+EXTRACT_CMD=	${LOCALBASE}/bin/lzma d
+EXTRACT_BEFORE_ARGS=	-so
+.endif
 
 .if defined(WITH_GHOSTSCRIPT_GNU) && !defined(WITHOUT_IMAGEMAGICK_PDF)
 IGNORE=		requires newer version of ghostscript



>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Wed Apr 23 16:00:15 UTC 2008 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

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

From: Edwin Groothuis <edwin@FreeBSD.org>
To: mi@aldan.algebra.com
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/123018: graphics/ImageMagick doesn't extract if archivers/lzmautils is installed
Date: Wed, 23 Apr 2008 16:00:14 UT

 Maintainer of graphics/ImageMagick,
 
 Please note that PR ports/123018 has just been submitted.
 
 If it contains a patch for an upgrade, an enhancement or a bug fix
 you agree on, reply to this email stating that you approve the patch
 and a committer will take care of it.
 
 The full text of the PR can be found at:
     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/123018
 
 -- 
 Edwin Groothuis via the GNATS Auto Assign Tool
 edwin@FreeBSD.org
State-Changed-From-To: feedback->open 
State-Changed-By: miwi 
State-Changed-When: Mon Apr 28 10:34:53 UTC 2008 
State-Changed-Why:  
. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=123018 
State-Changed-From-To: open->feedback 
State-Changed-By: miwi 
State-Changed-When: Mon Apr 28 10:35:02 UTC 2008 
State-Changed-Why:  
Hi Jonathan, 

Could you please test if this issue still exists with an fresh ports 
tree? Thanks. 



http://www.freebsd.org/cgi/query-pr.cgi?pr=123018 
Responsible-Changed-From-To: freebsd-ports-bugs->miwi 
Responsible-Changed-By: miwi 
Responsible-Changed-When: Mon Apr 28 10:36:41 UTC 2008 
Responsible-Changed-Why:  
track 

http://www.freebsd.org/cgi/query-pr.cgi?pr=123018 
State-Changed-From-To: feedback->closed 
State-Changed-By: mi 
State-Changed-When: Mon Apr 28 14:33:06 UTC 2008 
State-Changed-Why:  
The new version of the port is using the unambigous p7zip 
instead of lzma. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=123018 
>Unformatted:
