내 프로젝트를 빌드하려고 할 때 라이브러리가 누락되었음을 발견했습니다 asound
.
내 질문이 다음 질문과 일치합니다.이것libasound2
스레드, 나열된 데비안 패키지를 설치하면 문제가 해결되었습니다.여기.
실행 중이지만 설치에 사용할 수 있는 패키지가 NixOS
표시되지 않습니다 .libasound2
nix-env
종속성을 설치하는 다른 방법이 있습니까? NixOS 패키지 목록에 추가할 수 있나요? 그렇다면 어떻게 해야 합니까?
내 프로젝트는 Haskell stack
과 명령을 사용하여 구축되었습니다 $ stack build
. 전체 출력은 아래와 같습니다.
$ stack build
PortMidi-0.1.5.2: configure
Progress: 1/3
-- While building package PortMidi-0.1.5.2 using:
/home/matthew/.stack/setup-exe-cache/x86_64-linux-nix/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0 configure --with-ghc=/nix/store/vs9mh0q32flklzi8hl0ksr9d3jv21399-ghc-8.0.2/bin/ghc --with-ghc-pkg=/nix/store/vs9mh0q32flklzi8hl0ksr9d3jv21399-ghc-8.0.2/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/home/matthew/.stack/snapshots/x86_64-linux-nix/lts-9.11/8.0.2/pkgdb --package-db=/home/matthew/backup/perfectpitch/perfectpitch/.stack-work/install/x86_64-linux-nix/lts-9.11/8.0.2/pkgdb --libdir=/home/matthew/backup/perfectpitch/perfectpitch/.stack-work/install/x86_64-linux-nix/lts-9.11/8.0.2/lib --bindir=/home/matthew/backup/perfectpitch/perfectpitch/.stack-work/install/x86_64-linux-nix/lts-9.11/8.0.2/bin --datadir=/home/matthew/backup/perfectpitch/perfectpitch/.stack-work/install/x86_64-linux-nix/lts-9.11/8.0.2/share --libexecdir=/home/matthew/backup/perfectpitch/perfectpitch/.stack-work/install/x86_64-linux-nix/lts-9.11/8.0.2/libexec --sysconfdir=/home/matthew/backup/perfectpitch/perfectpitch/.stack-work/install/x86_64-linux-nix/lts-9.11/8.0.2/etc --docdir=/home/matthew/backup/perfectpitch/perfectpitch/.stack-work/install/x86_64-linux-nix/lts-9.11/8.0.2/doc/PortMidi-0.1.5.2 --htmldir=/home/matthew/backup/perfectpitch/perfectpitch/.stack-work/install/x86_64-linux-nix/lts-9.11/8.0.2/doc/PortMidi-0.1.5.2 --haddockdir=/home/matthew/backup/perfectpitch/perfectpitch/.stack-work/install/x86_64-linux-nix/lts-9.11/8.0.2/doc/PortMidi-0.1.5.2 --dependency=base=base-4.9.1.0 --extra-include-dirs=/nix/store/83413105lyc3n8pbmi2qbz3f82x06sp1-postgresql-9.5.7/include --extra-include-dirs=/nix/store/9csmflf5p58jf3h2i36x0p5b5cw3aijf-git-2.14.1/include --extra-include-dirs=/nix/store/clvw27qshazq458waarrjqj0k5qpnjkn-pkg-config-0.29/include --extra-include-dirs=/nix/store/ff6n25jbkj71kr5sbazgwa9zlngyllx7-pcre-8.40-dev/include --extra-include-dirs=/nix/store/kpa2p2p0m4xys9wdm735nw9xi4d3n5gr-zlib-1.2.11-dev/include --extra-include-dirs=/nix/store/px00dygm925m7caqwnm76xi46m2rcx4p-binutils-2.27-dev/include --extra-include-dirs=/nix/store/vs9mh0q32flklzi8hl0ksr9d3jv21399-ghc-8.0.2/include --extra-lib-dirs=/nix/store/681f2q7npfgr6394dg3yqc7mh0n2wns9-binutils-2.27-lib/lib --extra-lib-dirs=/nix/store/9csmflf5p58jf3h2i36x0p5b5cw3aijf-git-2.14.1/lib --extra-lib-dirs=/nix/store/clvw27qshazq458waarrjqj0k5qpnjkn-pkg-config-0.29/lib --extra-lib-dirs=/nix/store/fwxgxaclys016hlvk68lbl0ipx5nc95l-pcre-8.40/lib --extra-lib-dirs=/nix/store/hzl3zrsfw4wf0cwk1qw61a4k1c9b2667-postgresql-9.5.7-lib/lib --extra-lib-dirs=/nix/store/sg6ri2jj92sbv7f4rvchzr00d24pi4nq-zlib-1.2.11/lib --extra-lib-dirs=/nix/store/vs9mh0q32flklzi8hl0ksr9d3jv21399-ghc-8.0.2/lib
Process exited with code: ExitFailure 1
Logs have been written to: /home/matthew/backup/perfectpitch/perfectpitch/.stack-work/logs/PortMidi-0.1.5.2.log
Configuring PortMidi-0.1.5.2...
Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2: Missing dependency on a foreign
library:
* Missing C library: asound
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.
의견은 내가 그것을 설치하도록 제안했습니다 alsaLib
. 나는 nix-env
명령을 실행하여 이 작업을 수행 하려고 합니다 $ nix-env -iA nixos.alsaLib
. 이 시도는 실패했습니다( * Missing C library: asound
이 설치 후에 빌드하려고 할 nix-env
때 동일한 오류가 발생했습니다 ).
답변1
나는 다음을 넣어서 이 작업을 수행했습니다 stack.yaml
.
nix:
packages: [alsaLib]