Compiling GTK4 in windows with Vulkan

Submitted by Dickens A S on Sat, 12/07/2019 - 10:06

Step 1 download and install https://www.msys2.org/

Step 3 Install toolchains

pacman -S --needed mingw-w64-{x86_64}-{toolchain,meson,pkg-config,glib2,pango,cairo}

Step 4 Install GTK4 dependencies 

pacman -S  --needed mingw-w64-x86_64-atk  mingw-w64-x86_64-gdk-pixbuf2 mingw-w64-x86_64-gobject-introspection mingw-w64-x86_64-libepoxy mingw-w64-x86_64-graphene mingw-w64-x86_64-ffmpeg mingw-w64-x86_64-cmake mingw-w64-x86_64-pkg-config mingw-w64-x86_64-hicolor-icon-theme 

Step 5 Download Source Code GTK4 3.96.0

Step 6 unzip and place inside c:\msys2\gtk (make sure the directory path is very small)

Step 7 update all MSYS2 dependencies to latest and check the GCC version properly as below

$ gcc --version
gcc.exe (Rev2, Built by MSYS2 project) 9.2.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Step 8 go inside the folder

$ cd /gtk
$ pwd
/gtk

Step 9 begin meson

$ meson --prefix=/mingw64 -Dwin32-backend=true -Dvulkan=yes -Dprint-backends=none -Dman-pages=false -Ddocumentation=false -Ddemos=false -Dmedia=ffmpeg -Dbuild-examples=false builddir

Step 10 verify the below output

Message:
------
GTK 3.96.0 (4.0)

  Display backends: win32
    Print backends:
    Media backends: ffmpeg
    Vulkan support: true
     Cloud support: false
    Colord support: auto
     Introspection: true
     Documentation: false
       Build tests: true
     Install tests: false
             Demos: false
          Examples: false
Directories:
            prefix: C:/msys64/mingw64
        includedir: C:/msys64/mingw64/include
            libdir: C:/msys64/mingw64/lib
           datadir: C:/msys64/mingw64/share
------

Build targets in project: 259
Found ninja.EXE-1.9.0 at C:\msys64\mingw64\bin/ninja.EXE

Step 11 got inside the build folder

$ cd builddir/
$ pwd
/gtk/builddir

Step 11 initiate ninja build with single thread (for less CPU usage)

ninja -j 1 -v

Step 12 install GTK4

ninja install -v

Step 13 verify GTK4 settings

$ gtk4-query-settings.exe
              gtk-double-click-time: 500
          gtk-double-click-distance: 4
                   gtk-cursor-blink: TRUE
              gtk-cursor-blink-time: 1200
           gtk-cursor-blink-timeout: 10
                   gtk-split-cursor: FALSE
                     gtk-theme-name: "Adwaita"
                gtk-icon-theme-name: "Adwaita"
             gtk-dnd-drag-threshold: 4
                      gtk-font-name: "Segoe UI 9"
                  gtk-xft-antialias: 1
                    gtk-xft-hinting: 1
                  gtk-xft-hintstyle: "hintfull"
                       gtk-xft-rgba: "rgb"
                        gtk-xft-dpi: -1
              gtk-cursor-theme-name: NULL
              gtk-cursor-theme-size: 0
       gtk-alternative-button-order: TRUE
        gtk-alternative-sort-arrows: TRUE
              gtk-enable-animations: TRUE
                     gtk-error-bell: TRUE
                 gtk-print-backends: "file,lpr"
          gtk-print-preview-command: "evince --unlink-tempfile --preview --print-settings %s %f"
                  gtk-enable-accels: TRUE
                      gtk-im-module: ""
           gtk-recent-files-max-age: 30
           gtk-fontconfig-timestamp: 0
               gtk-sound-theme-name: "freedesktop"
   gtk-enable-input-feedback-sounds: TRUE
            gtk-enable-event-sounds: TRUE
    gtk-primary-button-warps-slider: TRUE
  gtk-application-prefer-dark-theme: FALSE
          gtk-entry-select-on-focus: TRUE
    gtk-entry-password-hint-timeout: 0
          gtk-label-select-on-focus: TRUE
           gtk-shell-shows-app-menu: FALSE
            gtk-shell-shows-menubar: FALSE
            gtk-shell-shows-desktop: TRUE
              gtk-decoration-layout: "menu:minimize,maximize,close"
          gtk-titlebar-double-click: "toggle-maximize"
          gtk-titlebar-middle-click: "none"
           gtk-titlebar-right-click: "menu"
             gtk-dialogs-use-header: FALSE
           gtk-enable-primary-paste: TRUE
           gtk-recent-files-enabled: TRUE
                gtk-long-press-time: 500
               gtk-keynav-use-caret: FALSE

 

Finished...

 

Add new comment