0

I am following this page to build GTK+ on Windows with MSYS2, following the GTK official page. I got stuck right here:

  • Create a PKGBUILD file as you would do for Arch Linux for the package you would like to build for windows. You can find the gedit one here. Or you can find more information on how to create this file on the Arch Linux wiki.
  • Once you have the PKGBUILD file ready build it by running “makepkg-mingw -sL”. This will build your project and generate a package.

OK, so I suppose I have to download the PKGBUILD file from Github? And then, what am I supposed to do? Please help. I am not well versed with Linux things. Thank you.

CaTx
  • 1,421
  • 4
  • 21
  • 42

2 Answers2

0

You'll need to download the PKGBUILD and the other files associated with it. You can see a list of those files here:

https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-gedit

The easiest way to download these files is to run these commands in MSYS2:

pacman -S git
git clone https://github.com/Alexpux/MINGW-packages.git

Run cd MINGW-packages/mingw-w64-gedit to get into the right directory, and then run the makepkg-mingw -sL command specified by the blog post.

This isn't guaranteed to work the first time; you might be missing certain packages needed to build the software, something might have changed since the last time an MSYS2 developer worked on that package, or something else might be messed up in your environment.

You can see more example PKGBUILDs and find more information about making MSYS2 packages here:

By the way, I don't really like the tutorial you are following. You don't actually need PKGBUILD files or makepkg if you're just trying to build an application that uses GTK+. I think probably all you need to do is install the right MSYS2 packages (the right GTK and the right GCC), download the source file for a simple GTK application, and then invoke gcc with the right arguments to compile that source file. Using extra tools on top of gcc just obscures what is going on and probably makes it harder for beginners to understand. Once you understand how gcc works, you can move on to using build tools like make and cmake to run gcc for you and provide features like incremental compilation. Once you understand those build tools, if you want to make an MSYS2 package that can be installed onto an MSYS2 system using pacman, then you would look into makepkg. But starting off with makepkg right away in a tutorial meant for beginners seems like a bad approach.

David Grayson
  • 84,103
  • 24
  • 152
  • 189
  • Hi, I follow the [Building GTK3 from git on Windows guide](https://github.com/mypaint/mypaint/wiki/Building-GTK3-from-git-on-Windows) as you say. I got some error while executing `pacman -U mingw-w64-x86_64-gtk3-git-3.22.30.86.g9ac7f906aa-1-any.pkg.tar.xz`. Re-run, and it looks fine. However, when I try to compile configure WxWidgets with `--with-gtk=3`, it complains that `No package 'gtk+-3.0' found`. What have I done wrong? – CaTx Jun 21 '18 at 17:54
  • I did not tell you to follow that guide and it's probably a bad idea to do so because MSYS2 already has pre-built GTK3 packages. Are you trying to compile GTK itself or compile an application? You're giving mixed signals in your question and comments. Do you understand the difference? What MSYS2 shell are you using (i.e. what is the value when you run `echo $MSYSTEM`)? – David Grayson Jun 21 '18 at 19:37
0

If you just want to develop a GTK+ application, building GTK+ is probably not what you want. Instead, install the GTK+ library provided by MSYS2.

liberforce
  • 11,189
  • 37
  • 48