[Scribus] [Patch] MacOSX native

Craig Ringer craig
Mon Mar 14 10:35:32 CET 2005


On Mon, 2005-03-14 at 10:06 +0100, Martin Costabel wrote:
 
> > Martin, do you patch Scribus in any way to make plug-ins work in fink?
> 
> Of course I do. The kde admin system knows how to make dylibs for 
> darwin, but not how to make plugins. Ben Reed (the only person who knows 
> how to build kde on Mac OS X) usually replaces the whole admin directory 
> by a heavily patched one so that kde build plugins correctly, but for 
> scribus I am getting away with a one-line perl patch command. I have 
> been doing this since scribus-0.8 which, if I remember correctly, was 
> the first one that actually worked on Mac OS X. The funny thing is that 
> Qt/Mac builds its own plugins (in plugins/designer and 
> plugins/imageformats) correctly without further aid. You could perhaps 
> study their build system.

I certainly will. Thanks for the tips.

> You have to understand the distinction - which doesn't exist on linux - 
> between dynamic libraries (*.dylib) and modules (*.so). The former 
> cannot be unloaded, the latter can. Plugins tradidionally use the .so 
> extension.

Thanks .. that makes quite a bit more sense now. The Apple "porting from
UNIX" docs could use a whole chapter on plugins and dynamic linking by
the looks ... but they only have one short page.

> Besides the fix for building plugins, there are quite a few other 
> patches I have had to apply always. Most of them concern libraries that 
> are detected by configure correctly, but then for some reason or other 
> are not or only incompletely placed on the linker line in the Makefiles. 
> This concerns libxml2, libtiff, libcups, libfreetype, libqt-mt.

Interesting; I haven't had any issues with any of those except Qt. I did
have trouble with libjpeg (it wasn't finding the includes by default)
and with Qt (had to remove the -framework lines from the deps in 
libqt-mt.la because libtool doesn't understand them), but otherwise it
all went fine.

Oh, fontconfig wasn't detected without
	LDFLAGS=" -lfreetype -lexpat "
either. It actually looks like a problem with the .pc file shipped by
fontconfig, but we may need to work around it.

> Some of these patches for library detection would not be needed on a 
> virgin system where you only build Scribus and its dependencies and no 
> other software and where you can place everything into standard 
> /usr/local places, but this is not an option for Fink, and not an option 
> for me.

I built everything in $HOME/sw, except Qt/Mac which I put in 
$HOME/qt-mac-free . I had no issues.

That said, if there are issues building against fink-supplied libs I'll
need to look into integrating the required fixes (assuming they can be
done without breaking or massively uglifying other platforms).

> Another patch concerns the strndup() function that doesn't exist here, 
> but isn't really needed and can be replaced by strdup().

Sure. Do you know what str*dup functions _are_ present on OS/X ?

> The final long-standing patch comes from the fact that the Apple 
> compiler seems to be more picky about the distinction between "char" and 
> "const char" than what Scribus developers seem to be using.

A whole bunch of const-ness fixes went in a while ago. Still, some cases
are tricky - especially the Python/C API which is *incredibly* lax with
the constness of its inputs.

Are the fixes needed for correct compilation, or just to shut up the
compiler? If the latter, there are quite a few const-ness warnings in
the current Scribus codebase that we should fix some time. Priorities,
priorities. If your patch does so, I'm interested.

-- 
Craig Ringer





More information about the scribus mailing list