about summary refs log tree commit diff
path: root/pkgs/development/libraries/libconfig
diff options
context:
space:
mode:
authorTaeer Bar-Yam <taeer@bar-yam.me>2021-11-22 18:13:21 -0500
committerTaeer Bar-Yam <taeer@bar-yam.me>2021-11-22 18:13:21 -0500
commit3af06f553150512b3b3b37627eb135e7cdcd4527 (patch)
treec9badac13ef941cd272da97354eef5e0321cf065 /pkgs/development/libraries/libconfig
parentea55e013f0a9735bd384423bc057a3b367a5ce33 (diff)
downloadnixlib-3af06f553150512b3b3b37627eb135e7cdcd4527.tar
nixlib-3af06f553150512b3b3b37627eb135e7cdcd4527.tar.gz
nixlib-3af06f553150512b3b3b37627eb135e7cdcd4527.tar.bz2
nixlib-3af06f553150512b3b3b37627eb135e7cdcd4527.tar.lz
nixlib-3af06f553150512b3b3b37627eb135e7cdcd4527.tar.xz
nixlib-3af06f553150512b3b3b37627eb135e7cdcd4527.tar.zst
nixlib-3af06f553150512b3b3b37627eb135e7cdcd4527.zip
libconfig: fix static windows build
Diffstat (limited to 'pkgs/development/libraries/libconfig')
-rw-r--r--pkgs/development/libraries/libconfig/default.nix17
1 files changed, 13 insertions, 4 deletions
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;
   };
 }