Skip site navigation (1)Skip section navigation (2)
Date:      Wed,  5 May 2010 15:39:00 +0200 (CEST)
From:      Martin Matuska <mm@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/146329: [patch] add xz support to bsd.port.mk
Message-ID:  <20100505133900.521DD9248B@mail.vx.sk>
Resent-Message-ID: <201005051340.o45De1P2075308@freefall.freebsd.org>

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

>Number:         146329
>Category:       ports
>Synopsis:       [patch] add xz support to bsd.port.mk
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed May 05 13:40:01 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Martin Matuska
>Release:        FreeBSD 8.0-STABLE amd64
>Organization:
>Environment:
System: FreeBSD neo.vx.sk 8.0-STABLE FreeBSD 8.0-STABLE #0 r207610M: Tue May 4 10:15:14 CEST 2010 root@neo.vx.sk:/usr/obj/stable/sys/NEO amd64
>Description:
Many ports offer nowadays LZMA compressed distfiles (.tar.xz) that
give (much) better compression than bzip2.

The attached patch updates bsd.port.mk and bsd.commands.mk to
support the USE_XZ flag for xz compressed files.

http://tukaani.org/xz/
>How-To-Repeat:
>Fix:
Index: ports/Mk/bsd.commands.mk
===================================================================
RCS file: /home/pcvs/ports/Mk/bsd.commands.mk,v
retrieving revision 1.4
diff -u -r1.4 bsd.commands.mk
--- ports/Mk/bsd.commands.mk	3 Aug 2009 15:36:58 -0000	1.4
+++ ports/Mk/bsd.commands.mk	5 May 2010 12:35:43 -0000
@@ -91,6 +91,7 @@
 WHICH?=		/usr/bin/which
 XARGS?=		/usr/bin/xargs
 XMKMF?=		${LOCALBASE}/bin/xmkmf -a
+XZ_CMD?=	${LOCALBASE}/bin/xz
 YACC?=		/usr/bin/yacc
 
 .if exists(/sbin/md5)
Index: ports/Mk/bsd.port.mk
===================================================================
RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.637
diff -u -r1.637 bsd.port.mk
--- ports/Mk/bsd.port.mk	27 Apr 2010 21:58:23 -0000	1.637
+++ ports/Mk/bsd.port.mk	5 May 2010 12:35:44 -0000
@@ -94,7 +94,8 @@
 # EXTRACT_SUFX	- Suffix for archive names
 #				  You never have to set both DISTFILES and EXTRACT_SUFX.
 #				  Default: .tar.bz2 if USE_BZIP2 is set, .zip if USE_ZIP is
-#				  set, .run if USE_MAKESELF is set, .tar.gz otherwise).
+#				  set, .tar.xz if USE_XZ is set, .run if USE_MAKESELF is set, 
+#				  .tar.gz otherwise).
 # MASTER_SITES	- Primary location(s) for distribution files if not found
 #				  locally.  See bsd.sites.mk for common choices for
 #				  MASTER_SITES.
@@ -296,6 +297,8 @@
 #
 # USE_BZIP2		- If set, this port tarballs use bzip2, not gzip, for
 #				  compression.
+# USE_XZ		- If set, this port tarballs use xz (lzma)
+#				  for compression
 # USE_ZIP		- If set, this port distfile uses zip, not tar w/[bg]zip
 #				  for compression.
 # USE_MAKESELF		- If set, this port distfile uses makeself, not tar w/[bg]zip
@@ -1413,6 +1416,8 @@
 EXTRACT_SUFX?=			.tar.bz2
 .elif defined(USE_ZIP)
 EXTRACT_SUFX?=			.zip
+.elif defined(USE_XZ)
+EXTRACT_SUFX?=			.tar.xz
 .elif defined(USE_MAKESELF)
 EXTRACT_SUFX?=			.run
 .else
@@ -1731,6 +1736,9 @@
 .if defined(USE_ZIP)
 EXTRACT_DEPENDS+=	${LOCALBASE}/bin/unzip:${PORTSDIR}/archivers/unzip
 .endif
+.if defined(USE_XZ)
+EXTRACT_DEPENDS+=	${LOCALBASE}/bin/xz:${PORTSDIR}/archivers/xz
+.endif
 .if defined(USE_MAKESELF)
 EXTRACT_DEPENDS+=	unmakeself:${PORTSDIR}/archivers/unmakeself
 .endif
@@ -2368,6 +2376,8 @@
 .endif
 .if defined(USE_BZIP2)
 EXTRACT_CMD?=			${BZIP2_CMD}
+.elif defined(USE_XZ)
+EXTRACT_CMD?=			${XZ_CMD}
 .else
 EXTRACT_CMD?=			${GZIP_CMD}
 .endif
>Release-Note:
>Audit-Trail:
>Unformatted:



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