我正在使用Stack和Nix构建一个Haskell项目,并依赖于Hackage中的cairo库。
当我构建项目时,出现错误:找不到“pkg-config >= 0.9.0”或“cairo >= 1.2.0”。然而,根据它们的网站,最新版本是“pkg-config 0.29.2”和“cairo-1.15.4”,Nix包管理器也反映了这一点。
另一方面,有一篇2006年发布的文章this article from 2006 announcing the release of Cairo 1.2.0,进一步混淆了问题。
问题:
当我构建项目时,出现错误:找不到“pkg-config >= 0.9.0”或“cairo >= 1.2.0”。然而,根据它们的网站,最新版本是“pkg-config 0.29.2”和“cairo-1.15.4”,Nix包管理器也反映了这一点。
另一方面,有一篇2006年发布的文章this article from 2006 announcing the release of Cairo 1.2.0,进一步混淆了问题。
问题:
为什么预期版本与
nixpkgs
和pkg-config
/cairo
网站上发布的版本如此不同?您有什么建议可以让
cairo
在 macOS 上构建(最好的情况是:使用 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.
nix-shell -p pkg-config cairo
。 - Zimm i48