Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib 2, stdenv 3, fetchFromGitHub 4, fetchpatch 5, autoreconfHook 6, flex 7}: 8 9stdenv.mkDerivation rec { 10 pname = "libconfuse"; 11 version = "3.3"; 12 13 src = fetchFromGitHub { 14 sha256 = "1npfk5jv59kk4n8pkyx89fn9s6p8x3gbffs42jaw24frgxfgp8ca"; 15 rev = "v${version}"; 16 repo = "libconfuse"; 17 owner = "martinh"; 18 }; 19 20 patches = [ 21 (fetchpatch { 22 name = "CVE-2022-40320.patch"; 23 urls = [ 24 "https://sources.debian.org/data/main/libc/libconfuse/3.3-3/debian/patches/CVE-2022-40320.patch" 25 # files on sources.debian.org can disappear 26 "https://web.archive.org/web/20230107133212/https://sources.debian.org/data/main/libc/libconfuse/3.3-3/debian/patches/CVE-2022-40320.patch" 27 ]; 28 sha256 = "sha256-ftfE9JFz4nyRSOb2xHb9BAtgWn5Yv2WLm4RegDLtiBw="; 29 }) 30 ]; 31 32 postPatch = '' 33 substituteInPlace tests/Makefile.am \ 34 --replace 'TESTS += empty_string' "" \ 35 --replace 'TESTS += print_filter' "" 36 ''; 37 38 nativeBuildInputs = [ autoreconfHook flex ]; 39 40 enableParallelBuilding = true; 41 42 # On darwin the tests depend on the installed libraries because of install_name. 43 doInstallCheck = true; 44 installCheckTarget = "check"; 45 46 meta = with lib; { 47 inherit (src.meta) homepage; 48 description = "Small configuration file parser library for C"; 49 longDescription = '' 50 libConfuse (previously libcfg) is a configuration file parser library 51 written in C. It supports sections and (lists of) values, as well as 52 some other features. It makes it very easy to add configuration file 53 capability to a program using a simple API. 54 55 The goal of libConfuse is not to be the configuration file parser library 56 with a gazillion of features. Instead, it aims to be easy to use and 57 quick to integrate with your code. 58 ''; 59 license = licenses.isc; 60 platforms = platforms.linux ++ platforms.darwin; 61 }; 62}