2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv
|
2020-06-18 07:06:33 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, pkg-config
|
|
|
|
, autoreconfHook
|
|
|
|
, curl
|
|
|
|
, lua
|
|
|
|
, openssl
|
|
|
|
, features ? {
|
|
|
|
urls = false;
|
|
|
|
# Upstream enables regex by default
|
|
|
|
regex = true;
|
|
|
|
# Signature support is broken with openssl 1.1.1: https://github.com/vstakhov/libucl/issues/203
|
|
|
|
signatures = false;
|
|
|
|
lua = false;
|
|
|
|
utils = false;
|
|
|
|
}
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
featureDeps = {
|
|
|
|
urls = [ curl ];
|
|
|
|
signatures = [ openssl ];
|
|
|
|
lua = [ lua ];
|
|
|
|
};
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libucl";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.9.2";
|
2020-06-18 07:06:33 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "vstakhov";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2024-04-21 15:54:59 +00:00
|
|
|
sha256 = "sha256-esNEVBa660rl3Oo2SLaLrFThFkjbqtZ1r0tjMq3h6cM=";
|
2020-06-18 07:06:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkg-config autoreconfHook ];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
buildInputs = with lib;
|
2020-06-18 07:06:33 +00:00
|
|
|
concatLists (
|
|
|
|
mapAttrsToList (feat: enabled:
|
|
|
|
optionals enabled (featureDeps."${feat}" or [])
|
|
|
|
) features
|
|
|
|
);
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
configureFlags = with lib;
|
2020-06-18 07:06:33 +00:00
|
|
|
mapAttrsToList (feat: enabled: strings.enableFeature enabled feat) features;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-06-18 07:06:33 +00:00
|
|
|
description = "Universal configuration library parser";
|
|
|
|
homepage = "https://github.com/vstakhov/libucl";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ jpotier ];
|
|
|
|
};
|
|
|
|
}
|