#10202: Use pkg-config --define-variable option to set ${SAGE_ROOT} anytime pkg-
config is invoked
------------------------------+---------------------------------------------
Reporter: jason | Owner: leif
Type: enhancement | Status: needs_review
Priority: critical | Milestone: sage-4.7.1
Component: packages | Keywords:
Work_issues: | Upstream: N/A
Reviewer: Leif Leonhardy | Author: Jason Grout
Merged: | Dependencies:
------------------------------+---------------------------------------------
Comment(by leif):
''Unfortunately my reasoning is now spread across a few tickets...'' 8/
First of all, we don't have to wrap `pkg-config`, which would not
necessarily be available during the whole build (including upgrades), and
doing so might confuse [dumb] build scripts testing for its presence on
systems that lack a "real" `pkg-config`.
I now seem to recall why using `${SAGE_ROOT}` without explicitly defining
it in the `.pc` files "worked for me" last year -- I was using
`$${SAGE_ROOT}`, which postpones expansion to the shell, like it does in
Makefiles.
But there is an even safer way (cf. [comment:ticket:11687:1 this comment]
at #11687), namely to define the environment variable
`PKG_CONFIG_TOP_BUILD_DIR` in `sage-env` and use the corresponding
`.pc`-file variable `pc_top_builddir` (instead of `SAGE_ROOT`) in all
`.pc` files, e.g.
{{{
#!sh
# We set PKG_CONFIG_TOP_BUILD_DIR to $SAGE_ROOT in sage-env,
# such that ${pc_top_builddir} always yields this.
prefix=${pc_top_builddir}/local
...
# All further directory definitions are relative to ${pc_top_builddir}
# or ${prefix}.
}}}
Substitutions in ("initialization" of) `.pc` files should IMHO be
performed from or better directly within `sage-spkg` (or an spkg's `spkg-
install` if necessary), of course not "fixing" individual files more than
once. We then can drop the `pkg-config`-related code in `sage-location`
completely, or otherwise have to make sure it is consistent with the other
one, i.e. doesn't mess things up afterwards (as it currently does).
We also have to fix setting `PKG_CONFIG_PATH` in `sage-env`; see #11687.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10202#comment:26>
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.