fdopen / opam-repository-mingw

windows package repository for OPAM (mingw and msvc)
https://fdopen.github.io/opam-repository-mingw/
Creative Commons Zero v1.0 Universal
96 stars 33 forks source link

pkg-config wrapper doesn't report version #96

Closed kkirstein closed 3 years ago

kkirstein commented 3 years ago

cmake queries the version info of pkg-config in its detection script. Unfortunately, the pkg-config wrapper in the opam setup does not correctly report that:

$ $(opam config var bin)/pkg-config --version
/usr/bin/pkgconf: --version specified with other options or module names, assuming --modversion.
Please specify at least one package name on the command line.

The 'cygwin' version responds correctly:

$ /usr/bin/pkg-config --version
1.6.3

Couldn't find the sources for the wrapper anywhere on Github to have a look at it myself.

kkirstein commented 3 years ago

I think, I found the wrapper source: https://github.com/fdopen/depext-cygwinports/blob/master/symlink.c but so far can't figure out, what's going wrong. For sake of completeness, the cross-compile pkg-config also reports version correctly:

$ /usr/bin/x86_64-w64-mingw32-pkg-config --version
1.6.3
kkirstein commented 3 years ago

For my cmake config I found a workaround by set(PKG_CONFIG_EXECUTABLE /usr/bin/x86_64-w64-mingw32-pkg-config). Anyway, would be interesting, why the wrapper fails.

fdopen commented 3 years ago

Yes, my mistake. Hopefully fixed with https://github.com/fdopen/depext-cygwinports/commit/4bbe589dd4b1adffa7cfecb8d6343acf4e5b6d9e and https://github.com/fdopen/opam-repository-mingw/commit/232932fb1fd3e3690e0e8f3cf2053cb0fd380d3b

kkirstein commented 3 years ago

Yes, it works with depext-cygwinport 0.0.8. Thanks for the fast fix!