1{ lib
2, stdenv
3, fetchurl
4, # this also disables building tests.
5 # on static windows cross-compile they fail to build
6 doCheck ? with stdenv.hostPlatform; !(isWindows && isStatic)
7}:
8
9stdenv.mkDerivation rec {
10 pname = "libconfig";
11 version = "1.7.3";
12
13 src = fetchurl {
14 url = "https://hyperrealm.github.io/${pname}/dist/${pname}-${version}.tar.gz";
15 sha256 = "sha256-VFFm1srAN3RDgdHpzFpUBQlOe/rRakEWmbz/QLuzHuc=";
16 };
17
18 inherit doCheck;
19
20 configureFlags = lib.optional (stdenv.hostPlatform.isWindows || stdenv.hostPlatform.isStatic) "--disable-examples"
21 ++ lib.optional (!doCheck) "--disable-tests";
22
23 cmakeFlags = lib.optionals (!doCheck) [ "-DBUILD_TESTS:BOOL=OFF" ];
24
25 meta = with lib; {
26 homepage = "http://www.hyperrealm.com/libconfig";
27 description = "A simple library for processing structured configuration files";
28 license = licenses.lgpl3;
29 maintainers = [ maintainers.goibhniu ];
30 platforms = platforms.all;
31 };
32}