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 328291 - pango/examples use installed pango.modules if available
pango/examples use installed pango.modules if available
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks:
 
 
Reported: 2006-01-23 13:00 UTC by Behdad Esfahbod
Modified: 2006-01-23 19:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (39.02 KB, patch)
2006-01-23 16:19 UTC, Behdad Esfahbod
none Details | Review

Description Behdad Esfahbod 2006-01-23 13:00:26 UTC
Currently, the examples in pango/examples use the installed pango.modules if it's available.  That means, if you compile and install pango, then modify the modules, the examples still use the installed modules, not the modified ones.  That's a bit confusing when developing the modules...

Seems like setting PANGO_RC_FILE=./pangorc fixes that.  One way would be to set PANGO_RC_FILE using putenv in the examples, but a better fix is to make the libtool wrapper for the examples set this.  I'm investigating how this can be done using libtool.  If no official way exists, we can patch the wrappers...
Comment 1 Behdad Esfahbod 2006-01-23 14:13:38 UTC
The problem with doing putenv is that it doesn't work for out-of-tree builds...

The easiest way I see so far is patching libtool.  That's far easier than patching the wrappers.
Comment 2 Behdad Esfahbod 2006-01-23 14:56:18 UTC
thomasvs suggests another solution, to define the srcdir as a C macro and look for pangorc in that directory first in the examples.  jdahlin suggests using relative path to srcdir.
Comment 3 Behdad Esfahbod 2006-01-23 15:37:45 UTC
Owen, is it too harsh if pango looks for ./pangorc or ./.pangorc unconditionally? 
That way we can rename pangorc to pangorc.in and add a rule to Makefile to cp/ln/whatever pangorc.in to (.)pangorc.  That solves the srcdir problem.  For now I'm going to putenv PANGO_RC_FILE=./pangorc to solve the problem.

BTW, I moved examples/pango.modules and tests/pango.modules to modules/pango.modules.
Comment 4 Behdad Esfahbod 2006-01-23 15:39:54 UTC
Am I correct that we don't nee examples/pangox.aliases anymore?
Comment 5 Behdad Esfahbod 2006-01-23 16:19:12 UTC
Created attachment 57951 [details] [review]
patch

This is the patch I'm committing.  Works perfect here.
Comment 6 Behdad Esfahbod 2006-01-23 16:27:37 UTC
2006-01-23  Behdad Esfahbod  <behdad@gnome.org>

        Make tests/examples do use generated pango.modules. (bug #328291)

        * examples/pangorc, tests/pangorc: Removed. Moved to modules/.

        * examples/pangox.aliases: Removed. Moved to pango/.

        * examples/Makefile.am, tests/Makefile.am: Remove pango.modules
        creation stuff, copy pangorc from $(srcdir)/../modules/pangorc
        insteadd.

        * examples/renderdemo.c: Add --pangorc option, default to ./pangorc.
        Setenv PANGO_RC_FILE to whatever pangorc file decided.

        * tests/*.c: Setenv PANGO_RC_FILE to ./pangorc.

        * pango/pangox.aliases: Added.

        * pango/Makefile.am: Install pangox.aliases.

        * modules/pangorc: Added.

        * modules/Makefile.am: Create pango.modules.  Added pangorc.

        * modules/.cvsignore, examples/.cvsignore, tests/.cvsignore: Updated.

Comment 7 Owen Taylor 2006-01-23 18:54:52 UTC
Pango should not look for files relative to the path by default.
This tends to make security nuts really grumpy. (It's effectively
having . in your path in a hidden way.)
Comment 8 Behdad Esfahbod 2006-01-23 19:01:43 UTC
Yup, true.  You can load a module that rewrites the strings, w00t.