diff --git a/pkgs/development/libraries/libconfig/default.nix b/pkgs/development/libraries/libconfig/default.nix index d94a0e1d78bd..5c06808f67c3 100644 --- a/pkgs/development/libraries/libconfig/default.nix +++ b/pkgs/development/libraries/libconfig/default.nix @@ -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; }; }