about summary refs log tree commit diff
path: root/pkgs/development/libraries/glib
diff options
context:
space:
mode:
authorsternenseemann <sternenseemann@systemli.org>2024-05-04 20:22:38 +0200
committersternenseemann <sternenseemann@systemli.org>2024-05-05 14:01:38 +0200
commit1d44c066531fa096c5e0ad0f500f346e4ca8a1c8 (patch)
tree2547efbe8b6e83a4796d693b365c280f7c43466b /pkgs/development/libraries/glib
parent0b98d1a4f14305b5cf74a9608cf4a70d03fc26f7 (diff)
glib: fix librarySuffix calculation in cross case
The libraries are built for the host platform. glib should be
independent of the target platform as it is not a compiler.

Fixes build and in some cases eval of pkgsCross.*.buildPackages.glib and
in similar situations (e.g. pkgsStatic.buildPackages).
Diffstat (limited to 'pkgs/development/libraries/glib')
-rw-r--r--pkgs/development/libraries/glib/default.nix9
1 files changed, 5 insertions, 4 deletions
diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix
index 5a7f49ce94ae1..60a0f757c1d70 100644
--- a/pkgs/development/libraries/glib/default.nix
+++ b/pkgs/development/libraries/glib/default.nix
@@ -47,10 +47,10 @@ let
     x11Support = false;
   };
 
-  librarySuffix = if (stdenv.targetPlatform.extensions.library == ".so") then "2.0.so.0"
-                  else if (stdenv.targetPlatform.extensions.library == ".dylib") then "2.0.0.dylib"
-                  else if (stdenv.targetPlatform.extensions.library == ".a") then "2.0.a"
-                  else if (stdenv.targetPlatform.extensions.library == ".dll") then "2.0-0.dll"
+  librarySuffix = if (stdenv.hostPlatform.extensions.library == ".so") then "2.0.so.0"
+                  else if (stdenv.hostPlatform.extensions.library == ".dylib") then "2.0.0.dylib"
+                  else if (stdenv.hostPlatform.extensions.library == ".a") then "2.0.a"
+                  else if (stdenv.hostPlatform.extensions.library == ".dll") then "2.0-0.dll"
                   else "2.0-0.lib";
 in
 
@@ -238,6 +238,7 @@ stdenv.mkDerivation (finalAttrs: {
 
   nativeCheckInputs = [ tzdata desktop-file-utils shared-mime-info ];
 
+  # Conditional necessary to break infinite recursion with passthru.tests
   preCheck = lib.optionalString finalAttrs.finalPackage.doCheck or config.doCheckByDefault or false ''
     export LD_LIBRARY_PATH="$NIX_BUILD_TOP/glib-${finalAttrs.version}/glib/.libs''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
     export TZDIR="${tzdata}/share/zoneinfo"