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

Support installing library in subdirectory #580

Closed
arteymix opened this Issue Jun 4, 2016 · 13 comments

Comments

Projects
None yet
3 participants
@arteymix
Contributor

arteymix commented Jun 4, 2016

In some cases (e.g. plugins), it's useful to install shared library in a subdirectory. For instance, libgda install its database providers in /usr/lib64/libgda-5.0/providers.

This is already supported for install_headers, so I suggest that we use the same subdir option.

@nirbheek

This comment has been minimized.

Show comment
Hide comment
@nirbheek

nirbheek Jun 4, 2016

Member

You can do this with install_dir. The path is relative to the prefix option. Something like this would work for your case:

install_dir : '@0@/lib@1@-@2@/providers'.format(get_option('libdir'), name, version)

If you have multiple places where you want to use it, you can store it in a variable and reuse it.

Member

nirbheek commented Jun 4, 2016

You can do this with install_dir. The path is relative to the prefix option. Something like this would work for your case:

install_dir : '@0@/lib@1@-@2@/providers'.format(get_option('libdir'), name, version)

If you have multiple places where you want to use it, you can store it in a variable and reuse it.

@nirbheek nirbheek closed this Jun 4, 2016

@arteymix

This comment has been minimized.

Show comment
Hide comment
@arteymix

arteymix Jun 4, 2016

Contributor

This can work for now, but you should really consider a subdir option to avoid that kind of hack.

Contributor

arteymix commented Jun 4, 2016

This can work for now, but you should really consider a subdir option to avoid that kind of hack.

@arteymix

This comment has been minimized.

Show comment
Hide comment
@arteymix

arteymix Jun 4, 2016

Contributor

I'm happy :) 👍

Contributor

arteymix commented Jun 4, 2016

I'm happy :) 👍

@nirbheek

This comment has been minimized.

Show comment
Hide comment
@nirbheek

nirbheek Jun 4, 2016

Member

I've added it to the documentation so that people don't have to guess how this works. If we get more bug reports asking for this, we can look into adding this.

Member

nirbheek commented Jun 4, 2016

I've added it to the documentation so that people don't have to guess how this works. If we get more bug reports asking for this, we can look into adding this.

@arteymix

This comment has been minimized.

Show comment
Hide comment
@arteymix

arteymix Jun 4, 2016

Contributor

Unrelated, but how do you build the path with GModule to refer to library in subfolder like that?

Contributor

arteymix commented Jun 4, 2016

Unrelated, but how do you build the path with GModule to refer to library in subfolder like that?

@nirbheek

This comment has been minimized.

Show comment
Hide comment
@nirbheek

nirbheek Jun 4, 2016

Member

I'm not sure I understand the question. g_module_open takes a filename argument (full path), so you can use that. Or you can use g_module_build_path.

Member

nirbheek commented Jun 4, 2016

I'm not sure I understand the question. g_module_open takes a filename argument (full path), so you can use that. Or you can use g_module_build_path.

@arteymix

This comment has been minimized.

Show comment
Hide comment
@arteymix

arteymix Jun 4, 2016

Contributor

The absolute path (eg. /usr/lib64/libgda-5.0/providers has to be hard-coded during the build? This does not look easily feasible in Vala.. :(

Contributor

arteymix commented Jun 4, 2016

The absolute path (eg. /usr/lib64/libgda-5.0/providers has to be hard-coded during the build? This does not look easily feasible in Vala.. :(

@arteymix

This comment has been minimized.

Show comment
Hide comment
@arteymix

arteymix Jun 4, 2016

Contributor

Does Meson write the libdir option in a configuration header? And does it support --use-header?

Contributor

arteymix commented Jun 4, 2016

Does Meson write the libdir option in a configuration header? And does it support --use-header?

@arteymix

This comment has been minimized.

Show comment
Hide comment
@arteymix

arteymix Jun 4, 2016

Contributor

Nevermind, I can always use vala_args for the latter.

Contributor

arteymix commented Jun 4, 2016

Nevermind, I can always use vala_args for the latter.

@nirbheek

This comment has been minimized.

Show comment
Hide comment
@nirbheek

nirbheek Jun 4, 2016

Member

In GStreamer we use an environment variable GST_PLUGIN_PATH which can contain a list of paths to look for additional plugins. GST_PLUGIN_SYSTEM_PATH is for overriding the 'system' path, so it will ignore plugins in /usr/lib/gstreamer-1.0. See: https://cgit.freedesktop.org/gstreamer/gstreamer/tree/gst/gstregistry.c#n1585

Member

nirbheek commented Jun 4, 2016

In GStreamer we use an environment variable GST_PLUGIN_PATH which can contain a list of paths to look for additional plugins. GST_PLUGIN_SYSTEM_PATH is for overriding the 'system' path, so it will ignore plugins in /usr/lib/gstreamer-1.0. See: https://cgit.freedesktop.org/gstreamer/gstreamer/tree/gst/gstregistry.c#n1585

@arteymix

This comment has been minimized.

Show comment
Hide comment
@arteymix

arteymix Jun 4, 2016

Contributor

I might introduce an environment variable for the purpose of loading server implementation.

How do you define PLUGINDIR with Meson?

Contributor

arteymix commented Jun 4, 2016

I might introduce an environment variable for the purpose of loading server implementation.

How do you define PLUGINDIR with Meson?

@tp-m

This comment has been minimized.

Show comment
Hide comment
Contributor

tp-m commented Jun 4, 2016

@arteymix

This comment has been minimized.

Show comment
Hide comment
@arteymix

arteymix Jun 4, 2016

Contributor

@tp-m I was essentially building a config header, but then I saw that one can use relative RPATH, which is considerably more convenient

Thanks! It has been really helpful for valum-framework/valum#182 :)

Contributor

arteymix commented Jun 4, 2016

@tp-m I was essentially building a config header, but then I saw that one can use relative RPATH, which is considerably more convenient

Thanks! It has been really helpful for valum-framework/valum#182 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment