Skip to content
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

Packaging for Mac, Windows and Linux #65

Open
dixpac opened this issue Mar 2, 2024 · 3 comments
Open

Packaging for Mac, Windows and Linux #65

dixpac opened this issue Mar 2, 2024 · 3 comments

Comments

@dixpac
Copy link

dixpac commented Mar 2, 2024

Hey!

This is a great project.
I have Desktop app that I want to package for Mac, Window, Linux.
How would you recommend approaching packaging?

ps
Not sure about the tools listed in the README(OCRA, ruby-installer,...) since it looks that they are not maintained anymore.

@AndyObtiva
Copy link
Owner

AndyObtiva commented Mar 3, 2024

Thank you.

Glimmer DSL for SWT does offer cross-platform packaging support for apps as MSI/EXE on Windows, APP/DMG/PKG on Mac, and DEB/RPM on Linux out of the box: https://github.com/AndyObtiva/glimmer-dsl-swt

I've packaged many apps with Glimmer DSL for SWT like Are We There Yet?, Math Bowling 2, and Glimmer Wordle, so I would look into using Glimmer DSL for SWT instead of Glimmer DSL for LibUI if the need for cross-platform packaging is very important. Glimmer DSL for SWT is a much more mature library too with 100% complete support for all desktop widgets. The only trade-off with using it is it requires JRuby, which has a slower startup time, but that wouldn't be an issue for packaging once you package your app as a native executable, people will install your app directly from the executable/installer, and it will include JRuby/JVM automatically without people having to install anything separately.

I personally use Glimmer DSL for LibUI more for building local apps that are good enough to run without packaging or to package as Ruby gems. That's because I have not had time to flesh out its cross-platform packaging support yet, but it is in the project TODO list.

So, regarding Glimmer DSL for LibUI, whatever you read in the the packaging section is all that is available at the moment. That said, you might have missed OCRAN, which is still maintained as a newer alternative version of OCRA:
https://github.com/Largo/ocran

OCRAN works well on Windows according to Software Engineers that tried it and reported that to me.

For Mac and Linux, I have not had time to work on automatic packaging support yet though it is on the project agenda after other higher priority tasks are completed first.

In the meantime, packaging apps as Ruby gems is a very convenient cross-platform option for Ruby Software Engineers. This is excellent for building development tools that are used by Ruby developers. If you build an app with Application Scaffolding, it automatically gives you a command to package the app as a gem. I built Glimmer Snake that way, which is packaged as a cross-platform Ruby gem.

In summary, I would use Glimmer DSL for SWT or explore all the options mentioned in the Packaging section of Glimmer DSL for LibUI (which I have not personally tried in detail yet). The last option using WASI is interesting since it is cross-platform compatible and could in theory produce binaries for all platforms.

This is an open-source project and a community effort, so this could be your chance to contribute to it if you'd like to help.

@dixpac
Copy link
Author

dixpac commented Mar 3, 2024

Hey!

Yep I know that SWT will work, we do have production app running with jRuby and Swing as a UI for 5+ years, it was build before glimmer existed, altho it is true with glimmer SWT that repo would be even easier to maintain and distribute.

It is a app that prints barcode labels to EPL/ZPL printer we use it with our healthcare laboratory information system.
Main issue with that app is that Java is "elephant" so I'm researching a possible way not to have java dependency.

I did build the same app in go with fyne but it is just not elegant as a ruby :)

For Mac and Linux, I have not had time to work on automatic packaging support yet though it is on the project agenda after other higher priority tasks are completed first.

Do you have any ideas how to accomplish this, I may be willing to spend some time on it and see how it goes

@AndyObtiva
Copy link
Owner

AndyObtiva commented Mar 3, 2024

JRuby now starts in only 2.5 seconds or so on the M1 and M2 Mac chips, using the new JDK 21, so having Java is no longer a big concern like it used to be when startup time was 10+ seconds. And, SWT renders native widgets, so it produces apps that look native and much better looking than Swing apps when wanting a standard platform look and feel. I would recommend trying Glimmer DSL for SWT and its native executable packaging first before you rule out even if you don’t think it fits your needs. Trying quickly wouldn’t hurt regardless of what you end up going with.

Do you have any ideas how to accomplish this, I may be willing to spend some time on it and see how it goes

The idea I had was to try to package a Ruby app as a WASI app and then use a WASI to NATIVE converter. That’s what I wanted to try first, which was the last thing I mentioned to you in my last reply, and it’s also in the packaging section of Glimmer DSL for LibUI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants