6

What is the least headache technique to package a gtk2/gtk3 app built with ruby for distribution as an executable, for windows, linux, macos?

I could not find any guides or helpers to resolve this for ruby gtk. Nor the ruby-gnome gem comes with a packager.

It is my understanding that gtk is cross-platform, so it should not be trivial to do this. Problem is I am unable to find anythin reliable to follow as an example and learn the steps.

arjun
  • 1,594
  • 16
  • 33

2 Answers2

1

I've come across the same problem as you and I've put the question directly to the GTK3 developers.

here is their answer.

Which means that if you choose to use GTK3 today with Ruby, you have to:

  • Deliver MSYS2 and Ruby with your GEM.
  • Deliver your gem and tell users to install themselves msys2 (with updates) and ruby and your gem with dependencies.
Mohamed Hakki
  • 88
  • 1
  • 10
  • WSL1 and probably WSL2 work; it requires some knowledge how to use e. g. apt-get, and set export DISPLAY=:0 and use xming perhaps, but I am able to use all ruby-gtk parts on win10 that way. Even autostarting that works, e. g. start an ubuntu instance and upon login run some shell script via &. I am sure there are more ways for that but I am a bit of a windows noob. What I can, however had, say, is that you can leverage WSL just fine. I can run KDE konsole and ruby-gtk parts on win10 that way. It's almost a bit like linux (not the same; there are issues, but it sort of works). – shevy Aug 30 '20 at 10:30
0

It seems that the core developers of ruby-gnome2 are unconcerned about app distribution outside the Ruby community.

For example, Mr. Sutou, one of the maintainers of ruby-gnome2, distributes his Ruby/Gtk presentation tool "Rabbit" only as a Ruby Gem.

sondra.kinsey
  • 583
  • 7
  • 18
kojix2
  • 806
  • 7
  • 18
  • Thanks for letting me know of a new tool. But I am not sure how this is related to packaging Ruby/GTK apps as executables. – arjun Jun 08 '18 at 09:31
  • Ruby gem can packages excutables. Ruby users will install your tool just type `gem install foo`. But for those who don’t use ruby it may be difficult. – kojix2 Jun 08 '18 at 10:17
  • Not as a gem. As a .exe for windows, .deb for debian, .app for osx. – arjun Jun 08 '18 at 11:39
  • Probably there is no established easy way. Developers of ruby-gnome2 distribute their tools mainly by gem. You should develop convenient package method yourself to help others. – kojix2 Jun 10 '18 at 00:33
  • There is nothing wrong using rubygems. It simplified installation greatly, compared to the old setup.rb days. A problem with windows is that the dev-ecosystem is not as trivial to use for e. g. linux/OSX folks. But you can use WSL1 and WSL2 just fine - all my ruby-gtk code works there, and within that distribution you can do "gem install gtk2, then use these widgets (and mingx/xming whatever the name of it is; I am sure there may be wayland-related tools too eventually). – shevy Aug 30 '20 at 10:32