Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Raku: Installation of Gnome::Gtk3 on Windows

Tags:

raku

gtk3

zef

I am trying to install the Raku module «Gnome::Gtk3» module on a Windows pc, without success.

Powershell> zef install Gnome::Gtk3

This fails with a lot of "Cannot locate native library"-messages.

I have installed Raku with choco, along with git. And have fixed the path. That alone took quite some time to figure out, due to missing documentation.

I have installed Gtk, as described here: https://www.gtk.org/docs/installations/windows

But Raku is unable to locate the libraries. Is this something that can work, or do I have to use the Windows Subsystem for Linux?

(I am aware of the «GTK::Simple» module, but cannot use that as a replacement as it lacks support for keyboard interrupts - which I need. I have installed it, as it states that it installs the GTK dll's as well.)

like image 520
Arne Sommer Avatar asked Dec 05 '20 20:12

Arne Sommer


2 Answers

In order to make this kind of modules work, you need the -dev version of the library, that is, the DLLs which are actually the ones that NativeCall uses. This tutorial shows how to set them up for C++ and Python, Raku shouldn't be too different.

like image 126
jjmerelo Avatar answered Oct 13 '22 13:10

jjmerelo


This now installs on MSYS2, Windows 10. First download the latest version of rakudo from here and extract the zip file to e.g. C:\rakudo-2020.11. Then install MSYS2, and when finished open the MSYS2 terminal window and install the following packages:

$ pacman -Syu
$ pacman -S base-devel gcc git libcrypt-devel libreadline
$ pacman -S mingw-w64-x86_64-gtk3
$ pacman -S mingw-w64-x86_64-toolchain

Then add the following to the MSYS2 ~/.bashrc configuration file:

export PKG_CONFIG_PATH=/mingw64/lib/pkgconfig
export PATH="$PATH:/c/rakudo-2020.11/bin:/c/rakudo-2020.11/share/perl6/site/bin"
export PATH="$PATH:/mingw64/bin"

Save the updated .bashrc and reload it from the MSYS2 terminal prompt:

$ source ~/.bashrc

Finally, install Gnome::Gtk3:

$ zef install Gnome::Gtk3
like image 2
Håkon Hægland Avatar answered Oct 13 '22 11:10

Håkon Hægland