Re: [gtk-osx-users] Question about CUPS module




On Jan 13, 2017, at 7:00 PM, John Ralls wrote:


On Jan 12, 2017, at 12:34 PM, G 3 <programmingkidx gmail com> wrote:

While running '~/.local/bin/jhbuild build meta-gtk-osx-bootstrap meta-gtk-osx-core', I noticed several permission errors while the CUPS module was building. Here they are:

install: chmod 755 /System/Library/LaunchDaemons: Operation not permitted
Installing LaunchDaemons configuration files...
install: /System/Library/LaunchDaemons/org.cups.cupsd.plist: Permission denied install: /System/Library/LaunchDaemons/org.cups.cups-lpd.plist: Permission denied install: chmod 755 /System/Library/StartupItems/PrintingServices: Operation not permitted install: /System/Library/StartupItems/PrintingServices/ PrintingServices: Permission denied install: /System/Library/StartupItems/PrintingServices/ StartupParameters.plist: Permission denied
W: Ignoring uninstalled package: cups

Since Mac OS X already comes with CUPS, how do I disable this module?_______________________________________________

The way you disable any other module: Add it to the skip list in your ~/.jhbuildrc-custom.

However, you don't want to do that because the version of CUPS supplied with Tiger is too old to work with several Gnome libraries.

The permission errors can be fixed by adding the following to ~/.jhbuildrc-custom: module.append_autogenargs("cups", "--without-php --with-rcdir=$ {prefix}/libexec --with-cupsgroup=foo"), where foo is whatever group your regular userid is in (use the command `groups` to find out).

jhbuild will duly crash when it finishes installing due to a misfeature where it tries to tell `make install` to install to a hidden directory and then when that finishes copies the hidden directory to $PREFIX. Two packages, cups and openssl, ignore the instruction to make install, so jhbuild crashes when it finishes. You can patch Source/jhbuild/jhbiuild/modules/autogen.py to not do that (comment out lines 312-314) or you can just let it crash and restart jhbuild with --start-at=libpng and keep going.

Regards,
John Ralls


Thank you for this information. It did help me to go further. Changing 'module.append_autogenargs' to just 'append_autogenargs' is what worked for me.

I couldn't find the autogen.py file, so I just let jhbuild crash. Using the --start-at option made things continue.

I did notice that Cairo 1.14 needs a patch to build on Mac OS 10.4. Here are two patches that allowed me to successfully build Cairo.


The code for extracting font glyphs was replaced in
70cc8f250b5669e757b4f044571ba0f71e3dea9e with an implementation based
on CoreText, which is not available on MacOSX 10.4.  This commit
restores automatic detection of which API should be used by means of
dynamic linking.

diff --git a/src/cairo-quartz-font.c b/src/cairo-quartz-font.c
index feee61a..b2919b5 100644
--- a/src/cairo-quartz-font.c
+++ b/src/cairo-quartz-font.c
@@ -81,6 +81,14 @@ static void (*CGFontGetGlyphsForUnicharsPtr) (CGFontRef, const UniChar[], const static void (*CGContextSetAllowsFontSmoothingPtr) (CGContextRef, bool) = NULL; static bool (*CGContextGetAllowsFontSmoothingPtr) (CGContextRef) = NULL;

+/* Not public in the least bit */
+static CGPathRef (*CGFontGetGlyphPathPtr) (CGFontRef fontRef, CGAffineTransform *textTransform, int unknown, CGGlyph glyph) = NULL;
+
+/* CTFontCreateWithGraphicsFont is not available until 10.5 */
+typedef const struct __CTFontDescriptor *CTFontDescriptorRef;
+static CTFontRef (*CTFontCreateWithGraphicsFontPtr) (CGFontRef, CGFloat, const CGAffineTransform*, CTFontDescriptorRef) = NULL; +static CGPathRef (*CTFontCreatePathForGlyphPtr) (CTFontRef, CGGlyph, CGAffineTransform *) = NULL;
+
/* CGFontGetHMetrics isn't public, but the other functions are public/present in 10.5 */
 typedef struct {
     int ascent;
@@ -125,6 +133,11 @@ quartz_font_ensure_symbols(void)
CGFontGetUnitsPerEmPtr = dlsym(RTLD_DEFAULT, "CGFontGetUnitsPerEm"); CGFontGetGlyphAdvancesPtr = dlsym(RTLD_DEFAULT, "CGFontGetGlyphAdvances");

+ CTFontCreateWithGraphicsFontPtr = dlsym(RTLD_DEFAULT, "CTFontCreateWithGraphicsFont"); + CTFontCreatePathForGlyphPtr = dlsym(RTLD_DEFAULT, "CTFontCreatePathForGlyph"); + if (!CTFontCreateWithGraphicsFontPtr || ! CTFontCreatePathForGlyphPtr)
+       CGFontGetGlyphPathPtr = dlsym(RTLD_DEFAULT, "CGFontGetGlyphPath");
+
     CGFontGetHMetricsPtr = dlsym(RTLD_DEFAULT, "CGFontGetHMetrics");
     CGFontGetAscentPtr = dlsym(RTLD_DEFAULT, "CGFontGetAscent");
     CGFontGetDescentPtr = dlsym(RTLD_DEFAULT, "CGFontGetDescent");
@@ -140,6 +153,7 @@ quartz_font_ensure_symbols(void)
        CGFontGetGlyphsForUnicharsPtr &&
        CGFontGetUnitsPerEmPtr &&
        CGFontGetGlyphAdvancesPtr &&
+ ((CTFontCreateWithGraphicsFontPtr && CTFontCreatePathForGlyphPtr) || CGFontGetGlyphPathPtr) && (CGFontGetHMetricsPtr || (CGFontGetAscentPtr && CGFontGetDescentPtr && CGFontGetLeadingPtr)))
        _cairo_quartz_font_symbols_present = TRUE;

@@ -545,7 +559,6 @@ _cairo_quartz_init_glyph_path (cairo_quartz_scaled_font_t *font,
     CGGlyph glyph = _cairo_quartz_scaled_glyph_index (scaled_glyph);
     CGAffineTransform textMatrix;
     CGPathRef glyphPath;
-    CTFontRef ctFont;
     cairo_path_fixed_t *path;

     if (glyph == INVALID_GLYPH) {
@@ -560,9 +573,14 @@ _cairo_quartz_init_glyph_path (cairo_quartz_scaled_font_t *font,
                                        -font->base.scale.yy,
                                        0, 0);

- ctFont = CTFontCreateWithGraphicsFont (font_face->cgFont, 1.0, NULL, NULL);
-    glyphPath = CTFontCreatePathForGlyph (ctFont, glyph, &textMatrix);
-    CFRelease (ctFont);
+ if (CTFontCreateWithGraphicsFontPtr && CTFontCreatePathForGlyphPtr) { + CTFontRef ctFont = CTFontCreateWithGraphicsFontPtr (font_face->cgFont, 1.0, NULL, NULL); + glyphPath = CTFontCreatePathForGlyphPtr (ctFont, glyph, &textMatrix);
+        CFRelease (ctFont);
+    } else {
+ glyphPath = CGFontGetGlyphPathPtr (font_face->cgFont, &textMatrix, 0, glyph);
+    }
+
     if (!glyphPath)
        return CAIRO_INT_STATUS_UNSUPPORTED;

diff --git a/src/cairo-quartz-private.h b/src/cairo-quartz-private.h
index 3ef14c3..59fc1df 100644
--- a/src/cairo-quartz-private.h
+++ b/src/cairo-quartz-private.h
@@ -57,6 +57,9 @@ typedef enum {
     DO_TILED_IMAGE
 } cairo_quartz_action_t;

+/* define CTFontRef for pre-10.5 SDKs */
+typedef const struct __CTFont *CTFontRef;
+
 typedef struct cairo_quartz_surface {
     cairo_surface_t base;

--
cgit v0.10.2


---- patch 2 -----


quartz: Ensure that CGFloat is always defined


diff --git a/src/cairo-quartz-private.h b/src/cairo-quartz-private.h
index 59fc1df..35b1d94 100644
--- a/src/cairo-quartz-private.h
+++ b/src/cairo-quartz-private.h
@@ -44,12 +44,16 @@
 #include "cairo-quartz.h"
 #include "cairo-surface-clipper-private.h"

-#ifdef CGFLOAT_DEFINED
-typedef CGFloat cairo_quartz_float_t;
+#ifndef CGFLOAT_DEFINED
+#if defined(__LP64__) && __LP64__
+typedef double CGFloat;
 #else
-typedef float cairo_quartz_float_t;
+typedef float CGFloat;
+#endif
 #endif

+typedef CGFloat cairo_quartz_float_t;
+
 typedef enum {
     DO_DIRECT,
     DO_SHADING,
--
cgit v0.10.2

--- end of patch 2 ----



When I was at module 18 (gtk), it failed due to this error:

In file included from GdkQuartzView.c:21:
GdkQuartzView.h:37: error: cannot find protocol declaration for 'NSTextInputClient'
In file included from gdkwindow-quartz.h:25,
                 from GdkQuartzWindow.c:22:
../../gdk/quartz/GdkQuartzView.h:37: error: cannot find protocol declaration for 'NSTextInputClient'
make[4]: *** [GdkQuartzWindow.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
make[4]: *** [GdkQuartzView.lo] Error 1

The NSTextInputClient protocol is defined in Mac OS 10.5+, so it wasn't available on my system. The solution to this problem could be to develop a patch that conditionally uses this protocol. Or maybe I could use and older version of GTK that did compile successfully on Mac OS 10.4. Anyone know what version that would be? I'm guessing around v3.0.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]