NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

xsrc/45223: xorg tools build fails on CentOS due to lack of bz2 support



>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:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 08 02:15:00 +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
 
 
   /*************************************************************************/

---



Home | Main Index | Thread Index | Old Index