将 QtRuby 应用程序打包并分发为 gem?或者如何?
我已经完成了通过 qtbindings gem 使用 Qt 的 GUI 桌面 Ruby 应用程序的开发,我需要发布它并满足一些要求:
- 用户不必构建或编译任何东西,特别是 Qt 库,安装 Ruby 和 Rubygems 就可以了,但不是更多
- 它必须在 Mac 和 Windows 上运行,最好是 Linux
我已经尝试过 tar2rubyscript & rubyscript2exe 但由于一些神秘的错误,我失败了,正如我在 KDE 绑定邮件列表
#qtruby IRC 频道上的一位乐于助人的人建议我将其捆绑为 gem 并发布它。我一直在尝试这样做,但我的问题是,如何将 qtbindings 链接到静态 Qt 库?我制作了 gemspec,并使用了 bundler,但它是针对本机 Qt 开发库/标头构建的......以及我的用户不会有那个。
所以我的问题又是:
- 我可以为此使用宝石吗?如果是这样,我如何让用户针对我提供的 Qt 静态库构建 qtbindings?
- 您知道还有其他方法来打包 qtruby 应用程序吗?你做到了吗?
I have finished developing a GUI desktop Ruby application that uses Qt through the qtbindings gem, and I need to release it with a few requirements:
- The user doesn't have to build or compile anything, especially Qt libraries, installing Ruby and Rubygems is OK, but not more
- It must run on Mac and Windows, Linux too preferably
I've tried tar2rubyscript & rubyscript2exe but I failed due to some cryptic errors, as I've described on KDE-bindings mailing list
A helpful guy on #qtruby IRC channel suggested I bundle it as a gem and release it. I've been trying to do that but my problem is, how can I link qtbindings to a static Qt library? I made the gemspec, and I used bundler, but it builds against the native Qt development libraries / headers.. and my users won't have that.
So my questions are, again:
- Can I use a gem for this? If so, how can I have the user build qtbindings against a static library of Qt that I provide?
- Do you know of any other way to package a qtruby app? Did you do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经在 Qt 中进行了大量开发,但我仍在学习 Ruby 和 QtRuby,所以请对此持保留态度。
我不会采用 gem 路线,而是会尝试将其打包,就像我以前开发的商业 Qt 应用程序一样。
包含程序运行所需的所有内容的单个包。这将包括 Qt4 Ruby 绑定和 Qt 库以及您需要它运行的所有其他内容,但它不在 [Windows 普通安装/MacOS 普通安装/最受支持的 Linux 标准库] 上,但 Ruby 解释器可能除外本身。
将您的应用程序包装在脚本中以设置 LD_LIBRARY_PATH 和其他类型的环境变量,以确保一切都适用于您正在发布但未安装在 Linux 目标上的动态库。在 Windows 上,只需将它们(动态库)保留在主文件夹中,尽管您也可以选择脚本路径。我从未在 Mac 上部署过,所以我不知道,但我可以想象它与 Linux 路线类似。
我知道这并不优雅,但至少它有效。
I have done a lot of development in Qt but I'm still learning Ruby and QtRuby so, please, take this with a grain of salt.
I wouldn't take the gem route and would try to package it just like the commercial Qt application I used to work on.
A single package including everything for the program needs to run. This would include the Qt4 Ruby bindings and Qt libraries and everything else that you need it to run but it's not on [a Windows vanilla install/a MacOS vanilla install/The most commonly supported Linux Standard Base] with the possible exception of the Ruby interpreter in itself.
Wrap your application in script to setup LD_LIBRARY_PATH and other kind of environmental variables to make sure everything works with the dynamic libraries you're shipping but are not installed on Linux target. On Windows just leave them (dynamic libraries) in the main main folder although you can go for the script route too. I never deployed on the Mac so I don't know but I can imagine it to be similar to the Linux route.
I know it's not elegant but at least it works.