oneclick / rubyinstaller

RubyInstaller for Windows - Build recipes
http://rubyinstaller.org
BSD 3-Clause "New" or "Revised" License
1.19k stars 304 forks source link

[Documentation] How to compile ruby-gtk3 (the gtk stack, glib, atk etc...) on Windows (Win10)? #401

Open rubyFeedback opened 3 years ago

rubyFeedback commented 3 years ago

Hey there.

I know ruby quite well; I compile it on linux from source. Then I compile other things via ruby scripts. :)

On windows, this is a bit more annoying because I lack experience.

Would it be possible to link in some documentation or example, ideally, by someone who managed to get the atk, glib, pango etc... stack compile and work on windows? Ideally with commands that I can copy/paste.

I don't need this up to date, mind you; I track all current versions via ruby as is. But I lack experience with windows + ruby.

I had a look at https://github.com/oneclick/rubyinstaller/wiki but could not find anything pertaining to C-extensions. Could perhaps some page be added to the wiki to show this as an example? Just any C-extension, how to get this to work on windows. Right now I have no idea.

MSP-Greg commented 3 years ago

@rubyFeedback

This repo is inactive, and was active for Rubies 2.3 and lower. The repo for Ruby 2.4 and later is oneclick/rubyinstaller2.

Windows Ruby 2.4 and later use MSYS2 for the build system. If you're familiar with build tools, package managers, I'd suggest installing a 'standalone' version of MSYS2.

See:

https://www.msys2.org/

The 'ridk', which is installed with the Rubies, will add the paths needed for MSYS2 when compiling extension gems.

In both the ridk files (located in oneclick/rubyinstaller2) and in the ruby/ruby GitHub Actions workflow for mingw Ruby, you'll find pacman commands to setup MSYS2 with the packages needed to build Ruby. Once those are installed, most extension gems will 'just install', some may require additional packages...

I'm not familiar with gtk3, but using 'pacman -Ss' to search for 'atk, glib, pango etc' seems to show that packages already exist in MSYS2 for all?

HTH, Greg