diff options
author | Ryan Hill <dirtyepic@gentoo.org> | 2008-03-20 04:18:28 +0000 |
---|---|---|
committer | Ryan Hill <dirtyepic@gentoo.org> | 2008-03-20 04:18:28 +0000 |
commit | bc933da08f7acdd89f069d033fe4ad4c7624920a (patch) | |
tree | 22504eadc3c6aa9e228e5a81261571081cce4457 /media-libs | |
parent | Marked ~hppa (bug #213938). (diff) | |
download | gentoo-2-bc933da08f7acdd89f069d033fe4ad4c7624920a.tar.gz gentoo-2-bc933da08f7acdd89f069d033fe4ad4c7624920a.tar.bz2 gentoo-2-bc933da08f7acdd89f069d033fe4ad4c7624920a.zip |
Version bump taken from upstream svn. The code hasn't changed in years but
is still more recent than the version we're currently packaging.
- bug #202017 - fix install on ppc64 (hopefully)
- bug #209303 - ttf2tfm segfault
- another ttf2tfm segfault (http://bugs.debian.org/395341)
- ttf2pk/ttf2tfm now work with tetex-3
- fix typo in kpathsea configure option
- make Makefiles in contrib honor DESTDIR
- remove manual src_install hacks
- silence strict-aliasing warnings
- major cleanup
nls is broken, but it doesn't work in the current stable either.
(Portage version: 2.1.4.4)
Diffstat (limited to 'media-libs')
7 files changed, 948 insertions, 1 deletions
diff --git a/media-libs/freetype/ChangeLog b/media-libs/freetype/ChangeLog index b6dfb3936f26..daa89e12121e 100644 --- a/media-libs/freetype/ChangeLog +++ b/media-libs/freetype/ChangeLog @@ -1,6 +1,30 @@ # ChangeLog for media-libs/freetype # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/media-libs/freetype/ChangeLog,v 1.170 2008/03/02 22:21:28 dirtyepic Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-libs/freetype/ChangeLog,v 1.171 2008/03/20 04:18:28 dirtyepic Exp $ + +*freetype-1.4_pre20080316 (20 Mar 2008) + + 20 Mar 2008; Ryan Hill <dirtyepic@gentoo.org> + +files/freetype-1.4_pre-contrib-destdir.patch, + +files/freetype-1.4_pre-malloc.patch, + +files/freetype-1.4_pre-silence-strict-aliasing.patch, + +files/freetype-1.4_pre-ttf2pk-tetex-3.patch, + +files/freetype-1.4_pre-ttf2tfm-segfault.patch, + +freetype-1.4_pre20080316.ebuild: + Version bump taken from upstream svn. The code hasn't changed in years but + is still more recent than the version we're currently packaging. + + - bug #202017 - fix install on ppc64 (hopefully) + - bug #209303 - ttf2tfm segfault + - another ttf2tfm segfault (http://bugs.debian.org/395341) + - ttf2pk/ttf2tfm now work with tetex-3 + - fix typo in kpathsea configure option + - make Makefiles in contrib honor DESTDIR + - remove manual src_install hacks + - silence strict-aliasing warnings + - major cleanup + + nls is broken, but it doesn't work in the current stable either. 02 Mar 2008; Ryan Hill <dirtyepic@gentoo.org> -files/freetype-2.1.9-fix_bci.patch, diff --git a/media-libs/freetype/files/freetype-1.4_pre-contrib-destdir.patch b/media-libs/freetype/files/freetype-1.4_pre-contrib-destdir.patch new file mode 100644 index 000000000000..61df474e92a1 --- /dev/null +++ b/media-libs/freetype/files/freetype-1.4_pre-contrib-destdir.patch @@ -0,0 +1,95 @@ +diff -Naur freetype-orig/freetype1-contrib/ttf2bdf/configure.in freetype/freetype1-contrib/ttf2bdf/configure.in +--- freetype-orig/freetype1-contrib/ttf2bdf/configure.in 2000-04-14 11:53:50.000000000 -0600 ++++ freetype/freetype1-contrib/ttf2bdf/configure.in 2008-03-19 20:24:48.000000000 -0600 +@@ -29,6 +29,7 @@ + AC_SUBST(XX_CFLAGS) + + AC_CHECK_PROG(RM, rm, rm) ++AC_PROG_INSTALL + + dnl Checks for header files. + AC_HEADER_STDC +diff -Naur freetype-orig/freetype1-contrib/ttf2bdf/Makefile.in freetype/freetype1-contrib/ttf2bdf/Makefile.in +--- freetype-orig/freetype1-contrib/ttf2bdf/Makefile.in 2001-02-03 11:03:12.000000000 -0600 ++++ freetype/freetype1-contrib/ttf2bdf/Makefile.in 2008-03-19 20:24:15.000000000 -0600 +@@ -45,6 +45,10 @@ + bindir = @bindir@ + mandir = @mandir@ + ++INSTALL = @INSTALL@ ++INSTALL_DATA = @INSTALL_DATA@ ++INSTALL_PROGRAM = @INSTALL_PROGRAM@ ++ + all: ttf2bdf + + ttf2bdf: $(OBJS) +@@ -63,9 +67,9 @@ + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + + install: ttf2bdf +- @$(MKINSTALLDIRS) $(bindir) $(mandir)/man1 +- @cp ttf2bdf $(bindir)/ttf2bdf +- @cp ttf2bdf.man $(mandir)/man1/ttf2bdf.1 ++ @$(MKINSTALLDIRS) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1 ++ @$(INSTALL_PROGRAM) ttf2bdf $(DESTDIR)$(bindir)/ttf2bdf ++ @$(INSTALL_DATA) ttf2bdf.man $(DESTDIR)$(mandir)/man1/ttf2bdf.1 + + uninstall: + @$(RM) -f $(bindir)/ttf2bdf +diff -Naur freetype-orig/freetype1-contrib/ttf2pfb/Makefile.in freetype/freetype1-contrib/ttf2pfb/Makefile.in +--- freetype-orig/freetype1-contrib/ttf2pfb/Makefile.in 2000-04-14 11:53:50.000000000 -0600 ++++ freetype/freetype1-contrib/ttf2pfb/Makefile.in 2008-03-19 20:24:15.000000000 -0600 +@@ -32,7 +32,7 @@ + + SRC = t1asm.c ttf2pfb.c + +-PROGRAMS = t1asm ttf2pfb ++PROGRAMS = ttf2pfb + + default all: $(PROGRAMS) + +@@ -58,11 +58,10 @@ + $(CC) -c $(FT_CFLAGS) $< + + install: $(PROGRAMS) +- $(MKINSTALLDIRS) $(bindir) ++ $(MKINSTALLDIRS) $(DESTDIR)$(bindir) + for P in $(PROGRAMS) ; do \ +- $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$P $(bindir)/$$P ; \ ++ $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$P $(DESTDIR)$(bindir)/$$P ; \ + done +- $(INSTALL_PROGRAM) $(srcdir)/getafm $(bindir)/getafm + + uninstall: + -for P in $(PROGRAMS) ; do \ +diff -Naur freetype-orig/freetype1-contrib/ttf2pk/Makefile.in freetype/freetype1-contrib/ttf2pk/Makefile.in +--- freetype-orig/freetype1-contrib/ttf2pk/Makefile.in 2001-02-03 11:03:12.000000000 -0600 ++++ freetype/freetype1-contrib/ttf2pk/Makefile.in 2008-03-19 20:24:15.000000000 -0600 +@@ -69,10 +69,10 @@ + $(LIBDIR)/libttf.la $(LDFLAGS) + + install: $(PROGRAMS) +- $(MKINSTALLDIRS) $(bindir) $(mandir)/man1 ++ $(MKINSTALLDIRS) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1 + for P in $(PROGRAMS) ; do \ +- $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$P $(bindir)/$$P ; \ +- $(INSTALL_DATA) $(srcdir)/$$P.1 $(mandir)/man1 ; \ ++ $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$P $(DESTDIR)$(bindir)/$$P ; \ ++ $(INSTALL_DATA) $(srcdir)/$$P.1 $(DESTDIR)$(mandir)/man1 ; \ + done + + uninstall: +diff -Naur freetype-orig/freetype1-contrib/ttfbanner/Makefile.in freetype/freetype1-contrib/ttfbanner/Makefile.in +--- freetype-orig/freetype1-contrib/ttfbanner/Makefile.in 2000-04-14 11:53:50.000000000 -0600 ++++ freetype/freetype1-contrib/ttfbanner/Makefile.in 2008-03-19 20:24:15.000000000 -0600 +@@ -53,8 +53,8 @@ + $(CC) -c $(FT_CFLAGS) $< + + install: ttfbanner +- $(MKINSTALLDIRS) $(bindir) +- $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) ttfbanner $(bindir)/ ++ $(MKINSTALLDIRS) $(DESTDIR)$(bindir) ++ $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) ttfbanner $(DESTDIR)$(bindir) + + uninstall: + $(LIBTOOL) --mode=uninstall $(RM) $(bindir)/ttfbanner diff --git a/media-libs/freetype/files/freetype-1.4_pre-malloc.patch b/media-libs/freetype/files/freetype-1.4_pre-malloc.patch new file mode 100644 index 000000000000..f92a49fd0d70 --- /dev/null +++ b/media-libs/freetype/files/freetype-1.4_pre-malloc.patch @@ -0,0 +1,13 @@ +https://bugs.gentoo.org/show_bug.cgi?id=104016 + +diff -Naurp freetype-orig/freetype1-contrib/ttfbanner/ttfbanner.c freetype/freetype1-contrib/ttfbanner/ttfbanner.c +--- freetype-orig/freetype1-contrib/ttfbanner/ttfbanner.c 2008-03-18 18:16:36.000000000 -0600 ++++ freetype/freetype1-contrib/ttfbanner/ttfbanner.c 2008-03-18 18:16:22.000000000 -0600 +@@ -4,7 +4,6 @@ + + #include <stdlib.h> + #include <stdio.h> +-#include <malloc.h> + #include <string.h> + #include "freetype.h" + #include "ttfbanner.h" diff --git a/media-libs/freetype/files/freetype-1.4_pre-silence-strict-aliasing.patch b/media-libs/freetype/files/freetype-1.4_pre-silence-strict-aliasing.patch new file mode 100644 index 000000000000..4379cb9fd996 --- /dev/null +++ b/media-libs/freetype/files/freetype-1.4_pre-silence-strict-aliasing.patch @@ -0,0 +1,241 @@ +diff -Naurp freetype-orig/lib/extend/ftxgdef.c freetype/lib/extend/ftxgdef.c +--- freetype-orig/lib/extend/ftxgdef.c 2002-01-18 18:23:23.000000000 -0600 ++++ freetype/lib/extend/ftxgdef.c 2008-03-18 19:04:49.000000000 -0600 +@@ -142,7 +142,7 @@ + if ( !faze ) + return TT_Err_Invalid_Face_Handle; + +- error = TT_Extension_Get( faze, GDEF_ID, (void**)&gdef ); ++ error = TT_Extension_Get( faze, GDEF_ID, (void**)(void*)&gdef ); + if ( error ) + return error; + +diff -Naurp freetype-orig/lib/extend/ftxgpos.c freetype/lib/extend/ftxgpos.c +--- freetype-orig/lib/extend/ftxgpos.c 2002-09-26 02:40:00.000000000 -0600 ++++ freetype/lib/extend/ftxgpos.c 2008-03-18 19:04:49.000000000 -0600 +@@ -184,7 +184,7 @@ + if ( !faze ) + return TT_Err_Invalid_Face_Handle; + +- error = TT_Extension_Get( faze, GPOS_ID, (void**)&gpos ); ++ error = TT_Extension_Get( faze, GPOS_ID, (void**)(void*)&gpos ); + if ( error ) + return error; + +@@ -283,7 +283,7 @@ + + /* copy the class definition pointer into the extension structure */ + +- error = TT_Extension_Get( faze, GDEF_ID, (void**)&gdef_reg ); ++ error = TT_Extension_Get( faze, GDEF_ID, (void**)(void*)&gdef_reg ); + if ( error ) + return error; + +diff -Naurp freetype-orig/lib/extend/ftxgsub.c freetype/lib/extend/ftxgsub.c +--- freetype-orig/lib/extend/ftxgsub.c 2002-09-26 02:40:00.000000000 -0600 ++++ freetype/lib/extend/ftxgsub.c 2008-03-18 19:04:49.000000000 -0600 +@@ -264,7 +264,7 @@ + if ( !faze ) + return TT_Err_Invalid_Face_Handle; + +- error = TT_Extension_Get( faze, GSUB_ID, (void**)&gsub ); ++ error = TT_Extension_Get( faze, GSUB_ID, (void**)(void*)&gsub ); + if ( error ) + return error; + +@@ -363,7 +363,7 @@ + + /* copy the class definition pointer into the extension structure */ + +- error = TT_Extension_Get( faze, GDEF_ID, (void**)&gdef_reg ); ++ error = TT_Extension_Get( faze, GDEF_ID, (void**)(void*)&gdef_reg ); + if ( error ) + return error; + +diff -Naurp freetype-orig/lib/extend/ftxkern.c freetype/lib/extend/ftxkern.c +--- freetype-orig/lib/extend/ftxkern.c 2002-03-14 19:33:53.000000000 -0600 ++++ freetype/lib/extend/ftxkern.c 2008-03-18 19:04:49.000000000 -0600 +@@ -545,7 +545,7 @@ + return TT_Err_Invalid_Face_Handle; + + /* copy directory header */ +- error = TT_Extension_Get( faze, KERNING_ID, (void**)&kerning ); ++ error = TT_Extension_Get( faze, KERNING_ID, (void**)(void*)&kerning ); + if ( !error ) + *directory = *kerning; + +@@ -584,7 +584,7 @@ + if ( !faze ) + return TT_Err_Invalid_Face_Handle; + +- error = TT_Extension_Get( faze, KERNING_ID, (void**)&kern ); ++ error = TT_Extension_Get( faze, KERNING_ID, (void**)(void*)&kern ); + if ( error ) + return error; + +diff -Naurp freetype-orig/lib/extend/ftxpost.c freetype/lib/extend/ftxpost.c +--- freetype-orig/lib/extend/ftxpost.c 2002-07-20 15:24:26.000000000 -0600 ++++ freetype/lib/extend/ftxpost.c 2008-03-18 19:04:49.000000000 -0600 +@@ -404,7 +404,7 @@ + if ( !faze ) + return TT_Err_Invalid_Face_Handle; + +- error = TT_Extension_Get( faze, POST_ID, (void**)&post ); ++ error = TT_Extension_Get( faze, POST_ID, (void**)(void*)&post ); + if ( error ) + return error; + +@@ -494,7 +494,7 @@ + if ( index >= faze->numGlyphs ) + return TT_Err_Invalid_Glyph_Index; + +- error = TT_Extension_Get( faze, POST_ID, (void**)&post ); ++ error = TT_Extension_Get( faze, POST_ID, (void**)(void*)&post ); + if ( error ) + return error; + +diff -Naurp freetype-orig/lib/extend/ftxsbit.c freetype/lib/extend/ftxsbit.c +--- freetype-orig/lib/extend/ftxsbit.c 2002-01-18 18:23:24.000000000 -0600 ++++ freetype/lib/extend/ftxsbit.c 2008-03-18 19:04:49.000000000 -0600 +@@ -1145,7 +1145,7 @@ + TT_Error error; + + +- error = TT_Extension_Get( faze, SBIT_ID, (void**)&eblc ); ++ error = TT_Extension_Get( faze, SBIT_ID, (void**)(void*)&eblc ); + if ( !error ) + { + if ( eblc->version ) +@@ -1200,7 +1200,7 @@ + if ( !strike || !ins || ins->owner != faze ) + return TT_Err_Invalid_Argument; + +- error = TT_Extension_Get( faze, SBIT_ID, (void**)&eblc ); ++ error = TT_Extension_Get( faze, SBIT_ID, (void**)(void*)&eblc ); + if ( error ) + goto Exit; + +diff -Naurp freetype-orig/lib/ttapi.c freetype/lib/ttapi.c +--- freetype-orig/lib/ttapi.c 2002-11-15 03:42:15.000000000 -0600 ++++ freetype/lib/ttapi.c 2008-03-18 19:04:49.000000000 -0600 +@@ -598,7 +598,7 @@ + + for ( n = 0; n <= num; n++ ) + { +- TT_Get_Metrics( (TT_Horizontal_Header*)&_face->verticalHeader, ++ TT_Get_Metrics( (TT_Horizontal_Header*)(void*)&_face->verticalHeader, + firstGlyph + n, &top_bearing, &advance_height ); + + if ( topBearings ) topBearings[n] = top_bearing; +diff -Naurp freetype-orig/lib/ttcache.h freetype/lib/ttcache.h +--- freetype-orig/lib/ttcache.h 2002-03-14 19:33:52.000000000 -0600 ++++ freetype/lib/ttcache.h 2008-03-18 19:04:49.000000000 -0600 +@@ -192,7 +192,7 @@ + Cache_Done( TCache* cache, void* data ); + + #define CACHE_New( _cache, _newobj, _parent ) \ +- Cache_New( (TCache*)_cache, (void**)&_newobj, (void*)_parent ) ++ Cache_New( (TCache*)_cache, (void**)(void*)&_newobj, (void*)_parent ) + + #define CACHE_Done( _cache, _obj ) \ + Cache_Done( (TCache*)_cache, (void*)_obj ) +diff -Naurp freetype-orig/lib/ttgload.c freetype/lib/ttgload.c +--- freetype-orig/lib/ttgload.c 2002-03-14 19:33:52.000000000 -0600 ++++ freetype/lib/ttgload.c 2008-03-18 19:04:49.000000000 -0600 +@@ -1251,7 +1251,7 @@ + /* Don't assume that both the vertical header and vertical */ + /* metrics are present in the same font :-) */ + +- TT_Get_Metrics( (TT_Horizontal_Header*)&face->verticalHeader, ++ TT_Get_Metrics( (TT_Horizontal_Header*)(void*)&face->verticalHeader, + glyph_index, + &top_bearing, + &advance_height ); +diff -Naurp freetype-orig/lib/ttload.c freetype/lib/ttload.c +--- freetype-orig/lib/ttload.c 2003-11-05 15:47:14.000000000 -0600 ++++ freetype/lib/ttload.c 2008-03-18 19:04:49.000000000 -0600 +@@ -533,8 +533,8 @@ + } + + num_longs = face->verticalHeader.number_Of_VMetrics; +- longs = (PLongMetrics*)&face->verticalHeader.long_metrics; +- shorts = (PShortMetrics*)&face->verticalHeader.short_metrics; ++ longs = (PLongMetrics*)(void*)&face->verticalHeader.long_metrics; ++ shorts = (PShortMetrics*)(void*)&face->verticalHeader.short_metrics; + } + else + { +@@ -545,8 +545,8 @@ + } + + num_longs = face->horizontalHeader.number_Of_HMetrics; +- longs = (PLongMetrics*)&face->horizontalHeader.long_metrics; +- shorts = (PShortMetrics*)&face->horizontalHeader.short_metrics; ++ longs = (PLongMetrics*)(void*)&face->horizontalHeader.long_metrics; ++ shorts = (PShortMetrics*)(void*)&face->horizontalHeader.short_metrics; + } + + /* never trust derived values! */ +@@ -647,7 +647,7 @@ + return TT_Err_Ok; + + face->verticalInfo = 1; +- header = (TT_Horizontal_Header*)&face->verticalHeader; ++ header = (TT_Horizontal_Header*)(void*)&face->verticalHeader; + } + else + { +diff -Naurp freetype-orig/lib/ttmemory.h freetype/lib/ttmemory.h +--- freetype-orig/lib/ttmemory.h 2002-03-14 19:33:52.000000000 -0600 ++++ freetype/lib/ttmemory.h 2008-03-18 19:04:49.000000000 -0600 +@@ -54,10 +54,10 @@ + + + #define MEM_Alloc( _pointer_, _size_ ) \ +- TT_Alloc( _size_, (void**)&(_pointer_) ) ++ TT_Alloc( _size_, (void**)(void*)&(_pointer_) ) + + #define MEM_Realloc( _pointer_, _size_ ) \ +- TT_Realloc( _size_, (void**)&(_pointer_) ) ++ TT_Realloc( _size_, (void**)(void*)&(_pointer_) ) + + #define ALLOC( _pointer_, _size_ ) \ + ( ( error = MEM_Alloc( _pointer_, _size_ ) ) != TT_Err_Ok ) +@@ -74,7 +74,7 @@ + (_count_) * sizeof ( _type_ ) ) ) != TT_Err_Ok ) + + #define FREE( _pointer_ ) \ +- TT_Free( (void**)&(_pointer_) ) ++ TT_Free( (void**)(void*)&(_pointer_) ) + + + /* Allocate a block of memory of 'Size' bytes from the heap, and */ +diff -Naurp freetype-orig/lib/ttobjs.c freetype/lib/ttobjs.c +--- freetype-orig/lib/ttobjs.c 2002-03-14 19:33:52.000000000 -0600 ++++ freetype/lib/ttobjs.c 2008-03-18 19:04:49.000000000 -0600 +@@ -550,14 +550,14 @@ + + error = Update_Max( &exec->loadSize, + sizeof ( TSubglyph_Record ), +- (void**)&exec->loadStack, ++ (void**)(void*)&exec->loadStack, + face->maxComponents + 1 ); + if ( error ) + return error; + + error = Update_Max( &exec->stackSize, + sizeof ( TT_F26Dot6 ), +- (void**)&exec->stack, ++ (void**)(void*)&exec->stack, + maxp->maxStackElements + 32 ); + /* XXX : We reserve a little more elements on the stack to deal safely */ + /* with broken fonts like arialbs, courbs, timesbs... */ +@@ -566,7 +566,7 @@ + + error = Update_Max( &exec->glyphSize, + sizeof ( Byte ), +- (void**)&exec->glyphIns, ++ (void**)(void*)&exec->glyphIns, + maxp->maxSizeOfInstructions ); + if ( error ) + return error; diff --git a/media-libs/freetype/files/freetype-1.4_pre-ttf2pk-tetex-3.patch b/media-libs/freetype/files/freetype-1.4_pre-ttf2pk-tetex-3.patch new file mode 100644 index 000000000000..93efaa308022 --- /dev/null +++ b/media-libs/freetype/files/freetype-1.4_pre-ttf2pk-tetex-3.patch @@ -0,0 +1,445 @@ +http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=344439 + +diff -Naurp freetype-orig/freetype1-contrib/ttf2pk/filesrch.c freetype/freetype1-contrib/ttf2pk/filesrch.c +--- freetype-orig/freetype1-contrib/ttf2pk/filesrch.c 2002-01-08 06:48:27.000000000 -0600 ++++ freetype/freetype1-contrib/ttf2pk/filesrch.c 2008-03-17 19:19:41.000000000 -0600 +@@ -96,7 +96,7 @@ TeX_search_encoding_file(char **name) + return kpse_find_file(*name, kpse_tex_ps_header_format, True); + #endif + #else +- return kpse_find_file(*name, kpse_program_text_format, True); ++ return kpse_find_file(*name, kpse_enc_format, True); + #endif + } + +@@ -113,7 +113,7 @@ TeX_search_replacement_file(char **name) + return kpse_find_file(*name, kpse_tex_ps_header_format, True); + #endif + #else +- return kpse_find_file(*name, kpse_program_text_format, True); ++ return kpse_find_file(*name, kpse_sfd_format, True); + #endif + } + +@@ -147,7 +147,7 @@ TeX_search_map_file(char **name) + return kpse_find_file(*name, kpse_tex_ps_header_format, True); + #endif + #else +- return kpse_find_file(*name, kpse_program_text_format, True); ++ return kpse_find_file(*name, kpse_fontmap_format, True); + #endif + } + +@@ -197,9 +197,11 @@ TeX_search_ttf_file(char **name) + + #else /* OLD_KPATHSEA */ + +- /* no extra extension handling necessary */ +- +- return kpse_find_file(*name, kpse_truetype_format, True); ++ char* real_name; ++ real_name= kpse_find_file(*name, kpse_truetype_format, True); ++ if (!real_name) ++ real_name= kpse_find_file(*name, kpse_program_binary_format, True); ++ return real_name; + + #endif + } +diff -Naurp freetype-orig/freetype1-contrib/ttf2pk/newobj.c freetype/freetype1-contrib/ttf2pk/newobj.c +--- freetype-orig/freetype1-contrib/ttf2pk/newobj.c 2002-06-20 11:34:37.000000000 -0600 ++++ freetype/freetype1-contrib/ttf2pk/newobj.c 2008-03-17 19:29:06.000000000 -0600 +@@ -202,6 +202,8 @@ newchar(Font *fnt) + ti->dptr = 0; + ti->iptr = 0; + ++ ti->fntnum = -1; ++ + fnt->charlist = ti; + + return ti; +@@ -313,6 +315,10 @@ init_font_structure(Font *fnt) + fnt->codingscheme = default_codingscheme; + fnt->titlebuf = NULL; + ++ fnt->cksum = 0; ++ fnt->subfont_num = 0; ++ fnt->subfont_list = NULL; ++ + fnt->units_per_em = 0; + fnt->italicangle = 0.0; + fnt->fixedpitch = 0; +diff -Naurp freetype-orig/freetype1-contrib/ttf2pk/subfont.c freetype/freetype1-contrib/ttf2pk/subfont.c +--- freetype-orig/freetype1-contrib/ttf2pk/subfont.c 2002-03-14 19:33:52.000000000 -0600 ++++ freetype/freetype1-contrib/ttf2pk/subfont.c 2008-03-17 19:29:06.000000000 -0600 +@@ -35,7 +35,7 @@ static realsubfont *real_sfd_name = NULL + static realsubfont * + really_init_sfd(char *name, Boolean fatal); + static Boolean +-really_get_sfd(Font *fnt, Boolean next, realsubfont *rsf); ++really_get_sfd(Font *fnt, Boolean next, realsubfont *rsf, Boolean new_sfd); + static void + really_close_sfd(realsubfont *real_name); + +@@ -163,14 +163,14 @@ really_init_sfd(char *name, Boolean fata + Boolean get_sfd(Font *fnt, Boolean is_sfd) + { + if (is_sfd) +- return really_get_sfd(fnt, False, real_sfd_name); ++ return really_get_sfd(fnt, False, real_sfd_name, True); + else +- return really_get_sfd(fnt, False, real_lig_name); ++ return really_get_sfd(fnt, False, real_lig_name, False); + } + + + static Boolean +-really_get_sfd(Font *fnt, Boolean next, realsubfont *rsf) ++really_get_sfd(Font *fnt, Boolean next, realsubfont *rsf, Boolean new_sfd) + { + long i, offset; + long begin, end = -1; +@@ -229,7 +229,7 @@ again: + if (*bufp == '\0') + oops("Invalid subfont entry in `%s'.", rsf->name); + +- if (next) ++ if (next || !new_sfd) + { + if (strcmp(fnt->subfont_name, buffer)) + goto again; +@@ -309,7 +309,7 @@ again: + + if (!next) + while ((rsf = rsf->next)) +- (void)really_get_sfd(fnt, True, rsf); ++ (void)really_get_sfd(fnt, True, rsf, new_sfd); + + return True; + } +diff -Naurp freetype-orig/freetype1-contrib/ttf2pk/tfmaux.c freetype/freetype1-contrib/ttf2pk/tfmaux.c +--- freetype-orig/freetype1-contrib/ttf2pk/tfmaux.c 2002-01-08 06:48:27.000000000 -0600 ++++ freetype/freetype1-contrib/ttf2pk/tfmaux.c 2008-03-17 19:29:06.000000000 -0600 +@@ -283,7 +283,6 @@ buildtfm(Font *fnt) + register int i, j; + register ttfinfo *ti; + int byte1, old_byte1, byte2; +- long cksum; + double Slant; + char buffer[256]; + struct sf sf_array[256]; +@@ -366,8 +365,8 @@ buildtfm(Font *fnt) + } + + header = (long *)mymalloc(40000L); +- cksum = checksum(fnt->inencptrs); +- header[0] = cksum; ++ fnt->cksum = checksum(fnt->inencptrs); ++ header[0] = fnt->cksum; + header[1] = 0xA00000; /* 10pt design size */ + + (void)makebcpl(header + 2, fnt->codingscheme, 39); +@@ -510,7 +509,8 @@ buildtfm(Font *fnt) + old_byte1 = byte1; + nl++; + } +- ligkern[nl - 1] |= 0x80000000L; ++ if (nl > 0) ++ ligkern[nl - 1] |= 0x80000000L; + } + + kerns = ligkern + nl; +diff -Naurp freetype-orig/freetype1-contrib/ttf2pk/ttf2tfm.c freetype/freetype1-contrib/ttf2pk/ttf2tfm.c +--- freetype-orig/freetype1-contrib/ttf2pk/ttf2tfm.c 2002-06-20 11:34:37.000000000 -0600 ++++ freetype/freetype1-contrib/ttf2pk/ttf2tfm.c 2008-03-17 19:29:06.000000000 -0600 +@@ -235,6 +235,37 @@ end: + } + + ++#define MAX_SFLIST 10 ++static void ++add_subfont_list(Font *fnt) ++{ ++ if (fnt->subfont_list == NULL) ++ fnt->subfont_list = (sflist *)mymalloc(MAX_SFLIST * sizeof(sflist)); ++ else if (fnt->subfont_num % MAX_SFLIST == 0) ++ fnt->subfont_list = (sflist *)myrealloc(fnt->subfont_list, ++ (fnt->subfont_num / MAX_SFLIST + 1) * MAX_SFLIST * sizeof(sflist)); ++ ++ (fnt->subfont_list[fnt->subfont_num]).name = ++ (char *)mymalloc(strlen(fnt->fullname)+1); ++ strcpy((fnt->subfont_list[fnt->subfont_num]).name, fnt->fullname); ++ (fnt->subfont_list[fnt->subfont_num]).cksum = fnt->cksum; ++ ++ fnt->subfont_num++; ++} ++ ++ ++static void ++release_subfont_list(Font *fnt) ++{ ++ register int i; ++ ++ for (i = 0; i < fnt->subfont_num; i++) ++ free((fnt->subfont_list[i]).name); ++ ++ free(fnt->subfont_list); ++} ++ ++ + #define VERSION "\ + Copyright (C) 1997-1999, 2000, 2002 Frederic Loyer and Werner Lemberg.\n\ + There is NO warranty. You may redistribute this software\n\ +@@ -251,6 +282,7 @@ and the FreeType project from\n\ + David Turner, Robert Wilhelm, and Werner Lemberg.\n\ + " + ++ + static void + version(void) + { +@@ -272,6 +304,7 @@ version(void) + -L LIGFILE[.sfd] create 1st/2nd byte ligatures in subfonts using LIGFILE\n\ + -n use PS names of TrueType font\n\ + -N use only PS names and no cmap\n\ ++-o FILE[.ovp] make an OVP file for conversion to OVF and OFM\n\ + -O use octal for all character codes in the vpl file\n\ + -p ENCFILE[.enc] read ENCFILE for the TTF->raw TeX mapping\n\ + -P INT select INT as the TTF platform ID [3]\n\ +@@ -528,6 +561,15 @@ handle_options(int argc, char *argv[], F + arginc = 1; + break; + ++ case 'o': ++ if (argc <= 3) ++ oops("Missing parameter for -o option."); ++ if (vpl_name) ++ free(vpl_name); ++ vpl_name = newstring(argv[3]); ++ handle_extension(&vpl_name, ".ovp"); ++ break; ++ + default: + if (argc <= 3 || argv[3][0] == '-') + { +@@ -664,6 +706,9 @@ handle_options(int argc, char *argv[], F + warning("Ignoring `-v' and `-V' switches for subfonts."); + makevpl = 0; + } ++ if (vpl_name) ++ if ((fnt->vplout = fopen(vpl_name, "wt")) == NULL) ++ oops("Cannot open ovp output file."); + if (have_capheight) + warning("Ignoring `-c' switch for subfonts."); + if (fnt->inencname || fnt->outencname) +@@ -890,10 +935,19 @@ main(int argc, char *argv[]) + writetfm(&font); + if (font.write_enc) + writeenc(&font); ++ if (font.vplout) ++ add_subfont_list(&font); + } + } + + close_sfd(); ++ ++ if (font.vplout) ++ { ++ writeovp(&font); ++ fclose(font.vplout); ++ release_subfont_list(&font); ++ } + } + else + { +diff -Naurp freetype-orig/freetype1-contrib/ttf2pk/ttf2tfm.h freetype/freetype1-contrib/ttf2pk/ttf2tfm.h +--- freetype-orig/freetype1-contrib/ttf2pk/ttf2tfm.h 2002-01-08 06:48:27.000000000 -0600 ++++ freetype/freetype1-contrib/ttf2pk/ttf2tfm.h 2008-03-17 19:29:06.000000000 -0600 +@@ -54,7 +54,8 @@ struct _pcc; + typedef struct _pcc pcc; + struct _stringlist; + typedef struct _stringlist stringlist; +- ++struct _sflist; ++typedef struct _sflist sflist; + + + struct _ttfinfo +@@ -77,6 +78,8 @@ struct _ttfinfo + pcc *pccs; /* we use the composite feature for */ + /* `germandbls' <--> `SS' only */ + unsigned char wptr, hptr, dptr, iptr; ++ ++ short fntnum; + }; + + +@@ -120,6 +123,13 @@ struct _stringlist + }; + + ++struct _sflist ++{ ++ char *name; ++ long cksum; ++}; ++ ++ + struct _Font + { + char *ttfname; +@@ -187,6 +197,11 @@ struct _Font + char *codingscheme; /* coding scheme for TeX */ + char *titlebuf; + ++ long cksum; ++ ++ short subfont_num; ++ sflist *subfont_list; ++ + /* + * The name of the subfont definition file. + */ +diff -Naurp freetype-orig/freetype1-contrib/ttf2pk/ttfaux.c freetype/freetype1-contrib/ttf2pk/ttfaux.c +--- freetype-orig/freetype1-contrib/ttf2pk/ttfaux.c 2003-11-05 06:19:02.000000000 -0600 ++++ freetype/freetype1-contrib/ttf2pk/ttfaux.c 2008-03-17 19:29:06.000000000 -0600 +@@ -562,6 +562,8 @@ readttf(Font *fnt, Boolean quiet, Boolea + ti->urx = bbox.xMax * 1000 / fnt->units_per_em; + ti->ury = bbox.yMax * 1000 / fnt->units_per_em; + ++ ti->fntnum = fnt->subfont_num; ++ + /* + * We must now shift the rotated character both horizontally + * and vertically. The vertical amount is 25% by default. +diff -Naurp freetype-orig/freetype1-contrib/ttf2pk/vplaux.c freetype/freetype1-contrib/ttf2pk/vplaux.c +--- freetype-orig/freetype1-contrib/ttf2pk/vplaux.c 2002-11-15 03:41:24.000000000 -0600 ++++ freetype/freetype1-contrib/ttf2pk/vplaux.c 2008-03-17 19:29:06.000000000 -0600 +@@ -568,4 +568,117 @@ writevpl(Font *fnt, char makevpl, Boolea + } + + ++void ++writeovp(Font *fnt) ++{ ++ register int i; ++ register ttfinfo *ti; ++ long bc, ec; ++ char header[256]; ++ float Slant; ++ ttfinfo *ofm_array[65536]; ++ ++ ++ out = fnt->vplout; ++ ++ header[0] = '\0'; ++ strncat(header, "Created by `", 12); ++ strncat(header, fnt->titlebuf, 255 - 12 - 1); ++ strncat(header, "'", 1); ++ ++ voutln2("(VTITLE %s)", header); ++ voutln("(COMMENT Please change VTITLE if you edit this file)"); ++ ++ voutln("(OFMLEVEL H 1)"); ++ voutln("(FONTDIR TL)"); ++ voutln2("(FAMILY %s)", fnt->outname); ++ voutln("(FACE F MRR)"); ++ voutln("(CODINGSCHEME UNSPECIFIED)"); ++ voutln("(DESIGNSIZE R 10.0)"); ++ voutln("(DESIGNUNITS R 1000)"); ++ voutln("(COMMENT DESIGNSIZE (1 em) IS IN POINTS)"); ++ voutln("(COMMENT OTHER DIMENSIONS ARE MULTIPLES OF DESIGNSIZE/1000)"); ++ ++#if 0 ++ /* Let vptovf compute the checksum. */ ++ voutln2("(CHECKSUM O %lo)", cksum ^ 0xFFFFFFFF); ++#endif ++ ++ vleft(&level); ++ voutln("FONTDIMEN"); ++ ++ Slant = fnt->slant - fnt->efactor * tan(fnt->italicangle * (PI / 180.0)); ++ ++ if (Slant) ++ voutln2("(SLANT R %f)", Slant); ++ voutln2("(SPACE D %d)", fnt->fontspace); ++ if (!fnt->fixedpitch) ++ { ++ voutln2("(STRETCH D %d)", transform(200, 0, fnt->efactor, fnt->slant)); ++ voutln2("(SHRINK D %d)", transform(100, 0, fnt->efactor, fnt->slant)); ++ } ++ voutln2("(XHEIGHT D %d)", fnt->xheight); ++ voutln2("(QUAD D %d)", transform(1000, 0, fnt->efactor, fnt->slant)); ++ voutln2("(EXTRASPACE D %d)", ++ fnt->fixedpitch ? fnt->fontspace : ++ transform(111, 0, fnt->efactor, fnt->slant)); ++ vright(&level); ++ ++ for (i = 0; i < fnt->subfont_num; i++) ++ { ++ vleft(&level); ++ voutln2("MAPFONT D %d", i); ++ voutln2("(FONTNAME %s)", (fnt->subfont_list[i]).name); ++ voutln2("(FONTCHECKSUM O %lo)", (fnt->subfont_list[i]).cksum); ++ vright(&level); ++ } ++ ++ for (i = 0; i <= 0xFFFF; i++) ++ ofm_array[i] = NULL; ++ ++ for (ti = fnt->charlist; ti != NULL; ti = ti->next) ++ if (ti->charcode >= 0 && ti->charcode <= 0xFFFF) ++ ofm_array[ti->charcode] = ti; ++ ++ for (i = 0; i <= 0xFFFF && ofm_array[i] == NULL; i++) ++ ; ++ bc = i; ++ for (i = 0xFFFF; i >= 0 && ofm_array[i] == NULL; i--) ++ ; ++ ec = i; ++ ++ if (ec < bc) ++ oops("No TTF characters."); ++ ++ for (i = bc; i <= ec; i++) ++ { ++ if ((ti = ofm_array[i]) == NULL) continue; ++ ++ vleft(&level); ++ fprintf(out, "CHARACTER H %X\n ", ti->charcode); ++ ++ voutln2("(CHARWD R %d)", ti->width); ++ if (ti->ury) ++ voutln2("(CHARHT R %d)", ti->ury); ++ if (ti->lly) ++ voutln2("(CHARDP R %d)", -ti->lly); ++ if (ti->urx > ti->width) ++ voutln2("(CHARIC R %d)", ti->urx - ti->width); ++ ++ vleft(&level); ++ voutln("MAP"); ++ if (ti->fntnum) ++ voutln2("(SELECTFONT D %d)", ti->fntnum); ++ ++ voutln2("(SETCHAR H %X)", (unsigned)ti->incode); ++ vright(&level); ++ ++ vright(&level); ++ } ++ ++ if (level) ++ oops("I forgot to match the parentheses."); ++} ++ ++ + /* end */ +diff -Naurp freetype-orig/freetype1-contrib/ttf2pk/vplaux.h freetype/freetype1-contrib/ttf2pk/vplaux.h +--- freetype-orig/freetype1-contrib/ttf2pk/vplaux.h 2002-01-08 06:48:27.000000000 -0600 ++++ freetype/freetype1-contrib/ttf2pk/vplaux.h 2008-03-17 19:29:06.000000000 -0600 +@@ -16,6 +16,7 @@ + + void writevpl(Font *fnt, char makevpl, Boolean forceoctal); + void upmap(Font *fnt); ++void writeovp(Font *fnt); + + #endif /* VPLAUX_H */ + diff --git a/media-libs/freetype/files/freetype-1.4_pre-ttf2tfm-segfault.patch b/media-libs/freetype/files/freetype-1.4_pre-ttf2tfm-segfault.patch new file mode 100644 index 000000000000..8f98ebca2b74 --- /dev/null +++ b/media-libs/freetype/files/freetype-1.4_pre-ttf2tfm-segfault.patch @@ -0,0 +1,15 @@ +https://bugs.gentoo.org/show_bug.cgi?id=209303 +http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=395341 + +diff -Naurp freetype-orig/freetype1-contrib/ttf2pk/ttfaux.c freetype/freetype1-contrib/ttf2pk/ttfaux.c +--- freetype-orig/freetype1-contrib/ttf2pk/ttfaux.c 2008-03-18 18:19:30.000000000 -0600 ++++ freetype/freetype1-contrib/ttf2pk/ttfaux.c 2008-03-18 18:33:22.000000000 -0600 +@@ -135,7 +135,7 @@ readttf(Font *fnt, Boolean quiet, Boolea + static Boolean initialized = False; + + TT_UShort in_string[2]; +- TTO_GSUB_String in, out; ++ static TTO_GSUB_String in, out; + + TT_UShort script_index, language_index, feature_index; + TT_UShort req_feature_index = 0xFFFF; diff --git a/media-libs/freetype/freetype-1.4_pre20080316.ebuild b/media-libs/freetype/freetype-1.4_pre20080316.ebuild new file mode 100644 index 000000000000..df2fbfde5e99 --- /dev/null +++ b/media-libs/freetype/freetype-1.4_pre20080316.ebuild @@ -0,0 +1,114 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/media-libs/freetype/freetype-1.4_pre20080316.ebuild,v 1.1 2008/03/20 04:18:28 dirtyepic Exp $ + +WANT_AUTOCONF="2.1" + +inherit autotools eutils libtool multilib + +DESCRIPTION="Freetype font rendering engine" +HOMEPAGE="http://www.freetype.org/" +SRC_URI="mirror://gentoo/${P}.tar.bz2" + +LICENSE="FTL" +SLOT="1" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd" +IUSE="doc nls kpathsea" + +DEPEND="kpathsea? ( virtual/tex-base ) + >=sys-devel/autoconf-2.59" # for contrib +RDEPEND="${DEPEND} + nls? ( sys-devel/gettext )" + +S="${WORKDIR}"/${PN} + +src_unpack() { + unpack ${A} + cd "${S}" + + # remove unneeded include for BSD (#104016) + epatch "${FILESDIR}"/freetype-1.4_pre-malloc.patch + + # fix ttf2pk to work with tetex 3.0 + epatch "${FILESDIR}"/freetype-1.4_pre-ttf2pk-tetex-3.patch + + # fix segfault due to undefined behaviour of non-static structs + epatch "${FILESDIR}"/freetype-1.4_pre-ttf2tfm-segfault.patch + + # silence strict-aliasing warnings + epatch "${FILESDIR}"/freetype-1.4_pre-silence-strict-aliasing.patch + + # add DESTDIR support to contrib Makefiles + epatch "${FILESDIR}"/freetype-1.4_pre-contrib-destdir.patch + + # disable tests (they don't compile) + sed -i -e "/^all:/ s:tttest ::" Makefile.in + + eautoreconf + elibtoolize + + # contrib isn't compatible with autoconf-2.13 + unset WANT_AUTOCONF + + for x in ttf2bdf ttf2pfb ttf2pk ttfbanner; do + cd "${S}"/freetype1-contrib/${x} + eautoconf + done +} + +src_compile() { + use kpathsea && kpathseaconf="--with-kpathsea-lib=/usr/$(get_libdir) --with-kpathsea-include=/usr/include" + + # core + einfo "Building core library..." + econf $(use_enable nls) || die "econf failed" + emake || die "emake failed" + + # contrib + cd "${S}"/freetype1-contrib/ttf2pk + einfo "Building ttf2pk..." + econf ${kpathseaconf} || die "econf ttf2pk failed" + emake || "emake ttf2pk failed" + for x in ttf2bdf ttf2pfb ttfbanner; do + cd "${S}"/freetype1-contrib/${x} + einfo "Building ${x}..." + econf || die "econf ${x} failed" + emake || die "emake ${x} failed" + done +} + +src_install() { + dodoc announce PATENTS README docs/*.txt docs/FAQ + use doc && dohtml -r docs + + # core + # Seems to require a shared libintl (getetxt comes only with a static one + # But it seems to work without problems + einfo "Installing core library..." + cd "${S}"/lib + emake -f arch/unix/Makefile \ + prefix="${D}"/usr libdir="${D}"/usr/$(get_libdir) install \ + || die "lib install failed" + + # install po files + einfo "Installing po files..." + cd "${S}"/po + emake prefix="${D}"/usr libdir="${D}"/usr/$(get_libdir) install \ + || die "po install failed" + + # contrib (DESTDIR now works here) + einfo "Installing contrib..." + for x in ttf2bdf ttf2pfb ttf2pk ttfbanner; do + cd "${S}"/freetype1-contrib/${x} + emake DESTDIR="${D}" install || die "${x} install failed" + done + + # tex stuff + if use kpathsea; then + cd "${S}"/freetype1-contrib + insinto /usr/share/texmf/ttf2pk + doins ttf2pk/data/* || die "kpathsea ttf2pk install failed" + insinto /usr/share/texmf/ttf2pfb + doins ttf2pfb/Uni-T1.enc || die "kpathsea ttf2pfb install failed" + fi +} |