我正在使用 Stack 和 Nix 构建一个 Haskell 项目,并依赖于cairo
Hackage 的库。
当我构建项目时,我收到一个错误:无法找到pkg-config >= 0.9.0
或cairo >= 1.2.0
. 但是,根据他们的网站,最新版本是pkg-config 0.29.2
and cairo-1.15.4
,这也反映在 Nix 包管理器中。
另一方面, 2006 年的这篇文章宣布了 Cairo 1.2.0 的发布,这进一步混淆了这个问题。
问题
nixpkgs
为什么预期版本与pkg-config
/cairo
网站上发布的版本有如此大的不同?在 macOS 上构建你有什么建议
cairo
(最好的情况:将 Nix 用于系统包,将 Stack 用于 Haskell 包)
重现步骤:
> stack new cairo-test simple && cd cairo-test
# Now, to get Cairo
> stack install cairo
cairo-0.13.3.1: configure ...
Process exited with code: ExitFailure 1
Configuring cairo-0.13.3.1...
setup: The program 'pkg-config' version >=0.9.0 is required but it could not be found.
# This version doesn't seem to exist (not on the pkg-config website, either).
> nix-env -qaP pkg-config
nixpkgs.pkgconfig pkg-config-0.29.2
nixpkgs.pkgconfigUpstream pkg-config-0.29.2
# However, if installed, a new error:
> nix-env -i pkg-config
installing ‘pkg-config-0.29.2’
building path(s) ‘/nix/store/m4ks2si7b78757c1rc43r0833pxkvjb3-user-environment’
created 102 symlinks in user environment
> stack install cairo
setup: The pkg-config package 'cairo' version >=1.2.0 is required but
it could not be found.
# Again, this version doesn't seem to exist, either on the site on in `nixpkgs`
> nix-env -qaP cairo
nixpkgs.cairo cairo-1.14.8
# Installing it anyway, to see what the next error is
> nix-env -i cairo
installing ‘cairo-1.14.8’
building path(s) ‘/nix/store/dcx0in96wcd7yd8q71y93jd5306vag8g-user-environment’
created 112 symlinks in user environment
# Get the same version error now that Cairo is installed
setup: The pkg-config package 'cairo' version >=1.2.0 is required but it could not be found.