When I am installing libraries in my Alpine 3.17 based docker container, I am not getting any of the .pc
files that belongs to pkg-config
. This makes compiling things that relies on those files to work difficult. The only .pc
file I been able to get was luas, due to it supporting the command add apk pc:lua
$ pkg-config --list-all
lua5.2 Lua - An Extensible Extension Language
shared-mime-info shared-mime-info - Freedesktop common MIME database
As an example, I am trying to compile a Rust programm that relies on OpenSSL and VLC, and I get the erros:
run pkg_config fail: `PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" "pkg-config" "--libs" "--cflags" "openssl"` did not exit successfully: exit status: 1
error: could not find system library 'openssl' required by the 'openssl-sys' crate
--- stderr
Package openssl was not found in the pkg-config search path.
Perhaps you should add the directory containing `openssl.pc'
to the PKG_CONFIG_PATH environment variable
Package 'openssl', required by 'virtual:world', not found
--- stderr
Package libvlc was not found in the pkg-config search path.
Perhaps you should add the directory containing `libvlc.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libvlc', required by 'virtual:world', not found
However, both of them are install via the add apk
command:
$ apk info vlc
vlc-3.0.18-r1 description:
A multi-platform MPEG, VCD/DVD, and DivX player
vlc-3.0.18-r1 webpage:
https://www.videolan.org/vlc/
vlc-3.0.18-r1 installed size:
15 MiB
$ apk info openssl
openssl-3.0.8-r4 description:
Toolkit for Transport Layer Security (TLS)
openssl-3.0.8-r4 webpage:
https://www.openssl.org/
openssl-3.0.8-r4 installed size:
868 KiB
Any idea how to fix it, or am I doing something wrong?
Since those are files needed to compile libraries, they tend to be in the corresponding *-dev
packages.
This said, you can always use the website of Alpine Linux in order to find in which package a file that is erroring is contained in.
So, in your case:
openssl-dev
vlc-dev