libconfig: fix static windows build

This commit is contained in:
Taeer Bar-Yam 2021-11-22 18:13:21 -05:00
parent ea55e013f0
commit 3af06f5531

View file

@ -1,4 +1,10 @@
{ lib, stdenv, fetchurl }:
{ lib
, stdenv
, fetchurl
, # this also disables building tests.
# on static windows cross-compile they fail to build
doCheck ? with stdenv.hostPlatform; !(isWindows && isStatic)
}:
stdenv.mkDerivation rec {
pname = "libconfig";
@ -9,15 +15,18 @@ stdenv.mkDerivation rec {
sha256 = "sha256-VFFm1srAN3RDgdHpzFpUBQlOe/rRakEWmbz/QLuzHuc=";
};
doCheck = true;
inherit doCheck;
configureFlags = lib.optional (stdenv.targetPlatform.isWindows || stdenv.hostPlatform.isStatic) "--disable-examples";
configureFlags = lib.optional (stdenv.hostPlatform.isWindows || stdenv.hostPlatform.isStatic) "--disable-examples"
++ lib.optional (!doCheck) "--disable-tests";
cmakeFlags = lib.optionals (!doCheck) [ "-DBUILD_TESTS:BOOL=OFF" ];
meta = with lib; {
homepage = "http://www.hyperrealm.com/libconfig";
description = "A simple library for processing structured configuration files";
license = licenses.lgpl3;
maintainers = [ maintainers.goibhniu ];
platforms = with platforms; linux ++ darwin ++ windows;
platforms = platforms.all;
};
}