How to sane replace a path in a pkgconfig file ?
Hi all,
currently I am working on fixing blackbox. I had to add a lot of includes to fix compiler errors.
After fixing the compiler errors I came over a sed error of the recipe. sed was not able to find the pc file but the recipe inherits pkgconfig.
----snipped of blackbox_0.70.1.bb----
#fix path of pc file
do_install_append() {
sed -i s#${STAGING_LIBDIR}#${libdir}#g ${D}/${libdir}/pkgconfig/libbt.pc
}do_stage () {
sed -i s#${STAGING_LIBDIR}#${libdir}#g ${STAGING_LIBDIR}/pkgconfig/libbt.pc
}It looks like the pkgconfig class is called after do_stage()? What is the right place to replace the wrong path in the libbt.pc file?
I changed the above to this:
#fix path of pc file
do_install_prepend() {
sed -i s#${STAGING_LIBDIR}#${libdir}#g ${S}/lib/libbt.pc
}But I am not sure if this is safe! Is there any place where the original path in the pkconfig file is needed? With my approach this file would have the wrong path inside.
What do you think about it? I am looking forward to any advice :)
Best regards
Bernhard Guillon
Quoted 2 lines · On Sun, Feb 14, 2010 at 03:23:09PM +0100, [email protected] wrote:
Hi all,
currently I am working on fixing blackbox. I had to add a lot of includes to fix compiler errors.
I have an import of the CVS tree here, fyi:
http://git.busybox.net/~aldot/git/blackboxwm/
http://git.busybox.net/~aldot/git/bbkeys/
There were a couple of debian's patches applied (still by brad), i'd recommend to use all blackbox-0.70.1..master patches and base off that.
HTH,
Re: = ? UTF-8 ? B ? Ww== ? =oe= ? UTF-8 ? B ? XQ== ? = How to sane replace a path in a pkgconfig file ?
Quoted 11 lines · On Sun, Feb 14, 2010 at 03:23:09PM +0100, [email protected] wrote:
Quoted 2 lines
Hi all,
currently I am working on fixing blackbox. I had to add a lot of includes to fix compiler errors.I have an import of the CVS tree here, fyi:
http://git.busybox.net/~aldot/git/blackboxwm/
http://git.busybox.net/~aldot/git/bbkeys/There were a couple of debian's patches applied (still by brad), i'd recommend to use all blackbox-0.70.1..master patches and base off that.
Hi,
thanks for the hint, the debian patch for the includes looks like mine so I will use the debian patch for updating the recipe :)
But my problem is not the compiler errors but openembeddeds pkgconfig class.
When will pkgconfig be called? Before or after do_stage()? What is the right function to place the code of replacing the wrong path of the pkgconfig file? The original package does it in do_stage() but it seems at least on my build system that pkgconfig class is called after do_stage(). Also is it safe to just replace the path in pkgconfig files in do_install_prepend()? Because then there is no file with the build path.
So I need a function which gets called after pkgconfig class?
Best regards
Bernhard Guillon
Re: = ? UTF-8 ? B ? Ww== ? =oe= ? UTF-8 ? B ? XQ== ? = How to sane replace a path in a pkgconfig file ?
Quoted 8 lines · On Sun, Feb 14, 2010 at 06:33:45PM +0100, [email protected] wrote:
Quoted 8 lines · On Sun, Feb 14, 2010 at 03:23:09PM +0100, [email protected] wrote:
Quoted 2 lines
Hi all,
currently I am working on fixing blackbox. I had to add a lot of includes to fix compiler errors.I have an import of the CVS tree here, fyi:
http://git.busybox.net/~aldot/git/blackboxwm/
http://git.busybox.net/~aldot/git/bbkeys/
Quoted 8 lines
Quoted 3 lines
There were a couple of debian's patches applied (still by brad), i'd recommend to use all blackbox-0.70.1..master patches and base off that.
Hi,
thanks for the hint, the debian patch for the includes looks like mine so I will use the debian patch for updating the recipe :)But my problem is not the compiler errors but openembeddeds pkgconfig class.
I'm aware of that but unfortunately i can't help you with the pkgconfig class.
Quoted 1 line
When will pkgconfig be called? Before or after
do_stage()? What is the right function to place the code of replacing the wrong path of the pkgconfig file? The original package does it indo_stage()but it seems at least on my build system that pkgconfig class is called afterdo_stage().
classes/pkgconfig.bbclass suggests that .pc are fixed up in do_install_prepend() (why does the efl class duplicate this, btw?) and that this depends on stage.
btw.. someone should
sed -i -e s/vw/w/ docs/usermanual/reference/class_pkgconfig.xml
Quoted 3 lines
Also is it safe to just replace the path in pkgconfig files in
do_install_prepend()? Because then there is no file with the build path.So I need a function which gets called after pkgconfig class?
I'd try to remove that explicit .pc handling from blackbox and see what happens and start from there (i.e. don't know yet).
cheers,
Bernhard
Re: = ? UTF-8 ? B ? Ww== ? =oe= ? UTF-8 ? B ? XQ== ? = How to sane replace a path in a pkgconfig file ?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 3 lines · Bernhard Reutner-Fischer
classes/pkgconfig.bbclass suggests that .pc are fixed up in
do_install_prepend()(why does the efl class duplicate this, btw?) and that this depends on stage.
Because the efl classes suck, they also override things like PACKAGES. With new-style staging and the current state of e svn we should be able to get rid of that crap altogether.
That reminds me, I wanted to add
do_configure_prepend() {
autopoint
}
to those clase to make the modules build again.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
iD8DBQFLeFscMkyGM64RGpERAi25AKCtuADXMEd569iE9OeUE6Yc6kXfTQCdEw2b 35Qg7/ZldiOSulSB71Pbo44=
=kiKn
-----END PGP SIGNATURE-----
Re: = ? UTF-8 ? B ? Ww== ? =oe= ? UTF-8 ? B ? XQ== ? = How to sane replace a path in a pkgconfig file ?
Quoted 8 lines
Quoted 3 lines
classes/pkgconfig.bbclass suggests that .pc are fixed up in
do_install_prepend()(why does the efl class duplicate this, btw?) and that this depends on stage.Because the efl classes suck, they also override things like PACKAGES. With new-style staging and the current state of e svn we should be able to get rid of that crap altogether.
Quoted 7 lines
That reminds me, I wanted to add
do_configure_prepend(){
autopoint
}to those clase to make the modules build again.
I found the problem for blackbox. The path is in -rlink-path and this is currently ignored by pkgconfig.bbclass.
This fixed it on my system but I have no clue if this is a good idea at all :D
classes/pkgconfig.bbclass +1 -1
@@ -3,7 +3,7 @@ DEPENDS_prepend = "pkgconfig-native " do_install_prepend () { for i in `find ${S}/ -name "*.pc" -type f` ; do - sed -i -e 's:-L${STAGING_LIBDIR}::g' -e 's:-I${STAGING_INCDIR}::g' $i + sed -i -e 's:-L${STAGING_LIBDIR}::g' -e 's:-I${STAGING_INCDIR}::g' -e 's:-rpath-link,${STAGING_LIBDIR}::g' $i done }
Should I prepare a proper patch for pkgconfig.bbclass and send it to the list or is this approach the wrong way?
Best regards
Bernhard Guillon
Re: = ? UTF-8 ? B ? Ww== ? =oe= ? UTF-8 ? B ? XQ== ? = How to sane replace a path in a pkgconfig file ?
Quoted 28 lines · On Sun, Feb 14, 2010 at 09:38:51PM +0100, [email protected] wrote:
Quoted 8 lines
Quoted 3 lines
classes/pkgconfig.bbclass suggests that .pc are fixed up in
do_install_prepend()(why does the efl class duplicate this, btw?) and that this depends on stage.Because the efl classes suck, they also override things like PACKAGES. With new-style staging and the current state of e svn we should be able to get rid of that crap altogether.
Quoted 7 lines
That reminds me, I wanted to add
do_configure_prepend(){
autopoint
}to those clase to make the modules build again.
I found the problem for blackbox. The path is in -rlink-path and this is currently ignored by pkgconfig.bbclass.
This fixed it on my system but I have no clue if this is a good idea at all :D
classes/pkgconfig.bbclass +0
-0@@ -3,7 +3,7 @@ DEPENDS_prepend = "pkgconfig-native " do_install_prepend () {for i in
find ${S}/ -name "*.pc" -type f; do
classes/pkgconfig.bbclass DEPENDS_prepend = "pkgconfig-native " · line 6
Quoted 2 lines
classes/pkgconfig.bbclass +1
-1- sed -i -e 's:-L${STAGING_LIBDIR}::g' -e 's:-I${STAGING_INCDIR}::g' $i + sed -i -e 's:-L${STAGING_LIBDIR}::g' -e 's:-I${STAGING_INCDIR}::g' -e 's:-rpath-link,${STAGING_LIBDIR}::g' $i
I'd go for plain
sed -i -e 's:${STAGING_LIBDIR}::g' -e 's:${STAGING_INCDIR}::g' $i
to avoid massaging -rpath / -Y / --library-path et al later on.
Quoted 5 lines
done
}Should I prepare a proper patch for pkgconfig.bbclass and send it to the list or is this approach the wrong way?
Re: = ? UTF-8 ? B ? Ww== ? =oe= ? UTF-8 ? B ? XQ== ? = How to sane replace a path in a pkgconfig file ?
Quoted 4 lines · Bernhard Reutner-Fischer
I'd go for plain
sed -i -e 's:${STAGING_LIBDIR}::g' -e 's:${STAGING_INCDIR}::g' $ito avoid massaging -rpath / -Y / --library-path et al later on.
Does that actually work? I would have thought it would leave you with a load of surplus "-L" and "-I" options with missing arguments.
p.
Re: = ? UTF-8 ? B ? Ww== ? =oe= ? UTF-8 ? B ? XQ== ? = How to sane replace a path in a pkgconfig file ?
Quoted 8 lines · Phil Blundell
Quoted 4 lines · Bernhard Reutner-Fischer
I'd go for plain
sed -i -e 's:${STAGING_LIBDIR}::g' -e 's:${STAGING_INCDIR}::g' $ito avoid massaging -rpath / -Y / --library-path et al later on.
Does that actually work? I would have thought it would leave you with a load of surplus "-L" and "-I" options with missing arguments.
It wouldn't, you're right.
So either come up with a stanza that lists all path-touching tokens explicitly or write a sed/awk script that does that -- i'd be surprised if nobody wrote something like that yet since that's a pretty common thing to do.
Re: = ? UTF-8 ? B ? Ww== ? =oe= ? UTF-8 ? B ? XQ== ? = How to sane replace a path in a pkgconfig file ?
Quoted 2 lines · Bernhard Reutner-Fischer
So either come up with a stanza that lists all path-touching tokens explicitly or write a sed/awk script that does that -- i'd be surprised
wait.. we're in python-land, so this should be fairly easy and straight forward.
Re: = ? UTF-8 ? B ? Ww== ? =oe= ? UTF-8 ? B ? XQ== ? = How to sane replace a path in a pkgconfig file ?
In reply to [email protected]classes/pkgconfig.bbclass DEPENDS_prepend = "pkgconfig-native " · line 7
Quoted 4 lines · On Sun, 2010-02-14 at 21:38 +0100, [email protected] wrote:
for i in
find ${S}/ -name "*.pc" -type f; doclasses/pkgconfig.bbclass +1
-1- sed -i -e 's:-L${STAGING_LIBDIR}::g' -e 's:-I${STAGING_INCDIR}::g' $i + sed -i -e 's:-L${STAGING_LIBDIR}::g' -e 's:-I${STAGING_INCDIR}::g' -e 's:-rpath-link,${STAGING_LIBDIR}::g' $i done
That probably is a reasonable thing to do, but you might want to filter out the preceding "-Wl," as well.
p.
Re: = ? UTF-8 ? B ? Ww== ? =oe= ? UTF-8 ? B ? XQ== ? = How to sane replace a path in a pkgconfig file ?
Quoted 9 lines · Phil Blundell
classes/pkgconfig.bbclass DEPENDS_prepend = "pkgconfig-native " · line 7
Quoted 4 lines · On Sun, 2010-02-14 at 21:38 +0100, [email protected] wrote:
for i in
find ${S}/ -name "*.pc" -type f; doclasses/pkgconfig.bbclass +1
-1- sed -i -e 's:-L${STAGING_LIBDIR}::g' -e 's:-I${STAGING_INCDIR}::g' $i + sed -i -e 's:-L${STAGING_LIBDIR}::g' -e 's:-I${STAGING_INCDIR}::g' -e 's:-rpath-link,${STAGING_LIBDIR}::g' $i doneThat probably is a reasonable thing to do, but you might want to filter out the preceding "-Wl," as well.
Note its pkgconfig we're talking about here which should never be putting this stuff in its .pc files in the first place as it has some understanding of sysroots. Usually if these things are creeping in, its due to dependencies being added as via its expanded cflags/libs lines rather than as a true dependency.
I'm not sure how it copes with --rpath-link though. If that is breaking, we should consider fixing pkgconfig itself.
Cheers,
Richard