Skip to content

Commit

Permalink
Merge pull request #120973 from Radvendii/libconfig-static-windows
Browse files Browse the repository at this point in the history
libconfig: fix static windows build
  • Loading branch information
Mic92 committed Dec 4, 2022
2 parents 33569a9 + 3af06f5 commit 0604713
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions pkgs/development/libraries/libconfig/default.nix
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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;
};
}

0 comments on commit 0604713

Please sign in to comment.