1 |
On 12/23/20 8:35 AM, Jaco Kroon wrote: |
2 |
> Michael, |
3 |
> |
4 |
> I'm busy disecting what Marek has done for asterisk as I need to make |
5 |
> that work for multiple versions of net-misc/asterisk-16.14.0-r100, not |
6 |
> merely the one he did it for - perhaps that would be helpful for you as |
7 |
> well? |
8 |
> |
9 |
> I don't know lua at all. |
10 |
> |
11 |
> Anyway, I'm on IRC as jkroon if you'd like to exchange notes. I don't |
12 |
> particularly like the patch Marek did as I'll NEVER be able to push that |
13 |
> upstream. The patch will work for us, but as a policy I highly prefer |
14 |
> patches which I can get unstreamed such that we don't need to carry them |
15 |
> more than one or two versions. |
16 |
|
17 |
Agreed. This is more of a system library packaging issue than anything |
18 |
to do with Lua specifically. |
19 |
|
20 |
|
21 |
> I'd prefer to patch upstream to keep it's behaviour of detecting a lua |
22 |
> version, but have a --with-lua(version)? type argument that can take an |
23 |
> optional argument which will then be the version, but --with-* generally |
24 |
> takes a prefix where the include and lib folders can be found ... and |
25 |
> I'd prefer to depend on pkg-config as primary and fallback to the |
26 |
> ./configure mess which tries to guess at things ... |
27 |
> |
28 |
|
29 |
This is exactly what I'm trying to get across. Support for multiple |
30 |
versions of libraries in weird locations is not a new thing. Generally, |
31 |
you can put CPPFLAGS="-I/foo/bar" and LIBS="-L/baz/quux" before running |
32 |
./configure and everything will just work with your header files and |
33 |
libraries in the non-standard paths /foo/bar and /baz/quux, |
34 |
respectively. Those paths take precedence over the defaults (if used |
35 |
correctly...), so you can use them to override the default version of a |
36 |
library and compile/link against a specific copy if you need to do that. |
37 |
Likewise, one could prepend a path to PKG_CONFIG_PATH to override the |
38 |
version that will be detected via pkg-config. |
39 |
|
40 |
The problem that we've gotten ourselves into is that we've copied Debian |
41 |
by not only relocating the library, but renaming it (and its *.pc file) |
42 |
entirely. There is no good way to tell an autotools build system that |
43 |
you've renamed a library completely, and that it should prefer the |
44 |
renamed version over the standard one if the standard one also exists. |
45 |
|
46 |
If you want to build against the eselected version of Lua on Gentoo, |
47 |
then eselect-lua makes everything OK. It creates symlinks from the |
48 |
standard names to the nonstandard ones, and everything just works. But |
49 |
if you want to build against a specific, not-eselected version of Lua? |
50 |
You have to tell the build system what to do. The eselected version |
51 |
lives in the correct locations (via those symlinks), so the build system |
52 |
is going to want to find that first. If the eselected version is not the |
53 |
one you want to build against,.... oops. Then, since the version you |
54 |
*do* want to link against has the wrong name, you have to tell the build |
55 |
system to link against it somehow. You can't simply override the |
56 |
PKG_CONFIG_PATH, because our *.pc files have the wrong names. You can't |
57 |
just override the library search path, because our libraries have the |
58 |
wrong names. |
59 |
|
60 |
The work I've done so far for OpenDKIM does nothing to address these |
61 |
larger problems. If lua.pc is on the system, it will get used first, |
62 |
regardless of the version you actually want to build against. AFAIK |
63 |
there's no good way around this without patching. |
64 |
|
65 |
If the libraries (and pkg-config files?) were installed to |
66 |
subdirectories instead, then the standard method of overrides could be |
67 |
used to build against a specific version, rather than requiring every |
68 |
upstream build system to support our weird layout. |