upgrade pre-built libraries for Windows and Mac OS X

Mostly upgrades the drawing stack to the latest Cairo, Pango, Glib,
etc., but also upgrades the OpenSSL library on Windows to 1.0.1g.

The new "racket/src/native-libs" directory provides scripts to
rebuild the libraries from source. Those script are fragile, because
library sources and configuration scripts are fragile. The
scripts at least archive some expertise/advice in a mostly executable
form.
This commit is contained in:
Matthew Flatt 2014-03-30 15:13:57 -06:00
parent fb34d4e76e
commit 23cf3ba11e
33 changed files with 1392 additions and 596 deletions

View File

@ -45,17 +45,19 @@ cpus-in-place:
# Explicitly propagate variables for non-GNU `make's:
PKG_LINK_COPY_ARGS = PKGS="$(PKGS)" LINK_MODE="$(LINK_MODE)"
LIBSETUP = -N raco -l- raco setup
plain-in-place:
$(MAKE) base
if $(MACOSX_CHECK) ; then $(MAKE) native-from-git ; fi
$(MAKE) pkg-links $(PKG_LINK_COPY_ARGS)
$(PLAIN_RACKET) -N raco -l- raco setup $(JOB_OPTIONS) $(PLT_SETUP_OPTIONS)
$(PLAIN_RACKET) $(LIBSETUP) $(JOB_OPTIONS) $(PLT_SETUP_OPTIONS)
win32-in-place:
$(MAKE) win32-base
$(MAKE) win32-pkg-links $(PKG_LINK_COPY_ARGS)
$(WIN32_PLAIN_RACKET) -N raco -l- raco setup $(JOB_OPTIONS) $(PLT_SETUP_OPTIONS)
$(WIN32_PLAIN_RACKET) $(LIBSETUP) -nxiID $(JOB_OPTIONS) $(PLT_SETUP_OPTIONS) racket
$(WIN32_PLAIN_RACKET) $(LIBSETUP) $(JOB_OPTIONS) $(PLT_SETUP_OPTIONS)
again:
$(MAKE) LINK_MODE="--restore"
@ -86,10 +88,19 @@ base:
cd racket/src/build; $(MAKE) install $(SELF_FLAGS_qq) PLT_SETUP_OPTIONS="$(JOB_OPTIONS) $(PLT_SETUP_OPTIONS)"
win32-base:
$(MAKE) win32-remove-setup-dlls
IF NOT EXIST build\config cmd /c mkdir build\config
cmd /c echo #hash((links-search-files . ())) > build\config\config.rktd
cmd /c racket\src\worksp\build-at racket\src\worksp ..\..\..\build\config $(JOB_OPTIONS) $(PLT_SETUP_OPTIONS)
# Start by removing DLLs that may be loaded by `raco setup`
win32-remove-setup-dlls:
IF EXIST racket\lib\longdouble.dll cmd /c del racket\lib\longdouble.dll
IF EXIST racket\lib\libiconv-2.dll cmd /c del racket\lib\libiconv-2.dll
IF EXIST racket\lib\iconv.dll cmd /c del racket\lib\iconv.dll
IF EXIST racket\lib\libeay32.dll cmd /c del racket\lib\libeay32.dll
IF EXIST racket\lib\ssleay32.dll cmd /c del racket\lib\ssleay32.dll
racket/src/build/Makefile: racket/src/configure racket/src/Makefile.in
cd racket/src/build; ../configure $(CONFIGURE_ARGS_qq)
@ -420,7 +431,6 @@ client:
$(MAKE) installer-from-bundle $(COPY_ARGS)
win32-client:
IF EXIST build\user cmd /c rmdir /S /Q build\user
$(MAKE) win32-base $(COPY_ARGS)
$(MAKE) win32-distro-build-from-server $(COPY_ARGS)
$(MAKE) win32-bundle-from-server $(COPY_ARGS)

@ -1 +1 @@
Subproject commit b698e73c35c0a211cad85646da2b36d1184cec6b
Subproject commit 53cdd395b6ab011f85bcf8c8f45032656e727013

View File

@ -4,11 +4,11 @@
(define deps
'("base"
("draw-i386-macosx" #:platform "i386-macosx")
("draw-x86_64-macosx" #:platform "x86_64-macosx")
("draw-ppc-macosx" #:platform "ppc-macosx")
("draw-win32-i386" #:platform "win32\\i386")
("draw-win32-x86_64" #:platform "win32\\x86_64")))
("draw-i386-macosx-2" #:platform "i386-macosx")
("draw-x86_64-macosx-2" #:platform "x86_64-macosx")
("draw-ppc-macosx-2" #:platform "ppc-macosx")
("draw-win32-i386-2" #:platform "win32\\i386")
("draw-win32-x86_64-2" #:platform "win32\\x86_64")))
(define pkg-desc "implementation (no documentation) part of \"draw\"")

View File

@ -9,22 +9,16 @@
[(unix) (ffi-lib "libcairo" '("2" ""))]
[(macosx)
(ffi-lib "libpixman-1.0.dylib")
(ffi-lib "libpng15.15.dylib")
(ffi-lib "libpng16.16.dylib")
(ffi-lib "libcairo.2.dylib")]
[(win32)
(ffi-lib "zlib1.dll")
(ffi-lib "libpng14-14.dll")
(ffi-lib "libexpat-1.dll")
(ffi-lib "freetype6.dll")
(ffi-lib "libfontconfig-1.dll")
(ffi-lib "libcairo-2.dll")]
[(win64)
[(windows)
(ffi-lib "zlib1.dll")
(ffi-lib "libintl-8.dll")
(ffi-lib "libpng14-14.dll")
(ffi-lib "libpng16-16.dll")
(ffi-lib "libexpat-1.dll")
(ffi-lib "libfreetype-6.dll")
(ffi-lib "libfontconfig-1.dll")
(ffi-lib "libpixman-1-0.dll")
(ffi-lib "libcairo-2.dll")])
(provide (protect-out cairo-lib))

View File

@ -13,8 +13,8 @@
[(macosx)
(ffi-lib "libintl.8.dylib")
(ffi-lib "libglib-2.0.0.dylib")]
[(win32) (ffi-lib "libglib-2.0-0.dll")]
[(win64)
[(windows)
(ffi-lib "libiconv-2.dll")
(ffi-lib "libintl-8.dll")
(ffi-lib "libglib-2.0-0.dll")])
@ -23,18 +23,18 @@
[(macosx)
(ffi-lib "libgthread-2.0.0.dylib")
(ffi-lib "libgmodule-2.0.0.dylib")]
[(win32)
(ffi-lib "libgmodule-2.0-0.dll")]
[(win64)
[(windows)
(ffi-lib "libgthread-2.0-0.dll")
(ffi-lib "libgmodule-2.0-0.dll")])
(define-runtime-lib gobj-lib
[(unix) (ffi-lib "libgobject-2.0" '("0" ""))]
[(macosx)
(ffi-lib "libffi.5.dylib")
(ffi-lib "libffi.6.dylib")
(ffi-lib "libgobject-2.0.0.dylib")]
[(windows) (ffi-lib "libgobject-2.0-0.dll")])
[(windows)
(ffi-lib "libffi-6.dll")
(ffi-lib "libgobject-2.0-0.dll")])
(define-ffi-definer define-glib glib-lib)
(define-ffi-definer define-gmodule gmodule-lib)

View File

@ -8,11 +8,8 @@
(define-runtime-lib jpeg-lib
[(unix) (ffi-lib "libjpeg" '("62" "8" "9" ""))]
[(macosx)
;; for PPC, it's actually version 8!
(ffi-lib "libjpeg.62.dylib")]
[(win32) (ffi-lib "libjpeg-7.dll")]
[(win64) (ffi-lib "libjpeg-8.dll")])
[(macosx) (ffi-lib "libjpeg.9.dylib")]
[(windows) (ffi-lib "libjpeg-9.dll")])
(define-ffi-definer define-jpeg jpeg-lib
#:provide provide)
@ -26,10 +23,8 @@
(define _J_DITHER_MODE _int)
(define _J_COLOR_TRANSFORM _int)
(define _jbool (if win64?
(make-ctype _byte
(lambda (v) (if v 1 0))
(lambda (v) (not (zero? v))))
(define _jbool (if (eq? (system-type) 'windows)
_stdbool
_bool))
(define-enum
0

View File

@ -22,19 +22,13 @@
[(unix) (ffi-lib "libpangocairo-1.0" '("0" ""))]
[(macosx)
(ffi-lib "libpangocairo-1.0.0.dylib")]
[(win32)
(ffi-lib "libpangowin32-1.0-0.dll")
(ffi-lib "libexpat-1.dll")
(ffi-lib "freetype6.dll")
(ffi-lib "libfontconfig-1.dll")
(ffi-lib "libpangoft2-1.0-0.dll")
(ffi-lib "libpangocairo-1.0-0.dll")]
[(win64)
[(windows)
(ffi-lib "libintl-8.dll")
(ffi-lib "libpangowin32-1.0-0.dll")
(ffi-lib "libexpat-1.dll")
(ffi-lib "libfreetype-6.dll")
(ffi-lib "libfontconfig-1.dll")
(ffi-lib "libharfbuzz-0.dll")
(ffi-lib "libpangoft2-1.0-0.dll")
(ffi-lib "libpangocairo-1.0-0.dll")])

View File

@ -18,10 +18,10 @@
[else (apply ffi-lib (car alts)
#:fail (lambda ()
(loop (cdr alts))))]))]
[(macosx) (ffi-lib "libpng15.15.dylib")]
[(macosx) (ffi-lib "libpng16.16.dylib")]
[(windows)
(ffi-lib "zlib1.dll")
(ffi-lib "libpng14-14.dll")])
(ffi-lib "libpng16-16.dll")])
(define-ffi-definer define-png png-lib
#:provide provide)

View File

@ -204,6 +204,13 @@
(cairo_matrix_t-y0 m)))
(cairo_surface_flush s)
(define cg (cairo_quartz_surface_get_cg_context s))
(begin
;; A Cairo flush doesn't reset the clipping region. The
;; implementation of clipping is that there's a saved
;; GState that we can use to get back to the original
;; clipping region, so restore (and save again) that state:
(CGContextRestoreGState cg)
(CGContextSaveGState cg))
(CGContextSaveGState cg)
(CGContextConcatCTM cg trans)
(let ([n (cairo_rectangle_list_t-num_rectangles rs)])

View File

@ -262,6 +262,7 @@
(define c-xscale 1)
(define c-yscale 1)
(define c-offset 0)
(define c-rotate 0)
(define c-gray? #f)
(public*
[set-bitmaps (lambda (on?) (set! no-bitmaps? (not on?)) (refresh))]
@ -275,6 +276,7 @@
[set-scale (lambda (xs ys) (set! xscale xs) (set! yscale ys) (refresh))]
[set-offset (lambda (o) (set! offset o) (refresh))]
[set-canvas-offset (lambda (o) (set! c-offset o) (refresh))]
[set-canvas-rotation (lambda (r) (set! c-rotate r) (refresh))]
[set-canvas-gray (lambda (g?) (set! c-gray? g?) (refresh))])
(override*
[on-paint
@ -1042,6 +1044,7 @@
(send can-dc set-brush b)
(send can-dc set-pen p)))
(send can-dc set-origin c-offset c-offset)
(send can-dc set-rotation c-rotate)
(send can-dc set-scale c-xscale c-yscale)
(send can-dc set-alpha current-c-alpha)
(when c-clip
@ -1415,6 +1418,9 @@
(make-object check-box% "Cvs +10" hp3
(lambda (self event)
(send canvas set-canvas-offset (if (send self get-value) 10 0))))
(make-object check-box% "Cvs rot" hp3
(lambda (self event)
(send canvas set-canvas-rotation (if (send self get-value) (* pi -1/5) 0))))
(make-object choice% "Cvs Clip" '("None" "Empty" "Square" "Squares" "Octagon") hp3
(lambda (self event)
(send canvas set-canvas-clip (case (send self get-selection)

View File

@ -3,8 +3,8 @@
(define collection 'multi)
(define deps
'(("racket-win32-i386" #:platform "win32\\i386")
("racket-win32-x86_64" #:platform "win32\\x86_64")
'(("racket-win32-i386-2" #:platform "win32\\i386")
("racket-win32-x86_64-2" #:platform "win32\\x86_64")
("db-ppc-macosx" #:platform "ppc-macosx")
("db-win32-i386" #:platform "win32\\i386")
("db-win32-x86_64" #:platform "win32\\x86_64")

View File

@ -149,9 +149,7 @@
(format template filename-version-part)
(format template "xxxxxxx"))))])
(map copy-dll (list
(if (equal? "win32\\x86_64" (path->string (system-library-subpath #f)))
"libiconv-2.dll"
"iconv.dll")
"libiconv-2.dll"
"longdouble.dll"))
(when (or (memq 'racketcgc types)
(memq 'gracketcgc types))

23
racket/src/configure vendored
View File

@ -1447,6 +1447,7 @@ Optional Features:
--enable-libs install Racket static libraries, if any
--enable-libffi use installed libffi (enabled by default for Unix)
--enable-sdk=<path> use Mac OS X 10.4 SDK directory
--enable-sdk5=<path> use Mac OS X 10.5 SDK directory
--enable-sdk6=<path> use Mac OS X 10.6 SDK directory
--enable-xonx use Unix style (e.g., use Gtk) for Mac OS X
--enable-libfw install Mac OS X frameworks to /Library/Frameworks
@ -2690,6 +2691,11 @@ if test "${enable_sdk+set}" = set; then :
enableval=$enable_sdk;
fi
# Check whether --enable-sdk was given.
if test "${enable_sdk+set}" = set; then :
enableval=$enable_sdk;
fi
# Check whether --enable-xonx was given.
if test "${enable_xonx+set}" = set; then :
enableval=$enable_xonx;
@ -3023,11 +3029,20 @@ show_explicitly_enabled "${enable_libfw}" "Frameworks-to-system"
show_explicitly_enabled "${enable_userfw}" "Frameworks-to-user"
if test "${enable_sdk}" != "" ; then
if test "${enable_sdk5}" != "" ; then
echo "ERROR: cannot specify both --enable-sdk and --enable-sdk5"
fi
if test "${enable_sdk6}" != "" ; then
echo "ERROR: cannot specify both --enable-sdk and --enable-sdk6"
fi
echo "=== Using Mac OS X 10.4 SDK directory ${enable_sdk}"
fi
if test "${enable_sdk5}" != "" ; then
if test "${enable_sdk6}" != "" ; then
echo "ERROR: cannot specify both --enable-sdk5 and --enable-sdk6"
fi
echo "=== Using Mac OS X 10.5 SDK directory ${enable_sdk}"
fi
if test "${enable_sdk6}" != "" ; then
echo "=== Using Mac OS X 10.6 SDK directory ${enable_sdk6}"
fi
@ -4577,6 +4592,14 @@ $as_echo "#define HAVE_STDINT_H 1" >>confdefs.h
fi
fi
if test "${enable_sdk5}" != "" ; then
PREFLAGS="$PREFLAGS -isysroot ${enable_sdk5} -mmacosx-version-min=10.5"
LDFLAGS="$LDFLAGS -isysroot ${enable_sdk5} -mmacosx-version-min=10.5"
SUB_CONFIGURE_EXTRAS="${SUB_CONFIGURE_EXTRAS} CFLAGS="'"'"${CFLAGS}"'"'
SUB_CONFIGURE_EXTRAS="${SUB_CONFIGURE_EXTRAS} CPPFLAGS="'"'"${PREFLAGS}"'"'
SUB_CONFIGURE_EXTRAS="${SUB_CONFIGURE_EXTRAS} LDFLAGS="'"'"${LDFLAGS}"'"'
fi
if test "${enable_sdk6}" != "" ; then
PREFLAGS="$PREFLAGS -isysroot ${enable_sdk6} -mmacosx-version-min=10.6"
LDFLAGS="$LDFLAGS -isysroot ${enable_sdk6} -mmacosx-version-min=10.6"

View File

@ -1,148 +1,39 @@
Information on building 3rd-party libraries needed for Mac OS X GRacket.
See "../native-libs/README.txt" for information about building most
3rd-party native libraries that are needed for Racket libraries
Get these packages (or newer, if compatible):
pkg-config-0.25.tar.gz [PowerPC: pkg-config-0.23.tar.gz]
libpng-1.5.7.tar.gz
pixman-0.24.2.tar.gz [PowerPC: pixman-0.21.6.tar.gz]
cairo-1.10.2.tar.gz
gettext-0.18.1.1.tar.gz [PowerPC: gettext-0.17.tar.gz]
libffi-3.0.10.tar.gz [PowerPC: skip]
glib-2.31.14.tar.gz [PowerPC: glib-2.22.4.tar.gz]
pango-1.29.5.tar.gz [PowerPC: pango-1.28.0.tar.gz]
gmp-5.0.5.tar.gz
mpfr-3.1.1.tar.gz
libjpeg62 (maybe in binary form)
PSMTabBarControl, probably from
https://github.com/dorianj/PSMTabBarControl
[PowerPC: maccode.googlecode.com]
and handled differently; note that the version
at from maccode has a bug on dealloc() and
uses methods that are now deprecated
In addition, the `racket/gui' library uses PSMTabBarControl on Mac OS X.
Download:
https://github.com/dorianj/PSMTabBarControl
or
maccode.googlecode.com [PowerPC]
Note that the version at from maccode has a bug on dealloc() and uses
methods that are now deprecated.
Patches:
cairo/src/cairo-path-fixed.c:1295: [from Cairo repo, 3/18/11]
/* This check is valid because the current implementation of
* _cairo_path_fixed_is_box () only accepts rectangles like:
* move,line,line,line[,line|close[,close|move]]. */
buf = cairo_path_head (path);
if (buf->num_ops > 4)
return TRUE;
glib/glib/gconvert.c:61: comment out #error near
#if defined(USE_LIBICONV_GNU) && !defined (_LIBICONV_H)
pango/pango/modules.c:573: change to
// read_modules ();
pango/modules/basic/basic-atsui.c,
pango/pangocairo-atsuifont.c,
pango/pangoatsui.h,
pango/pangoatsui.c:
apply "atsui.patch" (32-bit only)
pango/modules/basic/basic-coretext.c,
pango/pangocairo-coretextfont.c:
apply "coretext.patch" (64-bit only)
gettext/gettext-tools/gnulib-lib/stpncpy.c:28: may need to comment out
// # define __stpncpy stpncpy
PowerPC: PSMTabBarControl/PSMTabBarControl.m:216: change to
// copy _cells because removing a cell
// can modify the array (which is not allowed)
NSArray *copyOfCells = [NSArray arrayWithArray: _cells];
NSEnumerator *enumerator = [copyOfCells objectEnumerator];
gcc-4.0: gmp/gmp.h:424: __gnu_inline__ => __weak__
Configures (where <dest> is some temporary area):
pkg-config: --prefix=<dest>
libpng: --prefix=<dest>
pixman: --prefix=<dest>
Cairo: PATH=<dest>/bin:... --disable-xlib --disable-ft --disable-fc --prefix=<dest>
gettext: --prefix=<dest>
libffi: --prefix=<dest>
glib: PATH=<dest>/bin:... CFLAGS=-I<dest>/include LDFLAGS=-L<dest>/lib --prefix=<dest>
[PowerPC: after configure, set "allow_undefined_flag" to "" in "libtool";
add "-lresolv" to link command for "libgio"]
Pango: PATH=<dest>/bin:... --without-x --with-included-modules=yes --with-dynamic-modules=no --prefix=<dest>
[PowerPC: same as glib for "libtool"; use PATH for `make', too]
gmp: --prefix=<dest>
mpfr: CFLAGS=-I<dest>/include LDFLAGS=-L<dest>/lib --prefix=<dest>
In XCode:
To support 10.4, add
CC=gcc-4.0
CPPFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4"
LDFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4"
for all packages.
Note: PATH above ensures that pkg-config binaries are used to find
things in <dest> rather than some other area, such as /opt/local.
Be sure to use two-level namespaces for all libraries. While
two-level namespaces are the default on Mac OS X, some packages turn
on flat namespaces, at least on PowerPC. Use `otol -vh' and look for
"TWOLEVEL" in the output to check that a library uses two-level
namespaces.
XCode:
Build PSMTabBarControl. You only need the Framework target, and
in Release mode (which is "Build for Archiving" in Xcode 4.5).
Use `ditto' to reduce the framework to one architecture.
Add back the "LICENSE.txt" file.
Install:
racket install-libs.rkt <dest>/lib
* using `racket' for the target installation
* do not include a trailing slash
* double-check installed libraries to ensure that they do not
have <dest> in their shared-library paths
Also copy "PSMTabBarControl.framework" into the installation's "lib"
directory. You can flatten all the auto-version soft links (moving
"PSMTabBarControl" and "Resources" to immediately inside
"PSMTabBarControl), and you can use `ditto' to prune the binary to
just the platform that you're using.
--------------------------------------------------
# This script isn't right, because the versions are out of date
# and libffi isn't included, but maybe it clarifies some of
# the instructions above
DESTDIR=
WORKDIR=
ARCHDIR=
cd "$WORKDIR"
tar zxf "$ARCHDIR"pkg-config-0.23.tar.gz
tar zxf "$ARCHDIR"libpng-1.4.0.tar.gz
tar zxf "$ARCHDIR"pixman-0.21.6.tar.gz
tar zxf "$ARCHDIR"cairo-1.10.2.tar.gz
tar zxf "$ARCHDIR"gettext-0.17.tar.gz
tar zxf "$ARCHDIR"glib-2.22.4.tar.gz
tar zxf "$ARCHDIR"pango-1.28.0.tar.gz
cd pkg-config-0.23/
./configure --prefix="$DESTDIR"
make
make install
cd ../libpng-1.4.0/
./configure --prefix="$DESTDIR"
make
make install
cd ..
cd pixman-0.21.6/
./configure --prefix="$DESTDIR"
make
make install
cd ../cairo-1.10.2/
env PATH="$DESTDIR"/bin:"$PATH" ./configure --disable-xlib --disable-ft --disable-fc --prefix="$DESTDIR"
make
make install
cd ../gettext-0.17/
./configure --prefix="$DESTDIR"
make
make install
cd ../glib
cd ../glib-2.22.4/
env PATH="$DESTDIR"/bin:"$PATH" CFLAGS=-I"$DESTDIR"/include LDFLAGS=-L"$DESTDIR"/lib ./configure --prefix="$DESTDIR"
make
make install
cd ../pango-1.28.0/
env PATH="$DESTDIR"/bin:"$PATH" ./configure --without-x --with-included-modules=yes --with-dynamic-modules=no --prefix="$DESTDIR"
make
make install
Copy "PSMTabBarControl.framework" into the installation's "lib"
directory or a suitable package-source directory. You can flatten
all the auto-version soft links (moving "PSMTabBarControl" and
"Resources" to immediately inside "PSMTabBarControl), and you can
use `ditto' to prune the binary to just the platform that you're
using.

View File

@ -1,129 +0,0 @@
diff -r -u pango-1.29.5-orig/modules/basic/basic-atsui.c pango-1.29.5/modules/basic/basic-atsui.c
--- pango-1.29.5-orig/modules/basic/basic-atsui.c 2011-08-15 19:11:08.000000000 -0600
+++ pango-1.29.5/modules/basic/basic-atsui.c 2012-05-17 15:06:09.000000000 -0600
@@ -53,10 +53,13 @@
PangoGlyphString *glyphs,
int i,
int offset,
- PangoGlyph glyph)
+ PangoGlyph glyph,
+ ATSUTextLayout text_layout)
{
PangoRectangle logical_rect;
+ if (!glyph) { glyph = PANGO_GET_UNKNOWN_GLYPH(glyph); }
+
glyphs->glyphs[i].glyph = G_UNLIKELY (glyph == kATSDeletedGlyphcode) ?
PANGO_GLYPH_EMPTY : glyph;
@@ -64,9 +67,30 @@
glyphs->glyphs[i].geometry.y_offset = 0;
glyphs->log_clusters[i] = offset;
- pango_font_get_glyph_extents (font, glyphs->glyphs[i].glyph, NULL, &logical_rect);
- glyphs->glyphs[i].geometry.width = logical_rect.width;
-}
+ if (text_layout) {
+ ATSTrapezoid bounds;
+ ItemCount actual;
+ double w;
+
+ ATSUGetGlyphBounds(text_layout,
+ 0, 0,
+ i,
+ 1,
+ kATSUseFractionalOrigins,
+ 1,
+ &bounds,
+ &actual);
+ w = (Fix2X(bounds.upperRight.x) - Fix2X(bounds.upperLeft.x));
+ glyphs->glyphs[i].geometry.width = w * PANGO_SCALE;
+ } else {
+ pango_font_get_glyph_extents (font, glyphs->glyphs[i].glyph, NULL, &logical_rect);
+ glyphs->glyphs[i].geometry.width = logical_rect.width;
+ }
+}
+
+#ifndef DoubleToFixed
+# define DoubleToFixed(a) ((Fixed)((double) (a) * fixed1))
+#endif
static void
basic_engine_shape (PangoEngineShape *engine,
@@ -87,9 +111,10 @@
PangoATSUIFont *afont = PANGO_ATSUI_FONT (font);
ATSUStyle style;
ATSUFontID fontID;
- ATSUAttributeTag styleTags[] = { kATSUFontTag };
- ATSUAttributeValuePtr styleValues[] = { &fontID };
- ByteCount styleSizes[] = { sizeof (ATSUFontID) };
+ Fixed fontSize;
+ ATSUAttributeTag styleTags[] = { kATSUFontTag, kATSUSizeTag };
+ ATSUAttributeValuePtr styleValues[] = { &fontID, &fontSize };
+ ByteCount styleSizes[] = { sizeof (ATSUFontID), sizeof(Fixed) };
utf16 = g_utf8_to_utf16 (text, length, NULL, &n16, NULL);
@@ -101,6 +126,7 @@
err = ATSUCreateStyle(&style);
fontID = pango_atsui_font_get_atsfont (afont);
+ fontSize = DoubleToFixed((double)pango_atsui_font_get_size(afont) / PANGO_SCALE);
err = ATSUSetAttributes(style,
(ItemCount)(sizeof(styleTags) / sizeof(styleTags[0])),
@@ -133,11 +159,11 @@
if (pango_is_zero_width (wc))
{
- set_glyph (font, glyphs, i, p - text, PANGO_GLYPH_EMPTY);
+ set_glyph (font, glyphs, i, p - text, PANGO_GLYPH_EMPTY, NULL);
}
else
{
- set_glyph (font, glyphs, i, p - text, layout_records[i].glyphID);
+ set_glyph (font, glyphs, i, p - text, layout_records[i].glyphID, text_layout);
if (g_unichar_type (wc) == G_UNICODE_NON_SPACING_MARK)
{
diff -r -u pango-1.29.5-orig/pango/pangoatsui.c pango-1.29.5/pango/pangoatsui.c
--- pango-1.29.5-orig/pango/pangoatsui.c 2011-08-15 19:11:08.000000000 -0600
+++ pango-1.29.5/pango/pangoatsui.c 2012-05-17 15:06:23.000000000 -0600
@@ -229,3 +229,10 @@
return priv->font_ref;
}
+
+int pango_atsui_font_get_size (PangoATSUIFont *font)
+{
+ PangoATSUIFontPrivate *priv = font->priv;
+
+ return pango_font_description_get_size(priv->desc);
+}
diff -r -u pango-1.29.5-orig/pango/pangoatsui.h pango-1.29.5/pango/pangoatsui.h
--- pango-1.29.5-orig/pango/pangoatsui.h 2011-08-15 19:11:08.000000000 -0600
+++ pango-1.29.5/pango/pangoatsui.h 2012-05-17 15:06:27.000000000 -0600
@@ -71,6 +71,8 @@
CGFontRef pango_atsui_font_get_cgfont (PangoATSUIFont *font);
ATSFontRef pango_atsui_font_get_atsfont (PangoATSUIFont *font);
+int pango_atsui_font_get_size (PangoATSUIFont *font);
+
#endif /* PANGO_ENABLE_ENGINE || PANGO_ENABLE_BACKEND */
GType pango_atsui_font_get_type (void) G_GNUC_CONST;
diff -r -u pango-1.29.5-orig/pango/pangocairo-atsuifont.c pango-1.29.5/pango/pangocairo-atsuifont.c
--- pango-1.29.5-orig/pango/pangocairo-atsuifont.c 2011-08-15 19:11:08.000000000 -0600
+++ pango-1.29.5/pango/pangocairo-atsuifont.c 2012-02-13 09:33:45.000000000 -0700
@@ -136,6 +136,12 @@
metrics->strikethrough_position = metrics->ascent / 3;
metrics->strikethrough_thickness = ats_metrics.underlineThickness * cafont->size * PANGO_SCALE;
+ metrics->underline_position = -metrics->underline_position;
+ pango_quantize_line_geometry (&metrics->underline_thickness,
+ &metrics->underline_position);
+ metrics->underline_position = -(metrics->underline_position
+ + metrics->underline_thickness);
+
return metrics;
}

View File

@ -1,215 +0,0 @@
diff -r -u pango-1.29.5-orig/modules/basic/basic-coretext.c pango-1.29.5/modules/basic/basic-coretext.c
--- pango-1.29.5-orig/modules/basic/basic-coretext.c 2011-08-15 18:11:08.000000000 -0700
+++ pango-1.29.5/modules/basic/basic-coretext.c 2012-05-17 13:04:39.000000000 -0700
@@ -54,18 +54,26 @@
PangoGlyphString *glyphs,
int i,
int offset,
- PangoGlyph glyph)
+ PangoGlyph glyph,
+ const CGSize *adv)
{
PangoRectangle logical_rect;
+ if (!glyph) { glyph = PANGO_GET_UNKNOWN_GLYPH(glyph); }
+
glyphs->glyphs[i].glyph = glyph;
glyphs->glyphs[i].geometry.x_offset = 0;
glyphs->glyphs[i].geometry.y_offset = 0;
glyphs->log_clusters[i] = offset;
- pango_font_get_glyph_extents (font, glyphs->glyphs[i].glyph, NULL, &logical_rect);
- glyphs->glyphs[i].geometry.width = logical_rect.width;
+ if (adv) {
+ /* by using the advances array, we get kerning */
+ glyphs->glyphs[i].geometry.width = adv->width * PANGO_SCALE;
+ } else {
+ pango_font_get_glyph_extents (font, glyphs->glyphs[i].glyph, NULL, &logical_rect);
+ glyphs->glyphs[i].geometry.width = logical_rect.width;
+ }
}
static void
@@ -87,15 +95,17 @@
CFArrayRef runs;
CTRunRef run;
CTRunStatus run_status;
- CFIndex i, glyph_count;
+ CFIndex i, glyph_count, num_runs, run_index, run_offset, run_glyph_count;
const CGGlyph *cgglyphs;
+ const CGSize *cgadvs;
+ int free_cgglyphs = 0, free_cgadvs = 0;
CFTypeRef keys[] = {
- (CFTypeRef) kCTFontAttributeName
+ (CFTypeRef) kCTFontAttributeName
};
CFTypeRef values[] = {
- pango_core_text_font_get_ctfont (cfont)
+ pango_core_text_font_get_ctfont (cfont)
};
attributes = CFDictionaryCreate (kCFAllocatorDefault,
@@ -110,8 +120,6 @@
cstr = CFStringCreateWithCString (kCFAllocatorDefault, copy,
kCFStringEncodingUTF8);
- g_free (copy);
-
attstr = CFAttributedStringCreate (kCFAllocatorDefault,
cstr,
attributes);
@@ -120,13 +128,22 @@
runs = CTLineGetGlyphRuns (line);
- /* Since Pango divides things into runs already, we assume there is
- * only a single run in this line.
+ /* Since Pango divides things into runs already, we might assume there is
+ * only a single run in this line. However, unknown glyphs lead to
+ * separate runs.
*/
- run = CFArrayGetValueAtIndex (runs, 0);
- run_status = CTRunGetStatus (run);
- glyph_count = CTRunGetGlyphCount (run);
- cgglyphs = CTRunGetGlyphsPtr (run);
+ num_runs = CFArrayGetCount (runs);
+ glyph_count = 0;
+ for (i = 0; i < num_runs; i++) {
+ run = CFArrayGetValueAtIndex (runs, i);
+ glyph_count += CTRunGetGlyphCount (run);
+ }
+
+ g_free (copy);
+
+ run_offset = 0;
+ run_index = 0;
+ run_glyph_count = 0;
p = text;
pango_glyph_string_set_size (glyphs, glyph_count);
@@ -135,10 +152,41 @@
for (i = 0; i < glyph_count; i++)
{
- CFIndex real_i, prev_i;
+ CFIndex real_i, prev_i, run_real_i;
gunichar wc;
gunichar mirrored_ch;
+ if (i - run_offset >= run_glyph_count) {
+ run_offset = i;
+ run = CFArrayGetValueAtIndex (runs, run_index++);
+ run_glyph_count = CTRunGetGlyphCount (run);
+ run_status = CTRunGetStatus (run);
+
+ if (free_cgglyphs) {
+ free((void*)cgglyphs);
+ free_cgglyphs = 0;
+ }
+ cgglyphs = CTRunGetGlyphsPtr (run);
+ if (!cgglyphs) {
+ CFRange range = { 0, 0 };
+ cgglyphs = (CGGlyph *)malloc(run_glyph_count * sizeof(CGGlyph));
+ free_cgglyphs = 1;
+ CTRunGetGlyphs (run, range, (CGGlyph *)cgglyphs);
+ }
+
+ if (free_cgadvs) {
+ free((void*)cgadvs);
+ free_cgadvs = 0;
+ }
+ cgadvs = CTRunGetAdvancesPtr (run);
+ if (!cgadvs) {
+ CFRange range = { 0, 0 };
+ cgadvs = (CGSize *)malloc(run_glyph_count * sizeof(CGSize));
+ free_cgadvs = 1;
+ CTRunGetAdvances (run, range, (CGSize *)cgadvs);
+ }
+ }
+
wc = g_utf8_get_char (p);
if (analysis->level % 2)
@@ -147,11 +195,13 @@
if (run_status & kCTRunStatusRightToLeft)
{
+ run_real_i = run_glyph_count - (i - run_offset) - 1;
real_i = glyph_count - i - 1;
prev_i = real_i + 1;
}
else
{
+ run_real_i = i - run_offset;
real_i = i;
prev_i = real_i - 1;
}
@@ -161,7 +211,7 @@
if (pango_is_zero_width (wc))
{
- set_glyph (font, glyphs, real_i, p - text, PANGO_GLYPH_EMPTY);
+ set_glyph (font, glyphs, real_i, p - text, PANGO_GLYPH_EMPTY, NULL);
}
else
{
@@ -171,7 +221,7 @@
if (result != PANGO_COVERAGE_NONE)
{
- set_glyph (font, glyphs, real_i, p - text, cgglyphs[real_i]);
+ set_glyph (font, glyphs, real_i, p - text, cgglyphs[run_real_i], cgadvs + run_real_i);
if (g_unichar_type (wc) == G_UNICODE_NON_SPACING_MARK)
{
@@ -196,13 +246,18 @@
else
{
set_glyph (font, glyphs, real_i, p - text,
- PANGO_GET_UNKNOWN_GLYPH (wc));
+ PANGO_GET_UNKNOWN_GLYPH (wc), NULL);
}
}
p = g_utf8_next_char (p);
}
+ if (free_cgglyphs)
+ free((void *)cgglyphs);
+ if (free_cgadvs)
+ free((void *)cgadvs);
+
CFRelease (line);
CFRelease (attstr);
CFRelease (cstr);
diff -r -u pango-1.29.5-orig/pango/pangocairo-coretextfont.c pango-1.29.5/pango/pangocairo-coretextfont.c
--- pango-1.29.5-orig/pango/pangocairo-coretextfont.c 2011-08-15 18:11:08.000000000 -0700
+++ pango-1.29.5/pango/pangocairo-coretextfont.c 2012-05-17 14:14:02.000000000 -0700
@@ -147,6 +147,12 @@
metrics->strikethrough_position = metrics->ascent / 3;
metrics->strikethrough_thickness = CTFontGetUnderlineThickness (ctfont) * PANGO_SCALE;
+ metrics->underline_position = -metrics->underline_position;
+ pango_quantize_line_geometry (&metrics->underline_thickness,
+ &metrics->underline_position);
+ metrics->underline_position = -(metrics->underline_position
+ + metrics->underline_thickness);
+
layout = pango_layout_new (context);
font_desc = pango_font_describe_with_absolute_size ((PangoFont *) font);
pango_layout_set_font_description (layout, font_desc);
diff -r -u pango-1.29.5-orig/pango/pangocoretext-fontmap.c pango-1.29.5/pango/pangocoretext-fontmap.c
--- pango-1.29.5-orig/pango/pangocoretext-fontmap.c 2011-11-22 11:02:35.000000000 -0800
+++ pango-1.29.5/pango/pangocoretext-fontmap.c 2013-02-02 06:13:34.000000000 -0800
@@ -941,6 +941,8 @@
CTFontDescriptorRef desc = CFArrayGetValueAtIndex (ctfaces, i);
str = CTFontDescriptorCopyAttribute (desc, kCTFontFamilyNameAttribute);
+ if (!str) continue;
+
buffer = gchar_from_cf_string (str);
family_name = g_utf8_casefold (buffer, -1);

View File

@ -1,44 +0,0 @@
#lang racket/base
(require racket/path racket/system)
(define from (vector-ref (current-command-line-arguments) 0))
(define to
(path->string (simplify-path (build-path (collection-path "racket")
'up 'up "lib/")
#f)))
(define libs
'("libffi.5"
"libgio-2.0.0"
"libgmodule-2.0.0"
"libgthread-2.0.0"
"libglib-2.0.0"
"libgobject-2.0.0"
"libintl.8"
"libpango-1.0.0"
"libpangocairo-1.0.0"
"libcairo.2"
"libpixman-1.0"
"libpng15.15"
"libgmp.10"
"libmpfr.4"
"libjpeg.62"))
(define (fixup p p-new)
(printf "Fixing ~s\n" p-new)
(system (format "install_name_tool -id ~a ~a" (file-name-from-path p-new) p-new))
(for-each (lambda (s)
(system (format "install_name_tool -change ~a @loader_path/~a ~a"
(format "~a/~a.dylib" from s)
(format "~a.dylib" s)
p-new)))
libs))
(define (install p)
(let* ([p (format "~a.dylib" p)]
[dest (string-append to p)])
(when (file-exists? dest) (delete-file dest))
(copy-file (build-path from p) dest)
(fixup p dest)))
(for-each install libs)

View File

@ -0,0 +1,213 @@
The core `racket' executable has minimal library dependencies. In
contrast, libraries implemented in various packages, such as the
"draw" or "math" packages, rely on additional C-implemented libraries,
such as Cairo, GMP, etc., all of which are loaded dynamically. On Unix
variants, we expect users to install C-implemented libraries (usually
through the operating system's package manager). For Windows and Mac
OS X, we supply pre-built libraries in platform-specific packages; the
corresponding Racket packages include platform-specific dependencies
on those packages.
This directory contains scripts and patches to build Windows and Mac
OS X libraries in a consistent and portable way. Naturally, the script
and patches are fragile, so we upgrade libraries
infrequently. Currently, we use the following external packages and
versions:
pkg-config-0.28
sed-4.2 (Windows only, to avoid non-GNU `sed')
openssl-1.0.1g (Windows only)
libiconv-1.14 (Windows only)
zlib-1.2.8 (Windows only)
libffi-3.0.13
expat-2.1.0
gettext-0.18.3.2
glib-2.39.92
libpng-1.6.10
pixman-0.32.4
cairo-1.12.16
jpegsrc.v9a
harfbuzz-0.9.27
fontconfig-2.11.1
freetype-2.5.3
pango-1.36.3
poppler-0.24.5
mpfr-3.1.2
gmp-5.1.3
The above lists is aimed at the graphics stack, and there are a few
more libraries not covered here, yet. See "../mac/README.txt" and
"../worksp/README" for more information.
Preliminiaries
--------------
For Windows (cross-compile from Mac OS X or Linux):
The build scripts assume a MinGW cross compiler installed in
"/usr/mw32" (for 32-bit builds) and "/usr/mw64" (for 64-bit builds).
In addition, building "glib" requires "gettext" executables that run
on the build machine in your PATH.
Beware that the "libdir" configuration in
/usr/mw{32,64}/{i686,x86_64}-w64-mingw32/lib/libstdc++.la
may be wrong, in which case you'll need to fix it by hand.
For Mac OS X (i386 and x86_64 on Intel, ppc on PowerPC):
The script assumes that "/Developer/SDKs/MacOSX10.5.sdk" (for 32-bit
builds) and "/Developer/SDKs/MacOSX10.6.sdk" (for 64-bit builds) are
available.
You can get the 10.5 SDK out of the ".dmg" for Xcode 3.2.6; mount it
(don't run it), open -R "MacOSX10.5.pkg", and right click to run.
Probably you can get the 10.6 SDK in a similar way.
If you wanted to build for 10.4, and if you're using gcc instead of
Clang, then note that you'll need gcc-4.0 --- but the Pango version
listed above relies on CoreText, which is available only with 10.5 and
later.
Build Steps (assuming no version changes)
-----------
* Download .tar.{gz,bz2,xz} archives for the above packages. Stash
them in some directory, <archive-dir>
* Create a working directory, <build-dir>, and make it the current
directory.
* Run
racket <here-dir>/build-all.rkt \
--{win,mac} \
--m{32,64} \
--archives <archive-dir>
where <here-dir> is the deirectory containing this file,
`--win' versus `--mac' selects a Windows versus Mac OS X build,
and `--m32' versus `--m64' selects a 32-bit versus 64-bit build.
* Run
racket <here-dir>/install.rkt \
--{win,mac} \
--m{32,64} \
<native-pkgs-dir>
where <native-pkgs-dir> contains the package "source" directories,
such as "draw-win32-i386". The <native-pkgs-dir> is normally a
checkout of "https://github.com/plt/libs.git".
Details
-------
The "build-all.rkt" script runs "build.rkt" for each external package
that needs to be built for the specified platform. The "build.rkt"
script encodes suitable environment and flag settings for building
native libraries.
The first build step is "pkg-config", which is built for the current
build platform, as opposed to the target platform. The resulting
`pkg-config` is installed into "<build-dir>/dest/bin", which is
included in the PATH environment variable when all other configuration
steps are run. If you used an installed `pkg-config', then you'd end
up linking to installed packages on the build machine, which would be
confusing at best.
More details for Windows:
* GNU `sed' is built to run on the build platform, just in case the
build platform's `sed' is BSD-style (as on Mac OS X).
* The generated ".dll"s go to "dest/bin".
* The "install.rkt" script finalizes the build by stripping debugging
symbols.
* Beware of dynamic linking to libgcc or libstdc++. The build script
uses `-static-libgcc' and `-static-libstdc++' to statically link
those libraries. Use "depends.exe" to check DLL dependencies.
More details for Mac OS X:
* 32-bit binaries are built for 10.5 and up. 64-bit binaries are
built for 10.6 and up.
* The generated ".dylib"s go to "dest/lib".
* The "install.rkt" script finalizes the build by stripping debugging
symbols and adjusting cross-library references to be relative
paths.
During the build, ".dylib"s in "<build-dir>/dest/lib" will contain
full paths when they depend on other ".dylibs" in the same
directory. The "install.rkt" script uses `install_name_tool' to
rewrite those paths to relative form using "@loader_path".
You can use
otool -L <name>.dylib
to check that "<name>.dylib" does not refer to any other library
through an absolute path (i.e., your <build-dir> path). Also, watch
out for "/usr/opt/local" paths, which means that you have
accidentally links to MacPorts libraries.
* All ".dylib"s should use two-level namespaces. Use `otool -vh' and
look for "TWOLEVEL" in the output to double check that a library
build uses two-level namespaces.
When Library Versions Change
----------------------------
An external package such as "libffi-3.0.13" generates a library with a
name like "libffi.6.dylib". Upgrading a library may change the version
on the generated ".dll" or ".dylib". In that case, you must update
several places:
* Update the library version in "install.rkt".
* Update the `ffi-lib' reference in the corresponding Racket wrapper
libraries.
* Update the "info.rkt" dependencies in the Racket packages that
contain changed Racket wrappers, because a new ".dll" or ".dylib"
version will necessitate a new Racket package version (as a suffix
on the package name).
When Things Don't Work
----------------------
You may have to change "build-all.rkt" and "build.rkt", especially if
you're trying to upgrade external libraries. On upgrade, patches will
fail, new dependencies will be introduced, and so on. In particular,
the configuration flags and patches that we use are described within
"build.rkt".
You can run "build.rkt" directly to work on problems with an
individual external package. The "build-all.rkt" detects that an
external package <package-name> has been built though the existence of
the file
<build-dir>/dest/stamps/<package-name>
so delete that file to make "build-all.rkt" try again for
<package-name>.
If You Have to Start Over Completely
------------------------------------
See
* "racket/src/mac/README.txt" in a Racket v5.x source distirbution
* https://github.com/soegaard/racket-osx-libs
* http://cairographics.org/end_to_end_build_for_mac_os_x/
* Pre-built packages from www.gtk.org, specifically the "dev"
archives.
for old build notes. The "build.rkt" script automates most everything
we learned.

View File

@ -0,0 +1,52 @@
#lang racket/base
(require racket/system
racket/format
racket/runtime-path
"cmdline.rkt")
(define (get-package-names win?)
(append
'("pkg-config")
(if win?
'("sed"
"longdouble"
"libiconv"
"openssl"
"zlib")
null)
'("expat"
"gettext"
"libffi"
"glib"
"libpng"
"freetype"
"fontconfig"
"pixman"
"cairo"
"harfbuzz"
"pango"
"gmp"
"mpfr"
"jpeg"
"poppler")))
(define-runtime-path build-rkt "build.rkt")
(build-command-line)
(define package-names (get-package-names win?))
(for ([package-name (in-list package-names)])
(printf "~a\n" (make-string 72 #\=))
(cond
[(file-exists? (build-path "dest" "stamps" package-name))
(printf "Done already: ~a\n" package-name)]
[else
(printf "Building ~a\n" package-name)
(parameterize ([current-namespace (make-base-namespace)]
[current-command-line-arguments
(vector (if win? "--win" "--mac")
(if m32? (if ppc? "--mppc" "--m32") "--m64")
"--archives" (~a archives-dir)
package-name)])
(dynamic-require build-rkt #f))]))

View File

@ -0,0 +1,389 @@
#lang racket/base
(require racket/system
racket/format
racket/string
racket/file
racket/runtime-path
"cmdline.rkt")
(define skip-unpack? #f)
(define skip-config? #f)
(define package-name
(build-command-line
#:once-each
[("--skip-unpack") "Skip `unpack` step"
(set! skip-unpack? #t)]
[("--skip-config") "Skip `configure` step"
(set! skip-config? #t)]
#:args (package-name)
package-name))
;; --------------------------------------------------
;; Shell commands:
(define (system/show s)
(displayln s)
(unless (system s)
(exit 1)))
(define (system*/show . s)
(displayln (string-join (map (lambda (v) (if (path? v) (path->string v) v))
s)
" "))
(unless (apply system* s)
(exit 1)))
;; --------------------------------------------------
;; Unpack package and find package's source directory in the current
;; directory:
(define (find-package package-name dir? [fail-ok? #f])
(define candidates
(for/list ([f (in-list (directory-list))]
#:when (if dir?
(directory-exists? f)
(file-exists? f))
#:when (let ([s (path->string f)])
(and ((string-length s) . > . (string-length package-name))
(string=? (substring s 0 (string-length package-name))
package-name))))
f))
(cond
[(and fail-ok? (null? candidates))
#f]
[else
(when (null? candidates)
(error 'build "could not find ~a for package: ~a"
(if dir? "directory" "archive")
package-name))
(unless (null? (cdr candidates))
(error 'build "found multiple ~a matches for package: ~s"
(if dir? "directory" "archive")
candidates))
(car candidates)]))
(define-runtime-path longdouble-c "../racket/src/longdouble/longdouble.c")
(define-runtime-path longdouble-h "../racket/src/longdouble/longdouble.h")
(unless skip-unpack?
(case package-name
[("longdouble")
(make-directory* "longdouble-1")
(copy-file longdouble-c "longdouble-1/longdouble.c" #t)
(copy-file longdouble-h "longdouble-1/longdouble.h" #t)
(when (file-exists? "longdouble-1/longdouble.dll")
(delete-file "longdouble-1/longdouble.dll"))
(with-output-to-file "longdouble-1/configure"
#:exists 'truncate
(lambda ()
(printf "#!~a\n" (find-executable-path "sh"))
(printf "echo 'longdouble.dll:' > Makefile\n")
(printf "echo \"\t${CC} -shared -o longdouble.dll -DIMPLEMENTING_MSC_LONGDOUBLE=1 longdouble.c\" >> Makefile\n")
(printf "echo '' >> Makefile\n")
(printf "echo 'install:' >> Makefile\n")
(printf "echo '\tcp longdouble.dll ../dest/bin' >> Makefile\n")))
(file-or-directory-permissions "longdouble-1/configure" #o777)]
[else
(define archive (parameterize ([current-directory archives-dir])
(build-path archives-dir (find-package package-name #f))))
(define dir (find-package package-name #t #t))
(when dir
(printf "Removing ~a" dir)
(delete-directory/files dir))
(system/show (~a "tar zxf " archive))]))
(define package-dir (find-package package-name #t))
;; --------------------------------------------------
;; Create destination:
(unless (directory-exists? "dest")
(make-directory "dest"))
(define dest (path->complete-path "dest"))
;; --------------------------------------------------
;; Patches:
;; Enable kerning and set DPI to 72:
(define-runtime-path coretext-patch "patches/coretext.patch")
;; Enable "symbol" fonts, and fix off-by-one:
(define-runtime-path win32text-patch "patches/win32text.patch")
;; Needed when building with old GCC, such as 4.0:
(define-runtime-path gmp-weak-patch "patches/gmp-weak.patch")
;; XP doesn't have rand_s() as used by glib:
(define-runtime-path rand-patch "patches/rand.patch")
;; HarfBuzz makefile seems broken for MinGW as of 0.9.27:
(define-runtime-path fixdef-patch "patches/fixdef.patch")
;; Remove "-fno-check-new", which Clang does not recognize:
(define-runtime-path nonochecknew-patch "patches/nonochecknew.patch")
;; 64-bit MinGW doesn't like this use of `__always_inline__`:
(define-runtime-path noforceinline-patch "patches/noforceinline.patch")
;; Disable libtool's management of standard libs so that
;; MinGW's -static-libstdc++ works:
(define-runtime-path libtool-link-patch "patches/libtool-link.patch")
(define-runtime-path libtool64-link-patch "patches/libtool64-link.patch")
;; --------------------------------------------------
;; General environment and flag configuration:
(define win-prefix (if m32?
"i686-w64-mingw32"
"x86_64-w64-mingw32"))
;; Build GNU sed to avoid potential BSD sed:
(define need-sed? win?)
(define (sdk n)
(~a " -isysroot /Developer/SDKs/MacOSX10."n".sdk -mmacosx-version-min=10."n))
(define all-env
(cond
[win?
(case package-name
[("pkg-config" "sed")
;; pkgconfig and sed run on build platform:
null]
[("openssl")
;; Not libtool, and prefix added automatically
(list
(list "CC" "gcc -static-libgcc"))]
[else
(list
;; We'd prefer to add "-static-libgcc" to CFLAGS, but
;; libtool doesn't pass `static-libgcc` through.
(list "CC" (~a win-prefix "-gcc -static-libgcc")))])]
[m32?
(define sdk-flags (sdk 5))
(list
(list "CPPFLAGS" (~a "-m32" sdk-flags))
(list "LDFLAGS" (~a "-m32" sdk-flags)))]
[else
(define sdk-flags (sdk 6))
(list
(list "CPPFLAGS" (~a "-m64" sdk-flags))
(list "LDFLAGS" (~a "-m64" sdk-flags)))]))
(define cxx-env
(if win?
(list
(list "CXX" (~a win-prefix "-g++ -static-libgcc -static-libstdc++")))
null))
(define all-args
(append
(list (~a "--prefix=" dest))
(cond
[win?
(case package-name
[("pkg-config" "sed")
;; pkgconfig and sed run on build platform:
null]
[("openssl")
;; not the usual "configure"
null]
[("zlib")
;; zlib doesn't understand --host=
null]
[else
;; Everything else cross-compiles normally:
(cond
[m32?
(list "--host=i686-w64-mingw32")]
[else
(list "--host=x86_64-w64-mingw32")])])]
[else null])))
(define (merge e1 e2)
(define ht
(for/fold ([ht (hash)]) ([e (in-list (append e1 e2))])
(define v (hash-ref ht (car e) #f))
(if v
(hash-set ht (car e) (string-append v " " (cadr e)))
(hash-set ht (car e) (cadr e)))))
(for/list ([(k v) (in-hash ht)])
(list k v)))
(define gcc-4.0?
(and mac?
(let ([o (open-output-bytes)])
(parameterize ([current-output-port o])
(system "gcc -v"))
(regexp-match? #rx"gcc version 4[.]0" (get-output-bytes o)))))
(when gcc-4.0? (printf "using gcc 4.0"))
;; --------------------------------------------------
;; Package-specific environment and flag configuration:
(define (config #:depends [deps null]
#:env [env null]
#:configure-exe [exe #f]
#:configure [args null]
#:make [make "make"]
#:setup [setup null]
#:patches [patches null]
#:post-patches [post-patches null]
#:fixup [fixup #f])
(for ([d (in-list (append (if (or (equal? package-name "pkg-config")
(equal? package-name "sed"))
'()
(append
'("pkg-config")
(if need-sed? '("sed") '())))
deps))])
(unless (file-exists? (build-path dest "stamps" d))
(error 'build "prerequisite needed: ~a" d)))
(values env exe args make setup patches post-patches fixup))
(define path-flags
(list (list "CPPFLAGS" (~a "-I" dest "/include"))
(list "LDFLAGS" (~a "-L" dest "/lib"))))
(define (windows-only)
(unless win?
(error (format "build ~a only for Windows" package-name))))
(define-values (extra-env configure-exe extra-args make-command setup patches post-patches fixup)
(case package-name
[("pkg-config") (config #:configure (list "--with-internal-glib"))]
[("sed") (config)]
[("longdouble") (config)]
[("libiconv")
(windows-only)
(config)]
[("openssl")
(windows-only)
(config #:configure-exe (find-executable-path "sh")
#:configure (list "./Configure"
(~a "--cross-compile-prefix=" win-prefix "-")
#f ; other flags here
(~a "mingw" (if m32? "" "64"))
"shared"))]
[("expat") (config)]
[("gettext") (config #:depends (if win? '("libiconv") '())
#:configure '("--enable-languages=c")
#:make (if win?
;; We only need libintl, and building
;; only that avoids other problems.
"cd gettext-runtime/intl && make"
"make"))]
[("libffi") (config)]
[("zlib")
(windows-only)
(config #:make (~a "make -f win32/Makefile.gcc"
" PREFIX=" win-prefix "-"
" INCLUDE_PATH=" dest "/include"
" LIBRARY_PATH=" dest "/lib"
" BINARY_PATH=" dest "/bin"
" LDFLAGS=-static-libgcc")
#:fixup (~a "cp zlib1.dll " dest "/bin && cp libz.dll.a " dest "/lib"))]
[("glib") (config #:depends (append '("libffi" "gettext")
(if win?
'("libiconv")
'()))
#:env path-flags
#:patches (if (and win? m32?)
(list rand-patch)
null))]
[("libpng") (config #:depends (if win? '("zlib") '())
#:env (if win? path-flags null))]
[("freetype") (config #:depends '("libpng"))]
[("fontconfig") (config #:depends '("expat" "freetype")
#:configure '("--disable-docs"))]
[("pixman") (config #:patches (if (and win? (not m32?))
(list noforceinline-patch)
null))]
[("cairo") (config #:depends '("pixman" "fontconfig" "freetype" "libpng")
#:env path-flags
#:configure '("--enable-xlib=no"))]
[("harfbuzz") (config #:depends '("fontconfig" "freetype" "cairo")
#:configure '("--without-icu")
#:patches (if win?
(list fixdef-patch)
null)
#:env cxx-env)]
[("pango") (config #:depends '("cairo" "harfbuzz")
#:env (if win? path-flags null)
#:configure '("--without-x"
"--with-included-modules=yes"
"--with-dynamic-modules=no")
#:patches (list coretext-patch
win32text-patch))]
[("gmp") (config #:patches (if gcc-4.0? (list gmp-weak-patch) null)
#:configure (append
'("--enable-shared" "--disable-static")
(if (and m32? mac?)
(list "ABI=32")
null)))]
[("mpfr") (config #:configure '("--enable-shared" "--disable-static")
#:depends '("gmp")
#:env path-flags)]
[("jpeg") (config)]
[("poppler") (config #:env (append path-flags
cxx-env)
#:patches (list nonochecknew-patch)
#:post-patches (if win?
(list (if m32?
libtool-link-patch
libtool64-link-patch))
null)
#:configure '("--enable-zlib"
"--disable-splash-output"
"--disable-poppler-cpp"))]
[else (error 'build "unrecognized package: ~a" package-name)]))
;; --------------------------------------------------
;; Go!
(define (stamp package-name)
(make-directory* (build-path dest "stamps"))
(call-with-output-file*
(build-path dest "stamps" package-name)
#:exists 'truncate
void))
(parameterize ([current-directory package-dir]
[current-environment-variables
(environment-variables-copy
(current-environment-variables))])
(putenv "PATH" (~a dest "/bin"
":"
(if win?
(if m32?
"/usr/mw32/bin:"
"/usr/mw64/bin:")
"")
(getenv "PATH")))
(for ([e (in-list (merge all-env extra-env))])
(printf "~a=~a\n" (car e) (cadr e))
(putenv (car e) (cadr e)))
(unless skip-unpack?
(for ([s (in-list setup)])
(system/show s))
(for ([p (in-list patches)])
(system/show (~a "patch -p2 < " p))))
(unless skip-config?
(apply system*/show
(or configure-exe "./configure")
(let loop ([extra-args extra-args])
(cond
[(null? extra-args) all-args]
[(not (car extra-args)) (append all-args (cdr extra-args))]
[else (cons (car extra-args) (loop (cdr extra-args)))])))
(for ([p (in-list post-patches)])
(system/show (~a "patch -p2 < " p))))
(system/show make-command)
(system/show (~a make-command " install"))
(when fixup
(system/show fixup))
(stamp package-name)
(displayln "Success!"))

View File

@ -0,0 +1,55 @@
#lang racket/base
(require racket/cmdline)
(provide build-command-line
m32? win? mac? ppc?
archives-dir)
(define m32? 'unknown)
(define win? 'unknown)
(define mac? 'unknown)
(define ppc? #f)
(define archives-dir (current-directory))
(define-syntax-rule (build-command-line c ...)
(let ()
(define m32? 'unknown)
(define win? 'unknown)
(define mac? 'unknown)
(define ppc? (regexp-match? #rx"ppc" (system-library-subpath #f)))
(define archives-dir (current-directory))
(begin0
(command-line
#:once-any
[("--win") "build Windows via MinGW"
(set! win? #t)]
[("--mac") "build for/on Mac OS X"
(set! win? #f)]
#:once-any
[("--m32") "build 32-bit mode x86/PowerPC"
(set! m32? #t)]
[("--m64") "build 64-bit mode x86_64"
(set! m32? #f)]
[("--mppc") "build 32-bit mode PowerPC"
(set! m32? #t)
(set! ppc? #t)]
#:once-each
[("--archives") dir "Find archives in <dir>"
(set! archives-dir dir)]
c ...)
(when (eq? win? 'unknown)
(error 'build "please pick `--win` or `--mac`"))
(when (eq? m32? 'unknown)
(error 'build "please pick `--m32` or `--m64`"))
(when (and ppc? (not m32?))
(error 'build "cannot use `--m64` on PowerPC"))
(set! mac? (not win?))
(install! m32? win? mac? (and mac? ppc?) archives-dir))))
(define (install! -m32? -win? -mac? -ppc? -archives-dir)
(set! m32? -m32?)
(set! win? -win?)
(set! mac? -mac?)
(set! ppc? -ppc?)
(set! archives-dir -archives-dir))

View File

@ -0,0 +1,268 @@
#lang racket/base
(require racket/path
racket/system
racket/format
racket/file
racket/pretty
"cmdline.rkt")
(define libs
'("libffi.6"
"libgio-2.0.0"
"libgmodule-2.0.0"
"libgthread-2.0.0"
"libglib-2.0.0"
"libgobject-2.0.0"
"libintl.8"
"libharfbuzz.0"
"libpango-1.0.0"
"libpangocairo-1.0.0"
"libpangoft2-1.0.0"
"libexpat.1"
"libfontconfig.1"
"libfreetype.6"
"libcairo.2"
"libpixman-1.0"
"libpng16.16"
"libgmp.10"
"libmpfr.4"
"libjpeg.9"
"libpoppler.44"
"libpoppler-glib.8"))
(define win-libs
'("libiconv-2"
"libeay32"
"ssleay32"
"longdouble"
"zlib1"
"libpangowin32-1.0.0"))
(define package-mapping
`(["draw" ; pkg name
"-2" ; pkg suffix (increment after "-" when library versions change)
"racket/draw" ; subdir
"" ; extra for "LICENSE.txt"
(["libffi" "libffi - Copyright (c) 1996-2014 Anthony Green, Red Hat, Inc and others."]
["libglib" "GLib is released under the GNU Library General Public License (GNU LGPL)."]
"libgio"
"libgmodule"
"libgobject"
"libgthread"
["libintl" "libintl is released under the GNU Library General Public License (GNU LGPL)."]
["libharfbuzz" "HarfBuzz is relased under a MIT license."]
["libpango" "Pango is released under the GNU Library General Public License (GNU LGPL)."]
"libpangocairo"
"libpangoft2"
"libpangowin32"
"libexpat"
["libfontconfig" ,(~a "FontConfig:\n"
" Copyright © 2000,2001,2002,2003,2004,2006,2007 Keith Packard\n"
" Copyright © 2005 Patrick Lam\n"
" Copyright © 2009 Roozbeh Pournader\n"
" Copyright © 2008,2009 Red Hat, Inc.\n"
" Copyright © 2008 Danilo Šegan\n"
" Copyright © 2012 Google, Inc.")]
["libfreetype" "Pixman is relased under the FreeType project license."]
["libcairo" "Cairo is released under the GNU Library General Public License (GNU LGPL)."]
["libpixman" "Pixman is relased under a MIT license."]
["libpng" "Libpng is released under the libpng license."]
["libjpeg" "This software is based in part on the work of the Independent JPEG Group."]
["zlib1" "zlib is by Jean-loup Gailly and Mark Adler."])]
["racket"
"-2"
"racket"
""
(["libeay32" ,(~a "This product includes software developed by the OpenSSL Project for\n"
"use in the OpenSSL Toolkit (http://www.openssl.org/).\n"
"\n"
"Eric Young is the author of libeay and ssleay.")]
"ssleay32"
["libiconv-2" "libiconv is released under the GNU Lesser General Public License (GNU LGPL)."]
["longdouble" ,(~a "The source to longdouble is included with the Racket source code,\n"
"which is available from\n"
" http://www.racket-lang.org/")])]
["math"
""
"math"
""
(["libgmp" "GNU MP is released under the GNU Lesser General Public License (GNU LGPL)."]
["libmpfr" "MPFR is released under the GNU Lesser General Public License (GNU LGPL)."])]
["poppler"
""
"racket-poppler"
""
(["libpoppler"
;; Note: Poppler is GPL and *not* in the main Racket distribution (which is LGPL)
"Poppler is released under the GNU General Public License (GNU GPL)."])]))
(define (libs-of-pkg p) (list-ref p 4))
(define dest-dir
(build-command-line
#:args (dest-dir)
dest-dir))
(define from (build-path (current-directory) "dest" (if win? "bin" "lib")))
(define (find-pkg lib)
(define pkg (for/or ([p (in-list package-mapping)])
(define nl
(for/or ([nl (in-list (libs-of-pkg p))])
(define n (if (pair? nl) (car nl) nl))
(cond
[(equal? n lib) nl]
[else
(define len (string-length n))
(and ((string-length lib) . > . (add1 len))
(string=? n (substring lib 0 len))
(regexp-match? #rx"[-.0-9]" (string (string-ref lib len)))
nl)])))
(and nl
(list (car p) (cadr p) (caddr p)
(and (pair? nl) (cadr nl))))))
(unless pkg
(error 'install "cannot find package for library: ~e" lib))
(apply values pkg))
(define (gen-info platform i-platform pkg pkg-name subdir libs lics lic-end)
(define dest (build-path dest-dir pkg-name))
(define lib-path (build-path dest subdir "info.rkt"))
(define top-path (build-path dest "info.rkt"))
(define same? (equal? lib-path top-path))
(define (write-libs o)
(newline o)
(pretty-write `(define install-platform ,i-platform) o)
(newline o)
(pretty-write `(define copy-foreign-libs (quote ,libs)) o))
(define (write-pkg o)
(newline o)
(pretty-write `(define collection 'multi) o)
(pretty-write `(define deps '("base")) o)
(newline o)
(pretty-write `(define pkg-desc ,(format "native libraries for \"~a\" package" pkg)) o)
(newline o)
(pretty-write `(define pkg-authors '(mflatt)) o))
(unless same?
(printf "Write ~a\n" lib-path)
(call-with-output-file*
lib-path
#:exists 'truncate
(lambda (o)
(displayln "#lang setup/infotab" o)
(write-libs o))))
(printf "Write ~a\n" top-path)
(call-with-output-file*
top-path
#:exists 'truncate
(lambda (o)
(displayln "#lang setup/infotab" o)
(write-pkg o)
(when same?
(write-libs o))))
(define lic-path (build-path dest "LICENSE.txt"))
(printf "Write ~a\n" lic-path)
(call-with-output-file*
lic-path
#:exists 'truncate
(lambda (o)
(displayln pkg-name o)
(displayln "Copyright (c) 2010-2014 PLT Design Inc." o)
(newline o)
(displayln "This package is distributed under the GNU Lesser General Public" o)
(displayln "License (LGPL). This means that you can link this package into" o)
(displayln "proprietary applications, provided you follow the rules stated in the" o)
(displayln "LGPL. You can also modify this package; if you distribute a modified" o)
(displayln "version, you must distribute it under the terms of the LGPL, which in" o)
(displayln "particular means that you must release the source code for the" o)
(displayln "modified software. See http://www.gnu.org/copyleft/lesser.html" o)
(displayln "for more information." o)
(for ([l (in-list lics)])
(newline o)
(displayln l o))
(display lic-end o))))
(define (install platform i-platform so fixup libs)
(define pkgs (make-hash))
(define pkgs-lic (make-hash))
(define (install lib)
(define p (format "~a.~a" lib so))
(define-values (pkg suffix subdir lic) (find-pkg lib))
(define dir (build-path dest-dir
(~a pkg "-" platform suffix)
subdir))
(define dest (build-path dir p))
(make-directory* dir)
(when (file-exists? dest) (delete-file dest))
(copy-file (build-path from p) dest)
(fixup p dest)
(hash-update! pkgs pkg (lambda (l) (cons p l)) '())
(when lic
(hash-update! pkgs-lic pkg (lambda (l) (cons lic l)) '())))
(for-each install libs)
(for ([(pkg libs) (in-hash pkgs)])
(define a (assoc pkg package-mapping))
(gen-info platform
i-platform
pkg
(~a pkg "-" platform (cadr a))
(caddr a)
libs
(reverse (hash-ref pkgs-lic pkg null))
(list-ref a 3))))
(define (install-mac)
(define (fixup p p-new)
(printf "Fixing ~s\n" p-new)
(system (format "install_name_tool -id ~a ~a" (file-name-from-path p-new) p-new))
(for-each (lambda (s)
(system (format "install_name_tool -change ~a @loader_path/~a ~a"
(format "~a/~a.dylib" from s)
(format "~a.dylib" s)
p-new)))
libs)
(system (format "strip -S ~a" p-new)))
(define platform (~a (if m32?
(if ppc? "ppc" "i386")
"x86_64")
"-macosx"))
(install platform platform "dylib" fixup libs))
(define (install-win)
(define exe-prefix (if m32?
"i686-w64-mingw32"
"x86_64-w64-mingw32"))
(define (fixup p p-new)
(printf "Fixing ~s\n" p-new)
(system (~a exe-prefix "-strip -S " p-new)))
(parameterize ([current-environment-variables
(environment-variables-copy
(current-environment-variables))])
(putenv "PATH" (~a (if m32?
"/usr/mw32/bin:"
"/usr/mw64/bin:")
(getenv "PATH")))
(install (~a "win32-" (if m32? "i386" "x86_64"))
(~a "win32\\" (if m32? "i386" "x86_64"))
"dll"
fixup
(for/list ([s (in-list (append libs
win-libs))])
(regexp-replace #rx"!"
(regexp-replace* #rx"[.]"
(regexp-replace #rx"[.](?=.*[.])" s "!")
"-")
".")))))
(cond
[win? (install-win)]
[else (install-mac)])

View File

@ -0,0 +1,127 @@
diff -r -u old/pango-1.36.3/modules/basic/basic-coretext.c new/pango-1.36.3/modules/basic/basic-coretext.c
--- old/pango-1.36.3/modules/basic/basic-coretext.c 2014-03-05 21:33:55.000000000 -0700
+++ new/pango-1.36.3/modules/basic/basic-coretext.c 2014-03-30 09:52:46.000000000 -0600
@@ -55,7 +55,8 @@
PangoGlyphString *glyphs,
int i,
int offset,
- PangoGlyph glyph)
+ PangoGlyph glyph,
+ CGSize *adv)
{
PangoRectangle logical_rect;
@@ -65,8 +66,13 @@
glyphs->glyphs[i].geometry.y_offset = 0;
glyphs->log_clusters[i] = offset;
- pango_font_get_glyph_extents (font, glyphs->glyphs[i].glyph, NULL, &logical_rect);
- glyphs->glyphs[i].geometry.width = logical_rect.width;
+ if (adv) {
+ /* by using the advances array, we get kerning */
+ glyphs->glyphs[i].geometry.width = adv->width * PANGO_SCALE;
+ } else {
+ pango_font_get_glyph_extents (font, glyphs->glyphs[i].glyph, NULL, &logical_rect);
+ glyphs->glyphs[i].geometry.width = logical_rect.width;
+ }
}
@@ -92,6 +98,7 @@
CTRunRef current_run;
CFIndex *current_indices;
const CGGlyph *current_cgglyphs;
+ const CGSize *current_cgadvs;
CTRunStatus current_run_status;
};
@@ -118,6 +125,7 @@
iter->current_run = CFArrayGetValueAtIndex (iter->runs, run_number);
iter->current_run_status = CTRunGetStatus (iter->current_run);
iter->current_cgglyphs = CTRunGetGlyphsPtr (iter->current_run);
+ iter->current_cgadvs = CTRunGetAdvancesPtr (iter->current_run);
ct_glyph_count = CTRunGetGlyphCount (iter->current_run);
iter->current_indices = malloc (sizeof (CFIndex *) * ct_glyph_count);
@@ -175,6 +183,12 @@
return iter->current_cgglyphs[iter->ct_i];
}
+static CGSize
+run_iterator_get_cgadv (struct RunIterator *iter)
+{
+ return iter->current_cgadvs[iter->ct_i];
+}
+
static CFIndex
run_iterator_get_index (struct RunIterator *iter)
{
@@ -297,6 +311,7 @@
{
CFIndex index;
CGGlyph cgglyph;
+ CGSize cgadv;
gunichar wc;
};
@@ -338,6 +353,7 @@
gi = g_slice_new (struct GlyphInfo);
gi->index = run_iterator_get_index (&riter);
gi->cgglyph = run_iterator_get_cgglyph (&riter);
+ gi->cgadv = run_iterator_get_cgadv (&riter);
gi->wc = run_iterator_get_character (&riter);
glyph_list = g_slist_prepend (glyph_list, gi);
@@ -426,7 +442,7 @@
if (gi == NULL || gi->index > gs_i)
{
/* gs_i is behind, insert empty glyph */
- set_glyph (font, glyphs, gs_i, p - text, PANGO_GLYPH_EMPTY);
+ set_glyph (font, glyphs, gs_i, p - text, PANGO_GLYPH_EMPTY, NULL);
continue;
}
else if (gi->index < gs_i)
@@ -457,7 +473,7 @@
if (result != PANGO_COVERAGE_NONE)
{
- set_glyph (font, glyphs, gs_i, p - text, gi->cgglyph);
+ set_glyph (font, glyphs, gs_i, p - text, gi->cgglyph, &gi->cgadv);
if (g_unichar_type (gi->wc) == G_UNICODE_NON_SPACING_MARK)
{
@@ -480,7 +496,7 @@
}
}
else
- set_glyph (font, glyphs, gs_i, p - text, PANGO_GET_UNKNOWN_GLYPH (gi->wc));
+ set_glyph (font, glyphs, gs_i, p - text, PANGO_GET_UNKNOWN_GLYPH (gi->wc), NULL);
glyph_iter = g_slist_next (glyph_iter);
}
diff -r -u old/pango-1.36.3/pango/pangocairo-coretextfont.c new/pango-1.36.3/pango/pangocairo-coretextfont.c
--- old/pango-1.36.3/pango/pangocairo-coretextfont.c 2014-03-05 21:33:55.000000000 -0700
+++ new/pango-1.36.3/pango/pangocairo-coretextfont.c 2014-03-30 09:52:46.000000000 -0600
@@ -147,6 +147,12 @@
metrics->strikethrough_position = metrics->ascent / 3;
metrics->strikethrough_thickness = CTFontGetUnderlineThickness (ctfont) * PANGO_SCALE;
+ metrics->underline_position = -metrics->underline_position;
+ pango_quantize_line_geometry (&metrics->underline_thickness,
+ &metrics->underline_position);
+ metrics->underline_position = -(metrics->underline_position
+ + metrics->underline_thickness);
+
layout = pango_layout_new (context);
font_desc = pango_font_describe_with_absolute_size ((PangoFont *) font);
pango_layout_set_font_description (layout, font_desc);
diff -r -u old/pango-1.36.3/pango/pangocairo-coretextfontmap.c new/pango-1.36.3/pango/pangocairo-coretextfontmap.c
--- old/pango-1.36.3/pango/pangocairo-coretextfontmap.c 2014-03-05 21:33:55.000000000 -0700
+++ new/pango-1.36.3/pango/pangocairo-coretextfontmap.c 2014-03-30 09:52:46.000000000 -0600
@@ -186,5 +186,5 @@
pango_cairo_core_text_font_map_init (PangoCairoCoreTextFontMap *cafontmap)
{
cafontmap->serial = 1;
- cafontmap->dpi = 96.;
+ cafontmap->dpi = 72.;
}

View File

@ -0,0 +1,12 @@
diff -r -u old/harfbuzz-0.9.27/src/Makefile.in new/harfbuzz-0.9.27/src/Makefile.in
--- old/harfbuzz-0.9.27/src/Makefile.in 2014-03-31 09:23:00.000000000 -0600
+++ new/harfbuzz-0.9.27/src/Makefile.in 2014-03-31 09:23:27.000000000 -0600
@@ -2234,7 +2234,7 @@
"$<" \
> "$@.tmp" && mv "$@.tmp" "$@" || ( $(RM) "$@.tmp"; false )
harfbuzz.def: $(HBHEADERS) $(HBNODISTHEADERS)
- $(AM_V_GEN) (echo EXPORTS; \
+ $(AM_V_GEN) ( \
(cat $^ || echo 'hb_ERROR ()' ) | \
$(EGREP) '^hb_.* \(' | \
sed -e 's/ (.*//' | \

View File

@ -0,0 +1,15 @@
diff -r -u old/gmp-5.1.3/gmp-h.in new/gmp-5.1.3/gmp-h.in
--- old/gmp-5.1.3/gmp-h.in 2014-04-02 17:37:19.000000000 -0600
+++ new/gmp-5.1.3/gmp-h.in 2014-04-02 17:39:16.000000000 -0600
@@ -361,9 +361,9 @@
#ifdef __GNUC__
#if (defined __GNUC_STDC_INLINE__) || (__GNUC__ == 4 && __GNUC_MINOR__ == 2) \
|| (defined __GNUC_GNU_INLINE__ && defined __cplusplus)
-#define __GMP_EXTERN_INLINE extern __inline__ __attribute__ ((__gnu_inline__))
+#define __GMP_EXTERN_INLINE extern __inline__ __attribute__ ((__weak__))
#else
-#define __GMP_EXTERN_INLINE extern __inline__
+#define __GMP_EXTERN_INLINE extern __inline__ __attribute__ ((__weak__))
#endif
#define __GMP_INLINE_PROTOTYPES 1
#endif

View File

@ -0,0 +1,34 @@
diff -r -u old/poppler-0.24.5/libtool new/poppler-0.24.5/libtool
--- old/poppler-0.24.5/libtool 2014-04-01 07:00:21.000000000 -0600
+++ new/poppler-0.24.5/libtool 2014-04-01 07:00:07.000000000 -0600
@@ -10167,14 +10167,14 @@
old_archive_from_expsyms_cmds=""
# Commands used to build a shared archive.
-archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib"
+archive_cmds="\$CC -shared \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib"
archive_expsym_cmds="if test \\\"x\\\`\$SED 1q \$export_symbols\\\`\\\" = xEXPORTS; then
cp \$export_symbols \$output_objdir/\$soname.def;
else
echo EXPORTS > \$output_objdir/\$soname.def;
cat \$export_symbols >> \$output_objdir/\$soname.def;
fi~
- \$CC -shared -nostdlib \$output_objdir/\$soname.def \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib"
+ \$CC -shared \$output_objdir/\$soname.def \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib"
# Commands used to build a loadable module if different from building
# a shared archive.
@@ -10256,10 +10256,10 @@
# Dependencies to place before and after the objects being linked to
# create a shared library.
-predep_objects="/usr/mw32/bin/../lib/gcc/i686-w64-mingw32/4.9.0/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o /usr/mw32/bin/../lib/gcc/i686-w64-mingw32/4.9.0/crtbegin.o"
-postdep_objects="/usr/mw32/bin/../lib/gcc/i686-w64-mingw32/4.9.0/crtend.o"
+predep_objects=""
+postdep_objects=""
predeps=""
-postdeps="-lstdc++ -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt"
+postdeps=""
# The library search path used internally by the compiler when linking
# a shared library.

View File

@ -0,0 +1,34 @@
diff -r -u old/poppler-0.24.5/libtool new/poppler-0.24.5/libtool
--- old/poppler-0.24.5/libtool 2014-04-04 16:45:38.000000000 -0600
+++ new/poppler-0.24.5/libtool 2014-04-04 16:46:07.000000000 -0600
@@ -10167,14 +10167,14 @@
old_archive_from_expsyms_cmds=""
# Commands used to build a shared archive.
-archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib"
+archive_cmds="\$CC -shared \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib"
archive_expsym_cmds="if test \\\"x\\\`\$SED 1q \$export_symbols\\\`\\\" = xEXPORTS; then
cp \$export_symbols \$output_objdir/\$soname.def;
else
echo EXPORTS > \$output_objdir/\$soname.def;
cat \$export_symbols >> \$output_objdir/\$soname.def;
fi~
- \$CC -shared -nostdlib \$output_objdir/\$soname.def \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib"
+ \$CC -shared \$output_objdir/\$soname.def \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib"
# Commands used to build a loadable module if different from building
# a shared archive.
@@ -10256,10 +10256,10 @@
# Dependencies to place before and after the objects being linked to
# create a shared library.
-predep_objects="/usr/mw64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.0/../../../../x86_64-w64-mingw32/lib/../lib/dllcrt2.o /usr/mw64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.0/../../../../x86_64-w64-mingw32/lib/../lib/crtbegin.o"
-postdep_objects="/usr/mw64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.0/../../../../x86_64-w64-mingw32/lib/../lib/crtend.o"
+predep_objects=""
+postdep_objects=""
predeps=""
-postdeps="-lstdc++ -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt"
+postdeps=""
# The library search path used internally by the compiler when linking
# a shared library.

View File

@ -0,0 +1,13 @@
diff -u -r old/pixman-0.32.4/pixman/pixman-compiler.h new/pixman-0.32.4/pixman/pixman-compiler.h
--- old/pixman-0.32.4/pixman/pixman-compiler.h 2014-04-04 15:06:39.000000000 -0600
+++ new/pixman-0.32.4/pixman/pixman-compiler.h 2014-04-04 15:07:27.000000000 -0600
@@ -78,7 +78,7 @@
# define noinline __declspec(noinline)
#elif defined __GNUC__ || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
# define inline __inline__
-# define force_inline __inline__ __attribute__ ((__always_inline__))
+# define force_inline __inline__
# define noinline __attribute__((noinline))
#else
# ifndef force_inline
Only in new/pixman-0.32.4/pixman: pixman-compiler.h~

View File

@ -0,0 +1,13 @@
diff -u -r old/poppler-0.24.5/configure new/poppler-0.24.5/configure
--- old/poppler-0.24.5/configure 2014-04-01 04:55:51.000000000 -0600
+++ new/poppler-0.24.5/configure 2014-04-01 04:56:11.000000000 -0600
@@ -24905,7 +24905,7 @@
fi
case "$enable_compile_warnings" in
no) ;;
- yes) CXXFLAGS="-Wall -Woverloaded-virtual -Wnon-virtual-dtor -Wcast-align -fno-exceptions -fno-check-new -fno-common $CXXFLAGS";
+ yes) CXXFLAGS="-Wall -Woverloaded-virtual -Wnon-virtual-dtor -Wcast-align -fno-exceptions -fno-common $CXXFLAGS";
CFLAGS="-Wall $CFLAGS" ;;
kde) CXXFLAGS="-Wnon-virtual-dtor -Wno-long-long -Wundef \
-D_XOPEN_SOURCE=600 -D_BSD_SOURCE -Wcast-align \
Only in new/poppler-0.24.5: configure~

View File

@ -0,0 +1,13 @@
diff -u -r old/glib-2.39.92/glib/grand.c new/glib-2.39.92/glib/grand.c
--- old/glib-2.39.92/glib/grand.c 2014-03-31 08:42:11.000000000 -0600
+++ new/glib-2.39.92/glib/grand.c 2014-03-31 08:42:56.000000000 -0600
@@ -264,7 +264,7 @@
gint i;
for (i = 0; i < G_N_ELEMENTS (seed); i++)
- rand_s (&seed[i]);
+ seed[i] = rand();
#endif
return g_rand_new_with_seed_array (seed, 4);

View File

@ -0,0 +1,33 @@
diff -r -u old/pango-1.36.3/modules/basic/basic-win32.c new/pango-1.36.3/modules/basic/basic-win32.c
--- old/pango-1.36.3/modules/basic/basic-win32.c 2014-04-01 09:45:50.000000000 -0600
+++ new/pango-1.36.3/modules/basic/basic-win32.c 2014-04-01 09:49:32.000000000 -0600
@@ -468,7 +468,7 @@
g_print (G_STRLOC ": ScriptItemize: uDefaultLanguage:%04x uBidiLevel:%d\n",
control.uDefaultLanguage, state.uBidiLevel);
#endif
- if (ScriptItemize (wtext, wlen, G_N_ELEMENTS (items), &control, NULL,
+ if (ScriptItemize (wtext, wlen, G_N_ELEMENTS (items) - 1, &control, NULL,
items, &nitems))
{
#ifdef BASIC_WIN32_DEBUGGING
Only in new/pango-1.36.3/modules/basic: basic-win32.c~
diff -r -u old/pango-1.36.3/pango/pangowin32-fontmap.c new/pango-1.36.3/pango/pangowin32-fontmap.c
--- old/pango-1.36.3/pango/pangowin32-fontmap.c 2014-04-01 09:45:50.000000000 -0600
+++ new/pango-1.36.3/pango/pangowin32-fontmap.c 2014-04-01 09:49:32.000000000 -0600
@@ -1501,6 +1501,7 @@
ff_name (lfp->lfPitchAndFamily & 0xF0, tmp_for_ff_name),
is_synthetic ? " synthetic" : ""));
+#if 0
/* Ignore Symbol fonts (which don't have any Unicode mapping
* table). We could also be fancy and use the PostScript glyph name
* table for such if present, and build a Unicode map by mapping
@@ -1508,6 +1509,7 @@
*/
if (lfp->lfCharSet == SYMBOL_CHARSET)
return;
+#endif
if (g_hash_table_lookup (win32fontmap->fonts, lfp))
{
Only in new/pango-1.36.3/pango: pangowin32-fontmap.c~

View File

@ -56,6 +56,7 @@ AC_ARG_ENABLE(dynlib, [ --enable-libs install Racket static librarie
AC_ARG_ENABLE(libffi, [ --enable-libffi use installed libffi (enabled by default for Unix)], , enable_libffi=default)
AC_ARG_ENABLE(sdk, [ --enable-sdk=<path> use Mac OS X 10.4 SDK directory])
AC_ARG_ENABLE(sdk, [ --enable-sdk5=<path> use Mac OS X 10.5 SDK directory])
AC_ARG_ENABLE(sdk, [ --enable-sdk6=<path> use Mac OS X 10.6 SDK directory])
AC_ARG_ENABLE(xonx, [ --enable-xonx use Unix style (e.g., use Gtk) for Mac OS X])
AC_ARG_ENABLE(libfw, [ --enable-libfw install Mac OS X frameworks to /Library/Frameworks])
@ -324,11 +325,20 @@ show_explicitly_enabled "${enable_libfw}" "Frameworks-to-system"
show_explicitly_enabled "${enable_userfw}" "Frameworks-to-user"
if test "${enable_sdk}" != "" ; then
if test "${enable_sdk5}" != "" ; then
echo "ERROR: cannot specify both --enable-sdk and --enable-sdk5"
fi
if test "${enable_sdk6}" != "" ; then
echo "ERROR: cannot specify both --enable-sdk and --enable-sdk6"
fi
echo "=== Using Mac OS X 10.4 SDK directory ${enable_sdk}"
fi
if test "${enable_sdk5}" != "" ; then
if test "${enable_sdk6}" != "" ; then
echo "ERROR: cannot specify both --enable-sdk5 and --enable-sdk6"
fi
echo "=== Using Mac OS X 10.5 SDK directory ${enable_sdk}"
fi
if test "${enable_sdk6}" != "" ; then
echo "=== Using Mac OS X 10.6 SDK directory ${enable_sdk6}"
fi
@ -729,6 +739,14 @@ case "$host_os" in
fi
fi
if test "${enable_sdk5}" != "" ; then
PREFLAGS="$PREFLAGS -isysroot ${enable_sdk5} -mmacosx-version-min=10.5"
LDFLAGS="$LDFLAGS -isysroot ${enable_sdk5} -mmacosx-version-min=10.5"
SUB_CONFIGURE_EXTRAS="${SUB_CONFIGURE_EXTRAS} CFLAGS="'"'"${CFLAGS}"'"'
SUB_CONFIGURE_EXTRAS="${SUB_CONFIGURE_EXTRAS} CPPFLAGS="'"'"${PREFLAGS}"'"'
SUB_CONFIGURE_EXTRAS="${SUB_CONFIGURE_EXTRAS} LDFLAGS="'"'"${LDFLAGS}"'"'
fi
if test "${enable_sdk6}" != "" ; then
PREFLAGS="$PREFLAGS -isysroot ${enable_sdk6} -mmacosx-version-min=10.6"
LDFLAGS="$LDFLAGS -isysroot ${enable_sdk6} -mmacosx-version-min=10.6"

View File

@ -102,46 +102,23 @@ In principle, you could build them from scratch, but since they
are (mostly) maintained by people and organizations other than
PLT, we supply them in binary form.
The DLLs are available from
http://download.racket-lang.org/libs/
The DLLs are distributed in packages, but they are also available
from
https://github.com/plt/libs
and they must be installed into
racket\lib
The "get-libs.rkt" script in "racket\src" can download the libraries,
and the script is used by "build.bat".
Pre-built libraries use "msvcrt.dll", as opposed to the run-time
library for a particular version of MSVC. For more information on that
choice, in case you want to compile you own, see
choice, in case you want to compile you own via MSVC, see
http://kobyk.wordpress.com/2007/07/20/
dynamically-linking-with-msvcrtdll-using-visual-c-2005/
In the case of OpenSSL v1.0.0g, two files that use `_stat' lead to an
unresolved reference to `_stat64i32'. That function is equivalent to
`_stat' as exported by "msvcrt.dll"; due to a tangle of `#define's, to
make the OpenSSL source refer to `_stat', you must use `struct
_stat64i32' in place of `struct stat', `#undef _stat', and use
`_stat()' in place of `stat()'.
The pre-built binaries are unpatched with the exception of
"libpangowin32", where the following patches are used with version
pango-1.28.3:
pango/pangowin32-fontmap.c:1198:
Comment out SYMBOL_CHARSET test
modules/basic/basic-win32.c:331:
/* Ignore the high surrogate */
if (!(wtext[i] >= 0xD800 && wtext[i] < 0xDBFF))
modules/basic/basic-win32.c:479:
if (ScriptItemize (wtext, wlen, G_N_ELEMENTS (items) - 1, &control, NULL,
The "longdouble.dll" library is used to implement extflonums. Its
source is "longdouble.c" in the Racket source directory, and it must
be compiled using MinGW and with `IMPLEMENTING_MSC_LONGDOUBLE' defined.
See also "..\native-lib\README.txt".
Building Racket3m and GRacket3m
-------------------------------