如何将pkg-config名称映射到yum/apt-get [英] how to map pkg-config names to yum/apt-get

查看:308
本文介绍了如何将pkg-config名称映射到yum/apt-get的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很多makefile使用pkg-config,但名称与软件包管理器无关(例如yum/apt).如何将pkg-config名称映射到它们?有把戏吗?

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?

示例:如果我执行yum searchName -浏览名称并近似于pkg-config的名称

Example: if I do yum searchName -- look through the name and approximate to pkg-config's name

结果:

$ 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

推荐答案

在apt-get的情况下,如果您有一些软件通过pkg-config抱怨此缺少的软件包,例如:

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

这意味着配置脚本正在寻找gtk+-2.0 pkgconfig软件包.

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

这意味着您可以安装软件包 libgtk2.0-dev :

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似乎太老了,无法显示在我的系统中.)

(dbus-glib-0 seems to be too old to show up in my system.)

这篇关于如何将pkg-config名称映射到yum/apt-get的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆