cabal2nix

  • cabal ファイルから nix ファイルを自動生成するツール

  • cabal.project は対応していない

インストール

λ nix-env -i cabal2nix

普通に入れようとすると、Cのライブラリが足りなくて死ぬ。

エラー内容
λ cabal install cabal2nix
Resolving dependencies...
Build profile: -w ghc-8.6.5 -O1
In order, the following will be built (use -v for more details):
 - hopenssl-2.2.4 (lib) (requires build)
 - cabal2nix-2.14.4 (lib) (requires build)
 - cabal2nix-2.14.4 (exe:hackage2nix) (requires build)
 - cabal2nix-2.14.4 (exe:cabal2nix) (requires build)
Starting     hopenssl-2.2.4 (lib)

Failed to build hopenssl-2.2.4. The failure occurred during the configure
step.
Build log ( /Users/gupi/.cabal/logs/ghc-8.6.5/hpnssl-2.2.4-326b2ca8.log ):
Configuring library for hopenssl-2.2.4..
cabal: Missing dependency on a foreign library:
* Missing (or bad) header file: openssl/evp.h
* Missing (or bad) C library: crypto
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.If the
library file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.
If the header file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.

cabal: Failed to build hopenssl-2.2.4 (which is required by exe:hackage2nix
from cabal2nix-2.14.4 and exe:cabal2nix from cabal2nix-2.14.4). See the build
log above for details..

使い方

λ cabal2nix . > default.nix

参考リソース

Last updated