Linking 3rd party stuff with liblinuxsampler (proposal)

You name it!
Post Reply
nick87720z
Newbie
Posts: 4
Joined: Sun Mar 14, 2010 5:13 pm

Linking 3rd party stuff with liblinuxsampler (proposal)

Post by nick87720z » Wed Dec 25, 2013 12:45 pm

Hello. I discovered this issue when tried to install carla plugin host on gentoo. This tool appart to be simple plugin host, also implements a sampler, being linked directly with linuxsampler and fluidsynth libraries.

Currently there are two ways to do it: libtool (older, needs autotools) and pkg-config. Linuxsampler itself uses libtool almost everywhere inside self (linking linuxsampler executable with own library) and then works well. But almost all modern stuff uses pkg-config for that. Carla too. However, after successful linking and installing it can't start because can't find liblinuxsampler.so.3, because path, written to pkglibdir (libdir/linuxsampler) is not in LD_LIBRARY_PATH. In kxstudio this problem is solved by adding a separate file in "/etc/ld.conf.d" to liblinuxsampler package. I could do same, but i'm searching for better solution, reducing such extra efforts for packagers.

There are two solutions, that i can see:
1. Since linuxsampler links using -Wl-rpath (seems to be added by libtool), same option may be specified by pkg-config (in `pkg-config --libs linuxsampler`). Even more, it may replace -D option... though i'm not sure, is it good idea to remove first - don't know, wether -Wl-rpath and -D overrided each other or complement (i.e., if library not found in LD_LIBRARY_PATH, it could be searched by path, specified by -rpath).
2. Simply change liblinuxsampler install path to libdir (/usr/lib) - indeed, why not?? Almost all other libraries do so (gtk, qt, sndfile, jack-audio-connection-kit). However, if there are more 3rd party sruff, linked with liblinuxsampler in some distros, this may break them, requiring their rebuilding.

I don't hurry to bring it to bugtracker, as description may be a bit fuzzy.

nick87720z
Newbie
Posts: 4
Joined: Sun Mar 14, 2010 5:13 pm

Re: Linking 3rd party stuff with liblinuxsampler (proposal)

Post by nick87720z » Thu Dec 26, 2013 5:34 am

Tried variant with changed pkg-config. Flags, given by pkg-config --libs, may be used by both ld and gcc commands, but -rpath is ld-only flag, while option -Wl is not recognized by ld. The only compateble way is to add -rpath=${libdir} string in begining of output template, so that this string may be concatenated with -Wl for gcc. But again, it doesn't reach the goal - eliminate useless efforts from 3rd party devs.

Looking closer to variant with moving of liblinuxsampler.so.* stuff from libdir/linuxsampler to libdir, it doesn't seem, that it may break something for stuff, using pkg-config. Guessing, it is enough mature for bug report.
Strange, how i could not see that before :)

Post Reply