开发者

Packaging and distributing a QtRuby app as a gem? Or how?

开发者 https://www.devze.com 2023-01-22 18:02 出处:网络
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:

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:

  1. The user doesn't have to build or compile anything, especially Qt libraries, installing Ruby and Rubygems is OK, but not more
  2. It must run on Mac and Windows, Linux too preferably

I've tried tar2rubyscript & rubyscript2exe but I fail开发者_Python百科ed 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:

  1. 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?
  2. Do you know of any other way to package a qtruby app? Did you do it?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消