Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 264333 - =media-libs/alsa-lib-1.0.27: fix pkg-config file
Summary: =media-libs/alsa-lib-1.0.27: fix pkg-config file
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo ALSA team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-30 19:48 UTC by Sven 'sleipnir' Rebhan
Modified: 2013-06-05 13:06 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
pkg-config fix (alsa-lib-exec_prefix-fix.patch,364 bytes, patch)
2009-03-30 19:49 UTC, Sven 'sleipnir' Rebhan
Details | Diff
Ebuild patch (alsa-lib-1.0.17a.patch,642 bytes, patch)
2009-03-30 19:50 UTC, Sven 'sleipnir' Rebhan
Details | Diff
Reworked patch (alsa-lib-exec_prefix-fix.patch,513 bytes, patch)
2009-03-31 18:55 UTC, Sven 'sleipnir' Rebhan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sven 'sleipnir' Rebhan 2009-03-30 19:48:44 UTC
While alsa-lib compiles fine, the resulting alsa.pc file contains exec_prefix=/usr which breaks most of the cross-compile stuff related to alsa. The following patch fixes the problem and applies to at least 1.0.16-r1 and 1.0.17a.

Reproducible: Always
Comment 1 Sven 'sleipnir' Rebhan 2009-03-30 19:49:55 UTC
Created attachment 186796 [details, diff]
pkg-config fix

Fix the .pc file by quoting the prefix assignment.
Comment 2 Sven 'sleipnir' Rebhan 2009-03-30 19:50:59 UTC
Created attachment 186798 [details, diff]
Ebuild patch

Apply the patch in the ebuild and call autoreconf to really get the patch applied.
Comment 3 SpanKY gentoo-dev 2009-03-30 21:01:57 UTC
a better question would be why does exec_prefix need to be expanded in the first place ?
Comment 4 Sven 'sleipnir' Rebhan 2009-03-30 21:25:34 UTC
It doesn't need to be expanded. I guess somebody simply forgot to add the quotes.
Comment 5 SpanKY gentoo-dev 2009-03-30 22:00:53 UTC
if it doesnt need to be expanded, then why not simply remove the line from configure rather than quoting it ?
Comment 6 Sven 'sleipnir' Rebhan 2009-03-31 08:25:27 UTC
Because exec_prefix is used in the makefiles. With the quoting it is expanded there (in the makefiles), otherwise it is expanded in the config. We need the first behaviour because otherwise we get the expanded version in the .pc file.

We can't remove the line in the patch because otherwise we get an empty exec_prefix leading to libdir expansions like ${exec_prefix}/lib -> /lib and this you definitively do not want!

Btw other configure script have exactly the same line _with_ the quoting!
Comment 7 SpanKY gentoo-dev 2009-03-31 09:16:39 UTC
i still dont get it.  configure will automatically add $exec_prefix to the Makefile environment without any custom code:
Makefile.in:exec_prefix = @exec_prefix@
Makefile:exec_prefix = ${prefix}

so why does the configure script need to touch exec_prefix at all ?  an easier fix would be to delete the line completely and let the common autoconf code do its standard work.
Comment 8 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-03-31 14:47:59 UTC
ALSA upstream is not very good with autotools, I'll see if I can take care of that for them.
Comment 9 Sven 'sleipnir' Rebhan 2009-03-31 18:55:32 UTC
Created attachment 186883 [details, diff]
Reworked patch

Ha! I managed to remove the line criticize by vapier. A very subtle change is required to not get ALSA_PLUGIN_DIR=NONE/lib.
Comment 10 Sven 'sleipnir' Rebhan 2009-05-07 19:52:31 UTC
SpanKY, Diego what is the status on this? Can you please push this upstream!?
Comment 11 SpanKY gentoo-dev 2009-05-08 07:49:50 UTC
Diego said he was going to take care of it, so i havent bothered looking at anything since ... he's more than capable of taking it from here
Comment 12 Sven 'sleipnir' Rebhan 2009-05-11 19:04:04 UTC
Update: The same patch is required for alsa-lib-1.0.20.
Comment 13 Samuli Suominen (RETIRED) gentoo-dev 2013-05-01 13:39:05 UTC
(In reply to comment #12)
> Update: The same patch is required for alsa-lib-1.0.20.

Meh. Looks still the same in 1.0.27.
Comment 14 SpanKY gentoo-dev 2013-05-02 04:16:46 UTC
i've re-scanned this bug and i'm not understanding the problem.  pkg-config files (even when cross-compiled) are *supposed* to have exec_prefix set to /usr (most of the time).  well, at least set to ${prefix} which in turn is /usr.

to verify, cross-compiling alsa-utils works just fine for me.  so please post some real details as to the problem you're seeing.
Comment 15 Samuli Suominen (RETIRED) gentoo-dev 2013-05-02 07:42:23 UTC
(In reply to comment #14)
> i've re-scanned this bug and i'm not understanding the problem.

nice. i'm not alone then. that's why I didn't push the fix.
Comment 16 Sven 'sleipnir' Rebhan 2013-06-05 13:06:27 UTC
Unfortunately I don't have the time anymore to work on gentoo, but IIRC the problem is that during 'eval dir="$libdir"' the libdir (which usually contains the non-evaluated variable ${prefix}) is resolved to "/usr" and thus the resulting pkg-config file containes "exec_prefix=/usr/lib" instead of "exec_prefix=${prefix}/lib".
The patch ensures that "dir" contains the unresolved (unevaluated) string (${prefix} in this case) instead.
Beware: All of the above is from the top of my head and might be completely wrong. ;-)