如何为pkg-config别名包?

问题描述 投票:2回答:1

我收到此错误:

Configuring cpython-3.4.0...
Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2: The pkg-config package 'python-3.4'
is required but it could not be found.

当我运行时(这些Haskell特定的细节可能不相关)stack build在设置Stack环境以测试Haskell的CPython模块的过程中。

我通过Nix安装了Python 3.4。 Nix选择的命令是python3.4,所以我从python-3.4python3.4创建了一个别名(通过将alias python-3.4=python3.4行添加到我的.bashrc文件中)。但pkg-config仍然给我同样的错误。

我正在使用KUbuntu(这是Ubuntu和KDE)版本16.04。

--

根据格雷森先生的评论,变量$ PKG_CONFIG_PATH似乎是空的:

jeff@jbb-lenovo:/nix$ echo $PKG_CONFIG_PATH

jeff@jbb-lenovo:/nix$ 

以下是python-3.4.pc的路径和内容:

jeff@jbb-lenovo:/nix$ find . -name "python-3.4.pc"
./store/q5p46zmky5z6w54bh8gaqbgwkdbqk4qg-python3-3.4.7/lib/pkgconfig/python-3.4.pc
jeff@jbb-lenovo:/nix$ cat ./store/q5p46zmky5z6w54bh8gaqbgwkdbqk4qg-python3-3.4.7/lib/pkgconfig/python-3.4.pc
# See: man pkg-config
prefix=/nix/store/q5p46zmky5z6w54bh8gaqbgwkdbqk4qg-python3-3.4.7
exec_prefix=${prefix} libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: Python
Description: Python library
Requires: 
Version: 3.4
Libs.private: -lpthread -ldl -lcrypt -lncurses -lutil
Libs: -L${libdir} -lpython3.4m
Cflags: -I${includedir}/python3.4m
python-3.x cabal haskell-stack pkg-config nix
1个回答
1
投票

您需要将文件python-3.4.pc移动到pkg-config将查找的目录之一。

要查看所有目录搜索:

$ pkg-config --variable pc_path pkg-config

然后将文件放入列出的其中一个文件夹中。

© www.soinside.com 2019 - 2024. All rights reserved.