After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 794350 - meson: fix ladspa dependencies
meson: fix ladspa dependencies
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal minor
: 1.15.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-03-15 10:41 UTC by Patrik Nilsson
Modified: 2018-03-27 13:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch that fixes meson dependency issues with ladspa (1.76 KB, patch)
2018-03-15 10:44 UTC, Patrik Nilsson
needs-work Details | Review
Patch file with fixed author name (1.76 KB, patch)
2018-03-15 10:53 UTC, Patrik Nilsson
none Details | Review
Fix optional lrdf_dep dependency (1.85 KB, patch)
2018-03-27 07:22 UTC, Patrik Nilsson
none Details | Review
meson: Add missing optional lrdf dep to ladspa build (925 bytes, patch)
2018-03-27 08:57 UTC, Nirbheek Chauhan
committed Details | Review

Description Patrik Nilsson 2018-03-15 10:41:03 UTC
I want to use meson, since it enables me to build and install only the few plugins I need.

However, in reality to build the libgstladspa.so target I must first build libxml2, raptor2 and lrdf. This is not consistent with the autotools implementation which treats lrdf as an optional dependency.

The bottom line is, requiring lrdf defeats the purpose of saving time if you really don't need lrdf.

There is also an issue with not checking for ladspa.h which could cause an unexpected build failure if the ladspa sdk is not installed.
Comment 1 Patrik Nilsson 2018-03-15 10:44:11 UTC
Created attachment 369723 [details] [review]
Patch that fixes meson dependency issues with ladspa
Comment 2 Tim-Philipp Müller 2018-03-15 10:50:47 UTC
Comment on attachment 369723 [details] [review]
Patch that fixes meson dependency issues with ladspa

Thanks for the patch. Please amend the patch author with your actual name, thanks! (git commit --amend --author='Name <foo@bar.com>')
Comment 3 Patrik Nilsson 2018-03-15 10:53:12 UTC
Created attachment 369725 [details] [review]
Patch file with fixed author name

You are so fast! I was just about to fix this :)
Comment 4 Sebastian Dröge (slomo) 2018-03-19 09:29:32 UTC
Looks good to me and we should probably get this in before the release. Tim?
Comment 5 Tim-Philipp Müller 2018-03-19 09:53:35 UTC
I think it can wait until .1, sorry :)
Comment 6 Sebastian Dröge (slomo) 2018-03-22 07:51:12 UTC
commit e61e840d099b6624cde54993780378564649a23d (HEAD -> master)
Author: Patrik Nilsson <asavartzeth@gmail.com>
Date:   Mon Mar 5 17:43:26 2018 +0100

    meson: fix ladspa dependencies
    
    There are two issues, both related to dependency checking with the meson
    support for the ladspa plugin.
    
    With autotools, lrdf is handled like an optional dependency. But with
    meson it is required. This makes the meson support less flexible and
    inconsistent with autotools.
    
    When autotools is used it properly checks if ladspa.h is available.
    But with meson it does not, instead it treats lrdf as the main
    dependency. This could cause a build failure if lrdf is installed, but
    the ladspa sdk is not.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=794350
Comment 7 Nicolas Dufresne (ndufresne) 2018-03-26 18:17:19 UTC
Review of attachment 369725 [details] [review]:

::: ext/ladspa/meson.build
@@ +20,3 @@
     link_args : noseh_link_args,
     include_directories : [configinc, libsinc],
+    dependencies : [gstaudio_dep, gstbase_dep, gmodule_dep, mathlib],

You forgot lrdf_dep here, which now causes:

 /usr/include/lrdf.h:8:10: erreur fatale: raptor.h : No such file or directory
Comment 8 Patrik Nilsson 2018-03-27 07:22:43 UTC
Created attachment 370172 [details] [review]
Fix optional lrdf_dep dependency

You're right. Although re-adding lrdf_dep to the dependencies list would defeat the point of making it optional.

The patch has been fixed and tested thoroughly against 1.14.0, with and without lrdf.
Comment 9 Nirbheek Chauhan 2018-03-27 08:29:48 UTC
Review of attachment 370172 [details] [review]:

You mention in the commit message that `ladspa.h` is not checked in the Meson build, but your commit doesn't add that? Shouldn't there also be a cc.has_header() check for it?

See: http://mesonbuild.com/Reference-manual.html#compiler-object
Comment 10 Nirbheek Chauhan 2018-03-27 08:31:36 UTC
Another thing you can do is:

lrdf_dep = dependency('lrdf', required : false)
if not lrdf_dep.found()
  lrdf_dep = []
else
  ...
endif

Meson flattens dependency lists automatically.
Comment 11 Nirbheek Chauhan 2018-03-27 08:32:18 UTC
(In reply to Nirbheek Chauhan from comment #10)
> Another thing you can do is:
> 
> lrdf_dep = dependency('lrdf', required : false)
> if not lrdf_dep.found()
>   lrdf_dep = []
> else
>   ...
> endif
> 
> Meson flattens dependency lists automatically.

Another thing is that you don't need to do that even. Not-found not-required dependencies are just ignored by Meson, so you don't need to assign [] to it.
Comment 12 Nirbheek Chauhan 2018-03-27 08:57:37 UTC
Created attachment 370177 [details] [review]
meson: Add missing optional lrdf dep to ladspa build

My comments were wrong, I am blind. This change is enough to fix things.
Comment 13 Nirbheek Chauhan 2018-03-27 08:59:02 UTC
Attachment 370177 [details] pushed as 5d2674f - meson: Add missing optional lrdf dep to ladspa build
Comment 14 Nicolas Dufresne (ndufresne) 2018-03-27 13:41:57 UTC
Review of attachment 370172 [details] [review]:

I thought meson was smart, you if a optional dep was not found, you didn't have to do this if dance ?
Comment 15 Nicolas Dufresne (ndufresne) 2018-03-27 13:47:54 UTC
I've just tested locally with what I pushed to fix the breakage. It does not break if lrdf is not found. the lrdf_dep is always added to the list, but it seems to resolve to nothing, hence having no side effect, no warning either. What is problem do you have in git master that I don't see ?
Comment 16 Nicolas Dufresne (ndufresne) 2018-03-27 13:55:33 UTC
Ah, sorry, I see, I didn't push that patch, was still hanging in my local branch. Same as Nirkeek patch.