如何将 pkg-config 名称映射到 yum/apt-get [英] how to map pkg-config names to yum/apt-get
问题描述
许多 makefile 使用 pkg-config,但名称与包管理器无关(例如 yum/apt).如何将 pkg-config 名称映射到它们?有什么窍门吗?
示例:如果我执行 yum searchName
-- 查看名称并近似为 pkg-config 的名称
结果:
$ pkg-config --libs dbus-glib-0在 pkg-config 搜索路径中找不到包 dbus-glib-0.也许您应该添加包含dbus-glib-0.pc"的目录到 PKG_CONFIG_PATH 环境变量未找到包dbus-glib-0"$ sudo yum 安装 dbus-glib加载的插件:langpacks、refresh-packagekit包 dbus-glib-0.100-5.fc19.i686 已经安装并且是最新版本没事做$ sudo yum 安装 dbus-glib-0加载的插件:langpacks、refresh-packagekit没有可用的软件包 dbus-glib-0.错误:无事可做
在 apt-get 的情况下,如果你有一些软件通过 pkg-config 抱怨缺少这个包,例如:
<前>配置:错误:未满足包要求(gtk+-2.0 >= 2.8):未找到包gtk+-2.0"考虑调整 PKG_CONFIG_PATH 环境变量,如果你在非标准前缀中安装的软件.或者,您可以设置环境变量 GTK_CFLAGS和 GTK_LIBS 以避免需要调用 pkg-config.有关更多详细信息,请参阅 pkg-config 手册页.错误:无法运行 ./configure,这是配置 banshee 所必需的那么这意味着配置脚本正在寻找gtk+-2.0
pkgconfig 包.
那么,你可以做的是:
<前>$ sudo apt-get install apt-file...$ apt-文件更新...$ apt-file 搜索gtk+-2.0 |grep "\.pc"libgtk2.0-dev:/usr/lib/x86_64-linux-gnu/pkgconfig/gtk+-2.0.pc这意味着您可以安装包libgtk2.0-dev:
sudo apt-get install libgtk2.0-dev
并且依赖会得到满足.
在原始问题的特殊情况下:
$ apt-file search --package-only dbus-glib-1.pclibdbus-glib-1-dev
(dbus-glib-0 似乎太旧了,无法显示在我的系统中.)
Lots of makefiles use pkg-config but the names don't relate to package managers (e.g. yum / apt). How to map pkg-config names to them? is there a trick?
Example: if I do yum searchName
-- look through the name and approximate to pkg-config's name
Result:
$ pkg-config --libs dbus-glib-0
Package dbus-glib-0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `dbus-glib-0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'dbus-glib-0' found
$ sudo yum install dbus-glib
Loaded plugins: langpacks, refresh-packagekit
Package dbus-glib-0.100-5.fc19.i686 already installed and latest version
Nothing to do
$ sudo yum install dbus-glib-0
Loaded plugins: langpacks, refresh-packagekit
No package dbus-glib-0 available.
Error: Nothing to do
In the case of apt-get, if you have some software that complains about this missing package via pkg-config, for instance:
configure: error: Package requirements (gtk+-2.0 >= 2.8) were not met: No package 'gtk+-2.0' found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GTK_CFLAGS and GTK_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. Error: Could not run ./configure, which is required to configure banshee
Then it means that the configure script is looking for the gtk+-2.0
pkgconfig package.
Then, what you can do is this:
$ sudo apt-get install apt-file ... $ apt-file update ... $ apt-file search gtk+-2.0 | grep "\.pc" libgtk2.0-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/gtk+-2.0.pc
Which means you can install package libgtk2.0-dev:
sudo apt-get install libgtk2.0-dev
And the dependency would be satisfied.
In the particular case of the original question:
$ apt-file search --package-only dbus-glib-1.pc
libdbus-glib-1-dev
(dbus-glib-0 seems to be too old to show up in my system.)
这篇关于如何将 pkg-config 名称映射到 yum/apt-get的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!