ebassi / graphene

A thin layer of graphic data types

Home Page:http://ebassi.github.io/graphene

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Note about building with gobject-introspection on MinGW

zmughal opened this issue · comments

Steps to reproduce

$ meson -Denable-introspection=true _build
$ ninja -C _build test
...
[66/68] Generating Graphene-1.0.gir with a custom command.
FAILED: src/Graphene-1.0.gir 
"C:/msys64/mingw64/bin/g-ir-scanner.EXE" "-pthread" "-mms-bitfields" "-IC:/msys64/mingw64/include/gobject-introspection-1.0" "-IC:/msys64/mingw64/lib/libffi-3.2.1/include" "-IC:/msys64/mingw64/include/glib-2.0" "-IC:/msys64/mingw64/lib/glib-2.0/include" "-IC:/msys64/mingw64/include" "--no-libtool" "--namespace=Graphene" "--nsversion=1.0" "--warn-all" "--output" "src/Graphene-1.0.gir" "--identifier-filter-cmd=python C:/projects/p5-alien-graphene/build-dir/_alien/build_uyMZ/graphene-1.6.0/src/identfilter.py" "--c-include=graphene-gobject.h" "--accept-unprefixed" "-DGRAPHENE_COMPILATION" "-IC:/projects/p5-alien-graphene/build-dir/_alien/build_uyMZ/graphene-1.6.0/src" "-IC:/projects/p5-alien-graphene/build-dir/_alien/build_uyMZ/graphene-1.6.0/_build/src" "--filelist=C:/projects/p5-alien-graphene/build-dir/_alien/build_uyMZ/graphene-1.6.0/_build/src/graphene-1.0@sha/Graphene_1.0_gir_filelist" "--include=GObject-2.0" "--symbol-prefix=graphene" "--identifier-prefix=Graphene" "--pkg-export=graphene-gobject-1.0" "--cflags-begin" "-mms-bitfields" "-IC:/msys64/mingw64/include/glib-2.0" "-IC:/msys64/mingw64/lib/glib-2.0/include" "-IC:/msys64/mingw64/include" "--cflags-end" "-LC:/projects/p5-alien-graphene/build-dir/_alien/build_uyMZ/graphene-1.6.0/_build/src" "--extra-library=m" "--extra-library=gobject-2.0" "--extra-library=glib-2.0" "--extra-library=intl" "-LC:/msys64/mingw64/lib" "--library" "graphene-1.0"
g-ir-scanner: link: cc -o C:/projects/p5-alien-graphene/build-dir/_alien/build_uyMZ/graphene-1.6.0/_build/tmp-introspecty5e9qu/Graphene-1.0.exe C:/projects/p5-alien-graphene/build-dir/_alien/build_uyMZ/graphene-1.6.0/_build/tmp-introspecty5e9qu/Graphene-1.0.o -L. -Wl,-rpath,. -Wl,--no-as-needed -lgraphene-1.0 -lm -lgobject-2.0 -lglib-2.0 -lintl -LC:/projects/p5-alien-graphene/build-dir/_alien/build_uyMZ/graphene-1.6.0/_build/src -Wl,-rpath,C:/projects/p5-alien-graphene/build-dir/_alien/build_uyMZ/graphene-1.6.0/_build/src -LC:/msys64/mingw64/lib -Wl,-rpath,C:/msys64/mingw64/lib -LC:/msys64/mingw64/lib -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -pthread -lglib-2.0 -lintl
C:\msys64\mingw64\x86_64-w64-mingw32\include\sec_api\string_s.h:42: syntax error, unexpected ';' in '  ;' at ';'
C:\msys64\mingw64\x86_64-w64-mingw32\include\sec_api\string_s.h:69: syntax error, unexpected ';' in '  ;' at ';'
C:\msys64\mingw64\x86_64-w64-mingw32\include\sec_api\string_s.h:71: syntax error, unexpected ';' in '  ;' at ';'
ERROR: can't resolve libraries to shared libraries: graphene-1.0
ninja: build stopped: subcommand failed.
$ meson -Denable-introspection=true _build
$ export PATH=$(pwd)/_build/src:$PATH
$ export LIBRARY_PATH=$(pwd)/_build/src
$ ninja -C _build test
...
[66/68] Generating Graphene-1.0.gir with a custom command.
g-ir-scanner: link: cc -o C:/projects/p5-alien-graphene/build-dir/_alien/build_gwsl/graphene-1.6.0/_build/tmp-introspecthq1cbv/Graphene-1.0.exe C:/projects/p5-alien-graphene/build-dir/_alien/build_gwsl/graphene-1.6.0/_build/tmp-introspecthq1cbv/Graphene-1.0.o -L. -Wl,-rpath,. -Wl,--no-as-needed -lgraphene-1.0 -lm -lgobject-2.0 -lglib-2.0 -lintl -LC:/projects/p5-alien-graphene/build-dir/_alien/build_gwsl/graphene-1.6.0/_build/src -Wl,-rpath,C:/projects/p5-alien-graphene/build-dir/_alien/build_gwsl/graphene-1.6.0/_build/src -LC:/msys64/mingw64/lib -Wl,-rpath,C:/msys64/mingw64/lib -LC:/msys64/mingw64/lib -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -pthread -lglib-2.0 -lintl
C:\msys64\mingw64\x86_64-w64-mingw32\include\sec_api\string_s.h:42: syntax error, unexpected ';' in '  ;' at ';'
C:\msys64\mingw64\x86_64-w64-mingw32\include\sec_api\string_s.h:69: syntax error, unexpected ';' in '  ;' at ';'
C:\msys64\mingw64\x86_64-w64-mingw32\include\sec_api\string_s.h:71: syntax error, unexpected ';' in '  ;' at ';'
[67/68] Generating Graphene-1.0.typelib with a custom command.
[67/68] Running all tests.
...
OK:        18
FAIL:       0
SKIP:       0
TIMEOUT:    0

Experienced behavior

In order for g-ir-scanner to load the built DLL file, the path to the built src directory needs to be added to both the LIBRARY_PATH (so that GCC outputs it when gcc -print-search-dirs is called here) and PATH (so that Windows can find it for loading).

I have a small script that does the above.

It might be better for giscanner/ccompiler.py to use the -L directories that are passed in.

Expected behavior

Graphene's gobject-introspection should build automatically on MinGW.

Operating system in use

MSYS2's MinGW64 on Windows 10

SIMD implementation in use

N/A.

Thanks!

It would be good for you to file a bug on the GObject Introspection bug tracker; Graphene does not do anything special with G-I, and it uses the stock Meson integration with it, so we cannot really interpose a script when using MSYS2.