我在NixOS上,试图编译一个需要linenoise库(这是readline的替代方案)的c项目。但linenoise在nixpkgs中不可用。将linenoise库添加到nixpkgs
所以,我想自己添加它。目前,我有这样的:
{ stdenv, fetchgit }:
stdenv.mkDerivation rec {
name = "linenoise-${version}";
version = "git-2016-09-30";
src = fetchgit {
url = "https://github.com/antirez/linenoise.git";
rev = "c894b9e59f02203dbe4e2be657572cf88c4230c3";
sha256 = "0wasql7ph5g473zxhc2z47z3pjp42q0dsn4gpijwzbxawid71b4w";
};
meta = {
homepage = https://github.com/antirez/linenoise;
description = "A minimal, zero-config, BSD licensed, readline replacement.";
platforms = stdenv.lib.platforms.unix;
};
}
我有2个问题:
1:Linenoise只是对那些意味着要在使用linenoise项目直接计入C头/源文件。换句话说,没有编译,只需添加这些文件就足够了。 与目前的推导显然是试图configure/make/make install
,但我根本不知道该怎么做。
2:Linenoise需要使用pkg-config访问。