After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 554524 - better relocatibility of pango.modules
better relocatibility of pango.modules
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
1.14.x
Other All
: Normal normal
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks:
 
 
Reported: 2008-10-01 03:14 UTC by Owen Taylor
Modified: 2010-07-22 18:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch as described (1.42 KB, patch)
2008-10-01 03:14 UTC, Owen Taylor
none Details | Review
Add PANGO_LIBDIR and PANGO_SYSCONFDIR enviroment variables (2.44 KB, patch)
2010-07-08 19:57 UTC, Owen Taylor
committed Details | Review

Description Owen Taylor 2008-10-01 03:14:08 UTC
Right now, you can't relocate the entire Pango install tree somewhere
else just by setting environment variables... you actually have to
write out an RC file to point to your pango.modules file and then
point to the RC file with PANGO_RC_FILE.

This is pretty sucky. I'll attach a patch that makes things a little
better by adding PANGO_SYSCONFDIR and PANGO_LIBDIR environment variables
(GTK+ weirdly has GTK_SYCONFDIR and GTK_EXE_PREFIX + "/lib, I'd
rather be internally consistent than copy that.)

You might wonder then, how this avoids writing a temporary file. Don't
you still need to write a pango.modules file? It works for me because 
I wanted this on OS X and you can pass @executable_path/../lib/pango/modules/... to dlopen() there, so I put that in the pango.modules. 
But it wouldn't work on most Unix.

It would be possible:

 - Use dladdr() to locate the path to the library to avoid environment
   variables.
 - Implement a generic solution like the Win32 path-rewriting hack
   in find_or_create_module.

And then the Pango install tree could just be relocated on any Unix.
(OTOH, on Linux, people seldom want relocatable trees.)
Comment 1 Owen Taylor 2008-10-01 03:14:50 UTC
Created attachment 119701 [details] [review]
Patch as described
Comment 2 Behdad Esfahbod 2008-10-01 04:04:31 UTC
Hum, similar things have been proposed before and I turned down.  Can't do to yours :).  Making module file paths relative to pango.modules files is one step.

I don't like the dladdr approach, so lets just take your patch.  Feel free to document and commit.  Thanks.
Comment 3 Owen Taylor 2010-07-08 19:57:42 UTC
Created attachment 165515 [details] [review]
Add PANGO_LIBDIR and PANGO_SYSCONFDIR enviroment variables

Rebased to HEAD
Comment 4 Owen Taylor 2010-07-08 20:00:44 UTC
Pushed to master
Comment 5 Behdad Esfahbod 2010-07-22 18:59:38 UTC
Thanks.