2023-01-11 07:51:40 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, autoreconfHook
|
|
|
|
, flex
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libconfuse";
|
2020-12-07 07:45:13 +00:00
|
|
|
version = "3.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2020-12-07 07:45:13 +00:00
|
|
|
sha256 = "1npfk5jv59kk4n8pkyx89fn9s6p8x3gbffs42jaw24frgxfgp8ca";
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
repo = "libconfuse";
|
|
|
|
owner = "martinh";
|
|
|
|
};
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "CVE-2022-40320.patch";
|
|
|
|
urls = [
|
|
|
|
"https://sources.debian.org/data/main/libc/libconfuse/3.3-3/debian/patches/CVE-2022-40320.patch"
|
|
|
|
# files on sources.debian.org can disappear
|
|
|
|
"https://web.archive.org/web/20230107133212/https://sources.debian.org/data/main/libc/libconfuse/3.3-3/debian/patches/CVE-2022-40320.patch"
|
|
|
|
];
|
|
|
|
sha256 = "sha256-ftfE9JFz4nyRSOb2xHb9BAtgWn5Yv2WLm4RegDLtiBw=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-12-07 07:45:13 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace tests/Makefile.am \
|
|
|
|
--replace 'TESTS += empty_string' "" \
|
|
|
|
--replace 'TESTS += print_filter' ""
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook flex ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
# On darwin the tests depend on the installed libraries because of install_name.
|
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckTarget = "check";
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit (src.meta) homepage;
|
|
|
|
description = "Small configuration file parser library for C";
|
|
|
|
longDescription = ''
|
|
|
|
libConfuse (previously libcfg) is a configuration file parser library
|
|
|
|
written in C. It supports sections and (lists of) values, as well as
|
|
|
|
some other features. It makes it very easy to add configuration file
|
|
|
|
capability to a program using a simple API.
|
|
|
|
|
|
|
|
The goal of libConfuse is not to be the configuration file parser library
|
|
|
|
with a gazillion of features. Instead, it aims to be easy to use and
|
|
|
|
quick to integrate with your code.
|
|
|
|
'';
|
|
|
|
license = licenses.isc;
|
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
|
|
|
};
|
|
|
|
}
|