about summary refs log tree commit diff
path: root/pkgs/development/libraries/qdjango
diff options
context:
space:
mode:
authorOPNA2608 <christoph.neidahl@gmail.com>2023-06-15 19:19:40 +0200
committerOPNA2608 <christoph.neidahl@gmail.com>2023-06-15 19:19:40 +0200
commit9231527e6b8dfa047a3ab9a5c3a11f10c656fe0c (patch)
tree8cfd5e3ee0c33098b0c434aa1b661311ff708645 /pkgs/development/libraries/qdjango
parent5e8556cbc2249b2cfc86ee8328d21636a45c8a9d (diff)
qdjango: Potential test fix for Darwin
Diffstat (limited to 'pkgs/development/libraries/qdjango')
-rw-r--r--pkgs/development/libraries/qdjango/default.nix13
1 files changed, 13 insertions, 0 deletions
diff --git a/pkgs/development/libraries/qdjango/default.nix b/pkgs/development/libraries/qdjango/default.nix
index 5793a62969b0d..8036373a826ad 100644
--- a/pkgs/development/libraries/qdjango/default.nix
+++ b/pkgs/development/libraries/qdjango/default.nix
@@ -23,6 +23,11 @@ stdenv.mkDerivation (finalAttrs: {
     # HTML docs depend on regular docs
     substituteInPlace qdjango.pro \
       --replace 'dist.depends = docs' 'htmldocs.depends = docs'
+  '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
+    # tst_Auth:constIterator (tests/db/auth/tst_auth.cpp:624) fails on Darwin?
+    # QVERIFY(&*(it += 2) == 0) evals to false
+    substituteInPlace tests/db/db.pro \
+      --replace 'auth' ""
   '';
 
   qmakeFlags = [
@@ -44,6 +49,14 @@ stdenv.mkDerivation (finalAttrs: {
 
   doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
 
+  preCheck = lib.optionalString stdenv.hostPlatform.isDarwin ''
+    # at this point in the build, install_name for dylibs hasn't been patched yet so we need to set the library path.
+    # for some reason, this doesn't work when just exporting the needed paths even though the autogenerated wrappers
+    # should at most prepend paths? just patch them into the wrappers instead
+    substituteInPlace $(find tests -name target_wrapper.sh) \
+      --replace 'DYLD_LIBRARY_PATH=' "DYLD_LIBRARY_PATH=$PWD/src/db:$PWD/src/http:"
+  '';
+
   passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
 
   meta = with lib; {