Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Issue 5105005: Improve pkg-config-wrapper to support ChromiumOS sysroots (Closed)

Created:
10 years, 1 month ago by piman
Modified:
9 years, 7 months ago
Reviewers:
Evan Martin
CC:
chromium-reviews
Visibility:
Public.

Description

Improve pkg-config-wrapper to support ChromiumOS sysroots http://codereview.chromium.org/4516002/show had to be reverted because it conflicts with "old style" sysroots that are still used on the arm builders. This is a cleaner approach that should work there. The previous approach assumed that all variables in .pc files were relative to |prefix|. It would be a desirable thing to have but in practice a few packages don't follow this and have already dereferenced |prefix| in other variables (e.g. |libdir|). So instead of forcing |prefix|, this version keeps the original one but strips the path before '/usr' (in |prefix|) from all returned paths before prepending the sysroot path. For example if you have foo.pc: prefix=/build/board/usr libdir=/build/board/usr/lib # instead of libdir=${prefix}/lib Libs: -L${libdir}/foo -lfoo Then instead of forcing prefix=/usr (which doesn't fix |libdir|), we find the path before '/usr' in prefix ('/build/board'), that we strip from the returned -L flag ('/build/board/usr/lib/foo' -> '/usr/lib/foo') before prepending the sysroot path (-> '/path/to/sysroot/usr/lib/foo'). BUG=None TEST=build with sysroot=/path/to/chromiumos/chroot/build/x86-generic Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=66712

Patch Set 1 #

Total comments: 2

Patch Set 2 : Add copyright+license notice, add some description #

Unified diffs Side-by-side diffs Delta from patch set Stats (+40 lines, -15 lines) Patch
M build/linux/pkg-config-wrapper View 1 1 chunk +25 lines, -4 lines 0 comments Download
M build/linux/rewrite_dirs.py View 3 chunks +15 lines, -11 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
piman
10 years, 1 month ago (2010-11-18 05:08:30 UTC) #1
Evan Martin
Can you make the review description describe what it does? http://codereview.chromium.org/5105005/diff/1/build/linux/pkg-config-wrapper File build/linux/pkg-config-wrapper (right): http://codereview.chromium.org/5105005/diff/1/build/linux/pkg-config-wrapper#newcode1 ...
10 years, 1 month ago (2010-11-18 22:19:00 UTC) #2
piman
http://codereview.chromium.org/5105005/diff/1/build/linux/pkg-config-wrapper File build/linux/pkg-config-wrapper (right): http://codereview.chromium.org/5105005/diff/1/build/linux/pkg-config-wrapper#newcode1 build/linux/pkg-config-wrapper:1: #!/bin/bash On 2010/11/18 22:19:00, Evan Martin wrote: > Can ...
10 years, 1 month ago (2010-11-18 23:05:28 UTC) #3
Evan Martin
This looks kinda fragile to me -- I wonder why we can't just fix the ...
10 years, 1 month ago (2010-11-18 23:36:11 UTC) #4
piman
10 years, 1 month ago (2010-11-19 00:20:28 UTC) #5
On Thu, Nov 18, 2010 at 3:36 PM, <evan@chromium.org> wrote:

> This looks kinda fragile to me -- I wonder why we can't just fix the .pc
> files,
>

Each of them is hard, and there's quite a few of those.
For example, one of them that's broken is gtk. The root (I think) is from
the gtk ebuild:

# need libdir here to avoid a double slash in a path that libtool doesn't
# grok so well during install (// between $EPREFIX and usr ...)
 econf --libdir="${EPREFIX}/usr/$(get_libdir)" ${myconf}

Ubuntu does it too, though they don't say why:

# configure flags
configure_flags := \
--prefix=/usr \
--libdir=/$(LIBDIR) \
 --mandir=\$${prefix}/share/man \
--infodir=\$${prefix}/share/info \
--sysconfdir=/etc \
 --enable-test-print-backend \
--enable-introspection=no \
--build=$(DEB_BUILD_GNU_TYPE)

(look at the result in /usr/lib/pkgconfig/gtk+-2.0.pc on lucid).

Now, I'm sure it's possible to fix libtool wherever it's broken, upstream
that, then patch all the relevant rules/ebuild/etc. and upstream that too,
but I'm not sure what that would break instead, and that's a lot of work for
something we can fix easily this way, and we have to live with already
existing broken .pc files.


> but the code LGTM.
>
>
> http://codereview.chromium.org/5105005/
>

Powered by Google App Engine
This is Rietveld 408576698