roc-streaming / roc-toolkit

Real-time audio streaming over the network.
https://roc-streaming.org
Mozilla Public License 2.0
1.03k stars 205 forks source link

pkg-config installation assumes that PKG_CONFIG_PATH consists of a single directory #503

Closed bgamari closed 1 year ago

bgamari commented 1 year ago

Currently the logic for installing roc.pc is as follows:

https://github.com/roc-streaming/roc-toolkit/blob/127cfc645d0a807a33506001367b6d9a9d46f23e/src/SConscript

This assumes that PKG_CONFIG_PATH contains the path of a single directory, where the .pc file should be installed. However, in general PKG_CONFIG_PATH may be a colon-delimited list of paths to be searched for .pc files. I believe the correct behavior would be to rather do something like the following:

diff --git a/src/SConscript b/src/SConscript
index b59f67a7..9f16e0a2 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -141,7 +141,7 @@ if not GetOption('disable_shared') or GetOption('enable_static') or GetOption('e
                 desc='Real-time audio streaming over the network.',
                 url='https://roc-streaming.org',
                 version=env['ROC_VERSION'])
-            env.AddDistFile(env['PKG_CONFIG_PATH'], pc_file)
+            env.AddDistFile(os.path.join(env['ROC_SYSTEM_LIBDIR'], 'pkgconfig'), pc_file)

 if GetOption('enable_examples'):
     examples_env = subenvs.examples.Clone()
gavv commented 1 year ago

Hi, thanks for report and patch!

Agree with the solution. I've pushed a fix based on it to develop: c64c349b9a8137ad0b30e28d267a369bf5378983

I'll keep this issue open until a release is tagged with this fix (I hope in upcoming week or two).

gavv commented 1 year ago

Tagged v0.2.2 with this fix.