#9208: Add PKG_CONFIG_PATH to sage-env so programs like matplotlib link 
properly.
----------------------------+-----------------------------------------------
   Reporter:  drkirkby      |       Owner:  drkirkby    
       Type:  defect        |      Status:  needs_review
   Priority:  major         |   Milestone:  sage-4.4.4  
  Component:  build         |    Keywords:              
     Author:  David Kirkby  |    Upstream:  N/A         
   Reviewer:                |      Merged:              
Work_issues:                |  
----------------------------+-----------------------------------------------

Comment(by drkirkby):

 Replying to [comment:8 jason]:
 > Replying to [comment:7 drkirkby]:
 > > I meant to overwrite the patch when I corrected the spelling, but
 forgot, so there is now 9208.2.patch.
 > >
 > > Are you suggesting this gets reviewed and incorporated into Sage and
 you write another patch which rewrites sage-env if Sage is moved?
 >
 > Not sage-env.  See #9210 for the patch I talked about.
 >
 > > If so, then this still needs reviewing.
 > >
 >
 > Yes.  Since I practically had the same patch, but you beat me to posting
 it, I think the review will be easy.
 >
 > I didn't check for the existence of PKG_CONFIG_PATH, though.  In what
 situation will we not want to overwrite that variable?
 >
 >
 I must admit, I did consider whether it was appropriate to simply
 overwrite PKG_CONFIG_PATH and ignore whatever the user puts. But I could
 see some benefits in allowing the user to set this.

  * If I wanted to use a later version of a library that Sage has, I would
 be able to do so by putting my libraries in a location of my choosing, and
 let Sage find them first.

  * in some cases one might have libraries that Sage lacks, but one wants
 to use with programs like matplotlib. (GTK could be an exmaple of that).

 Another possibility, is to prepend Sage's path to PKG_CONFIG_PATH, so
 things in Sage are found first, but others that exist on the system will
 be found too, since according to the man page of pkg-config on Solaris:

 {{{
 User Commands                                       pkg-config(1)

 NAME
      pkg-config  -  return  meta  information   about   installed
      libraries
 <SNIP>
      PKG_CONFIG_PATH         A   colon-separated   (on   Windows,
                              semicolon-separated)  list of direc-
                              tories to search for .pc files.  The
                              default directory is always searched
                              after searching the  path  specified
                              by   PKG_CONFIG_PATH.   The  default
                              value    of    PKG_CONFIG_PATH    is
                              libdir/pkgconfig,  where  libdir  is
                              the lib directory  where  pkg-config
                              is  installed.  On  Solaris systems,
                              libdir is /usr/lib.

 }}}

 PKG_CONFIG_PATH is a colon separated list of paths. Simply overwriting
 PKG_CONFIG_PATH would make it impossible for someone to get matplotlib to
 use their version of GTK for example in /usr/local, if they wanted that.

 Doing something about the issue with PKG_CONFIG_PATH is clearly better
 than doing noting at all, but what is best is a bit subjective. I don't
 have a strong opinion as to what is best.

 The solution here is the most flexible, as it gives the user complete
 control, but that flexibility does come at some risk. I suspect the risk
 is quite small, as I doubt many people set PKG_CONFIG_PATH themselves. If
 they do, they probably know what they are doing :)


 Dave

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9208#comment:9>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to