Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Sep 2009 13:05:53 +0400
From:      Anonymous <swell.k@gmail.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/139206: [patch] archivers/xz: use system byteswapping functions
Message-ID:  <86my4f1lse.fsf@gmail.com>
Resent-Message-ID: <200909280910.n8S9A2Xg038760@freefall.freebsd.org>

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

>Number:         139206
>Category:       ports
>Synopsis:       [patch] archivers/xz: use system byteswapping functions
>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:   Mon Sep 28 09:10:02 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Anonymous
>Release:        FreeBSD 9.0-CURRENT amd64
>Organization:
>Environment:
System: FreeBSD 9.0-CURRENT #2 r197528M: Sat Sep 26 20:24:09 UTC 2009     root@luffy:/usr/obj/usr/src/sys/PHOENIX  amd64
>Description:
>How-To-Repeat:
>Fix:
--- xz.diff begins here ---
Index: archivers/xz/Makefile
===================================================================
RCS file: /home/csup/ports/archivers/xz/Makefile,v
retrieving revision 1.11
diff -u -p -r1.11 Makefile
--- archivers/xz/Makefile	21 Sep 2009 14:07:42 -0000	1.11
+++ archivers/xz/Makefile	28 Sep 2009 09:01:11 -0000
@@ -42,6 +42,12 @@ MLINKS=	xz.1 lzcat.1		xzdiff.1 lzcmp.1 \
 PORTDOCS=	AUTHORS COPYING COPYING.GPLv2 NEWS README THANKS TODO \
 		faq.txt history.txt lzma-file-format.txt xz-file-format.txt
 
+post-patch:	.SILENT
+	${REINPLACE_CMD} -E -e 's/(bswap)_(16|32|64)/\1\2/g' \
+		-e 's|byteswap\.h|sys/endian.h|g' \
+		-e 's|byteswap_h|sys_endian_h|g' \
+		${WRKSRC}/configure
+
 regression-test: build
 	@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} check
 
Index: archivers/xz/files/patch-config.h.in
===================================================================
RCS file: archivers/xz/files/patch-config.h.in
diff -N archivers/xz/files/patch-config.h.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ archivers/xz/files/patch-config.h.in	16 Sep 2009 00:23:05 -0000
@@ -0,0 +1,13 @@
+--- config.h.in~
++++ config.h.in
+@@ -22,8 +22,8 @@
+ /* Define to 1 if bswap_64 is available. */
+ #undef HAVE_BSWAP_64
+ 
+-/* Define to 1 if you have the <byteswap.h> header file. */
+-#undef HAVE_BYTESWAP_H
++/* Define to 1 if you have the <sys/endian.h> header file. */
++#undef HAVE_SYS_ENDIAN_H
+ 
+ /* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
+    CoreFoundation framework. */
Index: archivers/xz/files/patch-src-common-bswap.h
===================================================================
RCS file: archivers/xz/files/patch-src-common-bswap.h
diff -N archivers/xz/files/patch-src-common-bswap.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ archivers/xz/files/patch-src-common-bswap.h	16 Sep 2009 00:22:04 -0000
@@ -0,0 +1,16 @@
+--- src/common/bswap.h~
++++ src/common/bswap.h
+@@ -20,8 +20,11 @@
+ // bswap_xx macros/functions, which is why we check them separately even
+ // if byteswap.h is available.
+ 
+-#ifdef HAVE_BYTESWAP_H
+-#	include <byteswap.h>
++#ifdef HAVE_SYS_ENDIAN_H
++#	include <sys/endian.h>
++#	define bswap_16 bswap16
++#	define bswap_32 bswap32
++#	define bswap_64 bswap64
+ #endif
+ 
+ #ifndef HAVE_BSWAP_16
--- xz.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



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