-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
meson: Improve library detection #132
meson: Improve library detection #132
Conversation
|
Ops sorry, I prepared the commit messages in a separate editor, and must have pasted the wrong text there. I'll fix it later while rebasing this patch.
In FreeBSD the library is installed as
In this case I used As far as I can see OTOH faad does provide a
I admit I did not check this, and it is actually failing to find it, so I will also fix this one. This library is also not providing a I'll rebase this patch adding the required fixes. Thanks for you feedback! |
Regarding faad, I guess the patch can be generalized and the same detection used for all OSes. I'm unable to test this properly though. |
I have checked the packages on Arch Linux. All of them (faad2, LIRC, lame) ship a pkgconfig file. My idea was to use an approach like shown below. First search with See also: https://mesonbuild.com/Reference-manual_returned_compiler.html#compilerfind_library Would you do this for all three libraries? Also include a "meson: " prefix in the commit message. Thanks. diff --git a/src/lirc/meson.build b/src/lirc/meson.build
index 9d214bb31..475f8b00d 100644
--- a/src/lirc/meson.build
+++ b/src/lirc/meson.build
@@ -1,13 +1,17 @@
-lirc_dep = cxx.find_library('lirc', required: false)
-have_lirc = lirc_dep.found() and cxx.has_header('lirc/lirc_client.h')
+lirc_dep = dependency('lirc', required: false)
+if not lirc_dep.found()
+ lirc_dep = cxx.find_library('lirc_client', has_headers: 'lirc/lirc_client.h',
+ dirs: ['/usr/local/lib'], required: false)
+endif
+
+have_lirc = lirc_dep.found()
if have_lirc
shared_module('lirc',
'lirc.cc',
dependencies: [audacious_dep, glib_dep, lirc_dep],
name_prefix: '',
- link_args: ['-llirc_client'],
install: true,
install_dir: general_plugin_dir
) |
@radioactiveman Good idea! As far as I can see the lirc project distribution itself does not include a pc file, and the FreeBSD port is not adding one. Anyway, sure I'll update the patch with the suggested behavior. |
- Try to detect via pkgconfig using `depandency()` - Fallback to `cxx.find_library()` for library detection adding the `/usr/local/bin` path required by FreeBSD - Remove unneeded `link_args: ['-llirc_client']`, required arguments provided by detection via `dependency()` or `cxx.find_library()`
export LIBRARY_PATH=/usr/local/lib
meson setup build
meson compile -C build |
I would much prefer the |
I was not aware of this. I'll change that.
✅
Should work in FreeBSD, I need to do some testing though, but it does look cleaner on my side too, since, in the FreeBSD ports tree, /usr/local/can be changed by the user a t build time and I have been using substitutions for now. I'll also update audacious-media-player/audacious#60 ro use |
I confirm using LIBRARY_PATH works fine for me, so I have updated the patch. |
Assuming CI passes, this looks good to me. |
Pushed as bf40a4b with minor clean-ups. Thanks again @madpilot78 for your contribution. |
- Expose OPUS option and enable it by default - Fix lame detection which enables mp3 filewriter plugin (suggested by upstream developer Thomas Lange) Obtained from: audacious-media-player/audacious-plugins#132
Fix detection of some libraries in FreeBSD
pkgconfig
to detectfaad
(usingfaad2.pc
)mp3lame
andlirc_client
in/usr/local/lib
on FreeBSDlink_args: ['-llirc_client']
, required arguments provided bycxx.find_library()