NetBSD Problem Report #45223

From tsutsui@ceres.dti.ne.jp  Mon Aug  8 02:11:34 2011
Return-Path: <tsutsui@ceres.dti.ne.jp>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id C13EA63CA5F
	for <gnats-bugs@gnats.NetBSD.org>; Mon,  8 Aug 2011 02:11:34 +0000 (UTC)
Message-Id: <201108080211.p782BT6U027883@mirage.localdomain>
Date: Mon, 8 Aug 2011 11:11:29 +0900 (JST)
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Reply-To: tsutsui@ceres.dti.ne.jp
To: gnats-bugs@gnats.NetBSD.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: xorg tools build fails on CentOS due to lack of bz2 support
X-Send-Pr-Version: 3.95

>Number:         45223
>Category:       xsrc
>Synopsis:       xorg tools build fails on CentOS due to lack of bz2 support
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    xsrc-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 08 02:15:00 +0000 2011
>Closed-Date:    Wed Aug 10 10:36:52 +0000 2011
>Last-Modified:  Wed Aug 10 10:36:52 +0000 2011
>Originator:     Izumi Tsutsui
>Release:        NetBSD 5.99.55
>Organization:
>Environment:
System (host): Linux 2.6.18-164.15.1.el5.028stab068.9 #1 SMP Tue Mar 30 18:07:38 MSD 2010 i686 i686 i386 GNU/Linux
Target: NetBSD 5.99.55 amd64, but affects all Xorg ports 
>Description:
After import of freetype-2.4.5, fc-cache and mkfontscale have been changed
to include bzip2 support:
http://mail-index.NetBSD.org/source-changes/2011/07/23/msg024996.html
but some Linux systems don't have bzip2 support by default so
xsrc tools build fails on such systems:
http://mail-index.NetBSD.org/source-changes-d/2011/07/27/msg003777.html

---
 :
#   compile  fc-cache/ftbzip2.lo
cc -O -DFONTCONFIG_PATH='"/usr/local/src/obj.i386/destdir.i386/etc/X11/fonts"' \
  -DFC_DEFAULT_FONTS='"/usr/X11R7/lib/X11/fonts/Type1"'  \
-DFC_CACHEDIR='"/usr/local/src/obj.i386/destdir.i386/var/cache/fontconfig"'  \
-DHAVE_FT_BITMAP_SIZE_Y_PPEM  -DHAVE_FT_GET_BDF_PROPERTY  \
-DHAVE_FT_GET_NEXT_CHAR  -DHAVE_FT_GET_PS_FONT_INFO  \
-DHAVE_FT_GET_X11_FONT_FORMAT  -DHAVE_FT_HAS_PS_GLYPH_NAMES  \
-DHAVE_EXPAT -DXFREE86_FT2 -DHAVE_INTTYPES_H  -DFT2_BUILD_LIBRARY  \
-DXML_BYTE_ORDER=0 -DHAVE_MEMMOVE=1  -DHAVE_STDINT_H -DHAVE_RANDOM \
-DDARWIN_NO_CARBON -I/usr/local/xsrc/external/mit/fontconfig/dist \
-I/usr/local/xsrc/external/mit/freetype/dist  \
-I/usr/local/xsrc/external/mit/freetype/dist/include \
-I/usr/local/xsrc/external/mit/expat/dist//lib  \
-I/usr/local/xsrc/external/mit/fontconfig/dist/../include  \
-I/usr/local/src/obj.i386/destdir.i386/usr/X11R7/include -I. -c -o \
ftbzip2.lo.o    /usr/local/xsrc/external/mit/freetype/dist/src/bzip2/ftbzip2.c \
/usr/local/xsrc/external/mit/freetype/dist/src/bzip2/ftbzip2.c:51:19: \
error: bzlib.h: No such file or directory
 :
---

>How-To-Repeat:
% build.sh -m i386 -U -x build
on CentOS 5 or other systems which don't have bzip2.

>Fix:
It seems tools fc-cache and mkfontscale don't have to have bzip2 support
for cross builds of xsrc so disabling FT_CONFIG_OPTION_USE_BZIP2 in
xsrc/external/mit/freetype/dist/include/freetype/config/ftoption.h
on tools build fixes the problem. (diff attached)

But I wonder if it's okay to patch freetype config file (which is also
installed under ${DESTDIR}/usr/X11R7/include/freetype2/) directly.
Should we rahter have independent ftoptions.h and ft2build.h for
tools build as per comments in ftoption.h?
(it also works but requires extra files across two tools)

---
Index: src/external/mit/xorg/tools/fc-cache/Makefile
===================================================================
RCS file: /cvsroot/src/external/mit/xorg/tools/fc-cache/Makefile,v
retrieving revision 1.4
diff -u -p -r1.4 Makefile
--- src/external/mit/xorg/tools/fc-cache/Makefile	23 Jul 2011 23:42:02 -0000	1.4
+++ src/external/mit/xorg/tools/fc-cache/Makefile	8 Aug 2011 00:51:44 -0000
@@ -39,8 +39,8 @@ SRCS.freetype+=	type1cid.c
 .PATH:	${FREETYPE}/src/gzip
 SRCS.freetype+=	ftgzip.c

-.PATH:	${FREETYPE}/src/bzip2
-SRCS.freetype+=	ftbzip2.c
+#.PATH:	${FREETYPE}/src/bzip2
+#SRCS.freetype+=	ftbzip2.c

 .PATH:	${FREETYPE}/src/lzw
 SRCS.freetype+=	ftlzw.c
@@ -100,12 +100,14 @@ HOST_CPPFLAGS=	-DFONTCONFIG_PATH='"${DES
 		-DFT2_BUILD_LIBRARY \
 		-DXML_BYTE_ORDER=0 -DHAVE_MEMMOVE=1 \
 		-DHAVE_STDINT_H -DHAVE_RANDOM -DDARWIN_NO_CARBON
+HOST_CPPFLAGS+=	-DFT_CONFIG_OPTION_DISABLE_BZIP2
 HOST_CPPFLAGS+=	-I${FONTCONFIG} -I${FREETYPE} \
 		-I${FREETYPE}/include -I${EXPAT}/lib \
 		-I${FONTCONFIG}/../include \
 		-I${DESTDIR}${X11INCDIR} -I.

-LDADD=	-lz -lbz2
+LDADD=	-lz
+#LDADD+=	-lbz2

 FCARCH_DEPFILE=	fc-cache.c
 .include "../../lib/fontconfig/src/Makefile.fcarch"
Index: src/external/mit/xorg/tools/mkfontscale/Makefile
===================================================================
RCS file: /cvsroot/src/external/mit/xorg/tools/mkfontscale/Makefile,v
retrieving revision 1.3
diff -u -p -r1.3 Makefile
--- src/external/mit/xorg/tools/mkfontscale/Makefile	23 Jul 2011 23:42:02 -0000	1.3
+++ src/external/mit/xorg/tools/mkfontscale/Makefile	8 Aug 2011 00:51:44 -0000
@@ -31,8 +31,8 @@ SRCS.freetype+=	type1cid.c
 .PATH:	${FREETYPE}/src/gzip
 SRCS.freetype+=	ftgzip.c

-.PATH:	${FREETYPE}/src/bzip2
-SRCS.freetype+=	ftbzip2.c
+#.PATH:	${FREETYPE}/src/bzip2
+#SRCS.freetype+=	ftbzip2.c

 .PATH:	${FREETYPE}/src/lzw
 SRCS.freetype+=	ftlzw.c
@@ -78,11 +78,13 @@ SRCS.fontenc=	fontenc.c encparse.c

 SRCS+=	${SRCS.mkfontscale} ${SRCS.freetype} ${SRCS.fontenc}

-LDADD=	-lz -lbz2
+LDADD=	-lz
+#LDADD+=	-lbz2

 HOST_CPPFLAGS=	-DFONTENC_NO_LIBFONT -DXFREE86_FT2 -DFONTENC_NO_LIBFONT \
 		-DFT2_BUILD_LIBRARY -DDARWIN_NO_CARBON \
 		-DFONT_ENCODINGS_DIRECTORY=\"${X11FONTDIR}/encodings/encodings.dir\"
+HOST_CPPFLAGS+=	-DFT_CONFIG_OPTION_DISABLE_BZIP2
 HOST_CPPFLAGS+=	-I${FREETYPE}/include -I${DESTDIR}${X11INCDIR} \
 		-I${DESTDIR}${X11INCDIR}/freetype2
 #		-I${X11SRCDIR.xc}/include/fonts
Index: xsrc/external/mit/freetype/dist/include/freetype/config/ftoption.h
===================================================================
RCS file: /cvsroot/xsrc/external/mit/freetype/dist/include/freetype/config/ftoption.h,v
retrieving revision 1.2
diff -u -p -r1.2 ftoption.h
--- xsrc/external/mit/freetype/dist/include/freetype/config/ftoption.h	23 Jul 2011 23:30:59 -0000	1.2
+++ xsrc/external/mit/freetype/dist/include/freetype/config/ftoption.h	8 Aug 2011 00:51:44 -0000
@@ -200,7 +200,9 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*   Define this macro if you want to enable this `feature'.             */
   /*                                                                       */
+#ifndef FT_CONFIG_OPTION_DISABLE_BZIP2
 #define FT_CONFIG_OPTION_USE_BZIP2
+#endif


   /*************************************************************************/

---

>Release-Note:

>Audit-Trail:
From: matthew green <mrg@eterna.com.au>
To: gnats-bugs@NetBSD.org
Cc: xsrc-manager@netbsd.org, gnats-admin@netbsd.org,
    netbsd-bugs@netbsd.org
Subject: re: xsrc/45223: xorg tools build fails on CentOS due to lack of bz2 support
Date: Mon, 08 Aug 2011 13:49:42 +1000

 i'm ok with your patch to disable; it doesn't affect the installed
 world unless someone goes defining FT_CONFIG_OPTION_DISABLE_BZIP2
 which is pretty unlikely if they don't mean it.


 .mrg.

From: "Izumi Tsutsui" <tsutsui@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/45223 CVS commit: xsrc/external/mit/freetype/dist/include/freetype/config
Date: Wed, 10 Aug 2011 10:32:19 +0000

 Module Name:	xsrc
 Committed By:	tsutsui
 Date:		Wed Aug 10 10:32:19 UTC 2011

 Modified Files:
 	xsrc/external/mit/freetype/dist/include/freetype/config: ftoption.h

 Log Message:
 Make it possible to disable #define FT_CONFIG_OPTION_USER_BZIP2
 setting by -DFT_CONFIG_OPTION_DISABLE_BZIP2 for tools build
 on systems which don't have native bzip2 support.
 Ok'ed by mrg@ in PR xsrc/45223.


 To generate a diff of this commit:
 cvs rdiff -u -r1.2 -r1.3 \
     xsrc/external/mit/freetype/dist/include/freetype/config/ftoption.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Izumi Tsutsui" <tsutsui@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/45223 CVS commit: src/external/mit/xorg/tools
Date: Wed, 10 Aug 2011 10:34:49 +0000

 Module Name:	src
 Committed By:	tsutsui
 Date:		Wed Aug 10 10:34:49 UTC 2011

 Modified Files:
 	src/external/mit/xorg/tools/fc-cache: Makefile
 	src/external/mit/xorg/tools/mkfontscale: Makefile

 Log Message:
 Disable bzip2 support in freetype on xorg tools build.
 Fixes PR xsrc/45223 (xorg tools build fails on CentOS due to
 lack of bz2 support).


 To generate a diff of this commit:
 cvs rdiff -u -r1.4 -r1.5 src/external/mit/xorg/tools/fc-cache/Makefile
 cvs rdiff -u -r1.3 -r1.4 src/external/mit/xorg/tools/mkfontscale/Makefile

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: tsutsui@NetBSD.org
State-Changed-When: Wed, 10 Aug 2011 19:36:52 +0900
State-Changed-Why:
Fixes committed.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.