运送带有共享库的GNU / Linux Firefox插件(用于安装时无root权限) [英] Shipping GNU/Linux Firefox plugin with shared libraries (for installation with no root access)

查看:157
本文介绍了运送带有共享库的GNU / Linux Firefox插件(用于安装时无root权限)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该应用程序是一个Firefox插件(从$ HOME / .mozilla / plugins加载),所以设置LD_LIBRARY_PATH的包装脚本不是一个简单的选项。



RPATH,据我所知,不能引用$ HOME,只能是absolue路径。

Firefox试图从〜/ .mozilla / plugins中删除它,但是失败它取决于安装在用户主目录中某个地方的共享库)。

修改Firefox菜单项以在Firefox附近提供一个包装器(使用LD_LIBRARY_PATH)太过分了。







安装程序脚本应该执行哪些操作(无需root权限) ol>

  • 我是否应该将所有东西都嵌入到.so中去除依赖关系?

  • 我应该尝试使安装程序脚本完成链接或修补RPATH安装阶段?


  • 解决方案

    设置RPATH为 $ ORIGI N / lib ,所以加载器会查找相对于我的文件的库。



    脚本只是将这个插件解压到 $ HOME / .mozilla / plugins / myplugin.so 和库到 $ HOME / .mozilla / plugins / lib /



    rpath可以通过添加 wl,-rpath,'$ ORIGIN / lib' $ 应该在Makefile中加倍),也可以在编译后通过 patchelf 来更改。


    The application is a Firefox plugin (loaded from $HOME/.mozilla/plugins), so wrapper script that sets LD_LIBRARY_PATH is not an easy option.

    RPATH, as far as I know, cannot refer to $HOME and can be only absolue path.

    Firefox tries to dlopen it's plugin from ~/.mozilla/plugins but fails (because it depends on shared libraries installed somewhere in the user home directory).

    Modifying Firefox menu item to provide a wrapper (with LD_LIBRARY_PATH) around Firefox is too hacky.

    What should installer script do (without root access) to make standard firefox load plug-ins that depends on out shared library?

    1. Should I just try to make embed everything into that .so to remove dependencies?
    2. Should I try to make installer script to finish linking or patch RPATH during the installation phase?

    解决方案

    Set RPATH to $ORIGIN/lib so the loader will look for libraries relative to the my file.

    Script just unpacks the plugin to $HOME/.mozilla/plugins/myplugin.so and libraries to $HOME/.mozilla/plugins/lib/

    rpath can be specified to linker though the gcc by adding Wl,-rpath,'$ORIGIN/lib' ($ should be doubled in a Makefile) and can also be changed after compilation by patchelf.

    这篇关于运送带有共享库的GNU / Linux Firefox插件(用于安装时无root权限)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆