#16274: include system pkgconfig path
-------------------------------------+-------------------------------------
       Reporter:  vbraun             |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  blocker            |    Milestone:  sage-6.2
      Component:  build              |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Volker Braun       |    Reviewers:  Leif Leonhardy
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/vbraun/include_system_pkgconfig_path|  
0afd5c5aaaf349c4314c5067800924c24a9e2713
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by leif):

 Ah, yes:
 {{{
        If  the name is neither a shell function nor a builtin, and
 contains no
        slashes, bash searches each element of the PATH for  a  directory
 con‐
        taining  an  executable  file  by that name.  Bash uses a hash
 table to
        remember the full pathnames of executable files (see hash  under
 SHELL
        BUILTIN  COMMANDS  below).  A full search of the directories in
 PATH is
        performed only if the command is not found in the hash table. [...]
 }}}
 (And subshells inherit the cache.)

 [[BR]]

 {{{
 #!diff
 diff --git a/build/pkgs/pkgconf/spkg-install b/build/pkgs/pkgconf/spkg-
 install
 index e31009b..166008e 100755
 --- a/build/pkgs/pkgconf/spkg-install
 +++ b/build/pkgs/pkgconf/spkg-install
 @@ -38,8 +38,17 @@ if [ $? -ne 0 ]; then
  fi

  # pkgconf is an alternative to the "official" pkg-config, and does not
 -# automatically install a "pkg-config" binary.
 -rm -f "$SAGE_LOCAL/bin/pkg-config"   # delete old version
 +# automatically install a "pkg-config" binary, so we used to install
 +# a symbolic link (now replaced by a wrapper script).
 +rm -f "$SAGE_LOCAL/bin/pkg-config"   # delete old version (script or
 symlink)
 +
 +# Let bash forget where it previously saw 'pkg-config', otherwise we
 might
 +# end up in an infinite loop if 'command -v pkg-config' gives Sage's
 script,
 +# such that the below generated script finally calls itself:
 +builtin hash -d pkg-config 2>/dev/null
 +
 +# Generate a wrapper script which either calls Sage's 'pkgconf' or a
 system-
 +# wide 'pkg-config' if present (hardcoding its location at creation
 time):
  m4 ../patches/pkg-config.in > "$SAGE_LOCAL/bin/pkg-config"
  if [ $? -ne 0 ]; then
      echo >&2 "Error creating the pkg-config script."
 }}}
 doesn't yet work for me...

--
Ticket URL: <http://trac.sagemath.org/ticket/16274#comment:32>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to