Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffmpeg on Windows is currently exporting malformed .pc files. #12376

Closed
traversaro opened this issue Jul 11, 2020 · 9 comments
Closed

ffmpeg on Windows is currently exporting malformed .pc files. #12376

traversaro opened this issue Jul 11, 2020 · 9 comments
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@traversaro
Copy link
Contributor

Describe the bug
ffmpeg on Windows is currently exporting malformed .pc files.

Environment

  • OS: Windows/Linux
  • Compiler: Not relevant

To Reproduce
Steps to reproduce the behavior:

  1. ./vcpkg install ffmpeg
  2. Inspect the installed .pc files

Expected behavior
ffmpeg should install well formed .pc files.

Failure logs
See #11273 (comment) .

Additional context
Originally discussed in #11273 (comment), but I opened a separate issue for better visibility. This is a specific instance of the more general problem discussed in #11103 .

@traversaro
Copy link
Contributor Author

do you think it is sufficient to add ole32 and user32 to the system libraries?

you can probably add all windows standard libraries as system libraries.

Thanks @Neumann-A ! The strange thing is that apparently the library are not listed as -lole32, but just as ole32.lib, see:

Name: libavdevice
Description: FFmpeg device handling library
Version: 58.8.100
Requires: 
Requires.private: libavfilter >= 7.57.100, libswscale >= 5.5.100, libavformat >= 58.29.100, libavcodec >= 58.54.100, libswresample >= 3.5.100, libavresample >= 4.0.0, libavutil >= 56.31.100
Conflicts:
Libs: -L${libdir}  -lavdevice 
Libs.private: psapi.lib ole32.lib strmiids.lib uuid.lib oleaut32.lib shlwapi.lib gdi32.lib vfw32.lib
Cflags: -I${includedir}

do you think that is a case that is supported in pkg-config, or it is just that ffmpeg produces malformed .pc files?
``
I tried to add all the library names (such as psapi.lib, `strmiids.lib` to the `IGNORE_FLAGS` of `vcpkg_fixup_pkgconfig` ), but this is not working as the content of `Libs.private` is considered as a unique string, in fact the error in #11273 (comment) is

CMake Error at scripts/cmake/vcpkg_fixup_pkgconfig.cmake:150 (message):
  Found ole32.lib user32.lib and no rule to analyse the flag! Please check
  the *.pc file

and not for ole32.lib and user32.lib separately.

@Neumann-A
Copy link
Contributor

You probably need to wait for the PR using pkg-config for the checks.

@LilyWangL LilyWangL self-assigned this Jul 13, 2020
@traversaro
Copy link
Contributor Author

The simple use of vcpkg_fixup_pkgconfig for ffmpeg:x64-osx is failing as well:

CMake Error at scripts/cmake/vcpkg_fixup_pkgconfig.cmake:130 (message):
  Library iconv was not found! If it is a system library use the
  SYSTEM_LIBRARIES parameter for the vcpkg_fixup_pkgconfig call! Otherwise,
  corret the *.pc file
Call Stack (most recent call first):
  scripts/cmake/vcpkg_fixup_pkgconfig.cmake:234 (vcpkg_fixup_pkgconfig_check_libraries)
  ports/ffmpeg/portfile.cmake:293 (vcpkg_fixup_pkgconfig)
  scripts/ports.cmake:76 (include)

See the CI for #11273, in particular https://github.com/microsoft/vcpkg/pull/11273/checks?check_run_id=862778528 .

@Neumann-A
Copy link
Contributor

I don't think that is a failure of vcpkg_fixup_pkgconfig knowing that iconv is only build on windows and nowhere else

@LilyWangL LilyWangL added the category:port-bug The issue is with a library, which is something the port should already support label Jul 21, 2020
@traversaro
Copy link
Contributor Author

Related PR: #13919 .

@Be-ing
Copy link
Contributor

Be-ing commented Jan 23, 2021

There have been several PRs that seem related to this issue in the past several months, but using pkg_check_modules is still failing:

CMake Error at C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.18/Modules/FindPkgConfig.cmake:75 (set):
  Syntax error in cmake code at

    C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.18/Modules/FindPkgConfig.cmake:75

  when parsing string

    \a\mixxx\mixxx\build\vcpkg_installed\x64-windows\lib\pkgconfig/../..

  Invalid character escape '\a'.
Call Stack (most recent call first):
  C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.18/Modules/FindPkgConfig.cmake:102 (_pkgconfig_set)
  C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.18/Modules/FindPkgConfig.cmake:828 (_pkgconfig_invoke)
  C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.18/Modules/FindPkgConfig.cmake:564 (pkg_get_variable)
  C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.18/Modules/FindPkgConfig.cmake:733 (_pkg_check_modules_internal)
  cmake/modules/FindFFMPEG.cmake:82 (pkg_check_modules)
  cmake/modules/FindFFMPEG.cmake:124 (find_component)
  build/vcpkg_installed/x64-windows/share/ffmpeg/vcpkg-cmake-wrapper.cmake:4 (_find_package)
  vcpkg/scripts/buildsystems/vcpkg.cmake:597 (include)
  CMakeLists.txt:2252 (find_package)

@mcmtroffaes
Copy link
Contributor

As a side effect of #17985 (which has just been merged), pkg_check_modules seems to be working now. Is anyone still seeing issues?

@JackBoosY
Copy link
Contributor

This issue should be fixed, please reopen this issue if it still bother you.

@traversaro
Copy link
Contributor Author

traversaro commented Jan 27, 2022

Thanks a lot @JackBoosY @mcmtroffaes !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants