Skip to content

WIP: Build on MSYS2

Ghost User requested to merge wip/albfan/msys2 into master

gitg is using libdazzle to translate font description into css https://valadoc.org/libdazzle-1.0/Dazzle.pango_font_description_to_css.html. Right now it is building only the util functions.

This MR is trying to build the complete library on MSYS2. This needs:

  • implement realpath POSIX function on windows
  • isolate windows additions with defines #ifdef WIN or similar
  • deal with symlink function (not sure if that is available on windows)
  • build problems
$ ninja -C _build
ninja: Entering directory `_build'
[1/216] Compiling C object src/25a6634@@dazzle-1.0@sha/search_dzl-fuzzy-index-match.c.obj.
[2/216] Compiling C object src/25a6634@@dazzle-1.0@sha/search_dzl-fuzzy-mutable-index.c.obj.
FAILED: src/25a6634@@dazzle-1.0@sha/search_dzl-fuzzy-mutable-index.c.obj
cc @src/25a6634@@dazzle-1.0@sha/search_dzl-fuzzy-mutable-index.c.obj.rsp
In file included from C:/msys64/mingw64/lib/glib-2.0/include/glibconfig.h:9,
                 from C:/msys64/mingw64/include/glib-2.0/glib/gtypes.h:32,
                 from C:/msys64/mingw64/include/glib-2.0/glib/galloca.h:32,
                 from C:/msys64/mingw64/include/glib-2.0/glib.h:30,
                 from C:/msys64/mingw64/include/glib-2.0/gobject/gbinding.h:28,
                 from C:/msys64/mingw64/include/glib-2.0/glib-object.h:23,
                 from ../src/search/dzl-fuzzy-mutable-index.h:22,
                 from ../src/search/dzl-fuzzy-mutable-index.c:24:
C:/msys64/mingw64/include/glib-2.0/glib/gmacros.h:292:53: error: size of array '_GStaticAssertCompileTimeAssertion_4' is negative
  292 | #define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1] G_GNUC_UNUSED
      |                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/msys64/mingw64/include/glib-2.0/glib/gmacros.h:289:47: note: in definition of macro 'G_PASTE_ARGS'
  289 | #define G_PASTE_ARGS(identifier1,identifier2) identifier1 ## identifier2
      |                                               ^~~~~~~~~~~
C:/msys64/mingw64/include/glib-2.0/glib/gmacros.h:292:44: note: in expansion of macro 'G_PASTE'
  292 | #define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1] G_GNUC_UNUSED
      |                                            ^~~~~~~
../src/search/dzl-fuzzy-mutable-index.c:70:1: note: in expansion of macro 'G_STATIC_ASSERT'
   70 | G_STATIC_ASSERT (sizeof(DzlFuzzyMutableIndexItem) == 6);
      | ^~~~~~~~~~~~~~~
[3/216] Compiling C object src/25a6634@@dazzle-1.0@sha/settings_dzl-settings-sandwich.c.obj.
[4/216] Compiling C object src/25a6634@@dazzle-1.0@sha/prefs_dzl-preferences-page.c.obj.
[5/216] Compiling C object src/25a6634@@dazzle-1.0@sha/prefs_dzl-preferences-switch.c.obj.
[6/216] Compiling C object src/25a6634@@dazzle-1.0@sha/shortcuts_dzl-shortcut-chord.c.obj.
[7/216] Compiling C object src/25a6634@@dazzle-1.0@sha/prefs_dzl-preferences-view.c.obj.
ninja: build stopped: subcommand failed.

This will take some iterations to show all the problems and fix them one by one.

If build for windows is not interesting would be great to keep here the work so others can complete this patch (as they need other functions of libdazzle)

Merge request reports