about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMathew Polzin <matt.polzin@gmail.com>2023-11-29 12:19:18 -0600
committerMatt Polzin <mpolzin@workwithopal.com>2023-11-30 15:33:13 -0600
commit249a6de70328745500616204209551612bece7e5 (patch)
tree8bae3894d29741c10dce4f0957a27afb39a6f7ef
parentc67a44307a994ce6b8a91567c409765861b06134 (diff)
graphite2: fix cross-compilation
Cross compilation failed for me with the following message:
24/85 Test #48: charis7 ..........................   Passed    0.02 sec
      Start  1: nolib-stdc++-graphite2_core
Could not find executable readelf

In other words, the check failed because one of the tests uses readelf and when cross-compiling this tool has a prefix for the target architecture.
-rw-r--r--pkgs/development/libraries/silgraphite/graphite2.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkgs/development/libraries/silgraphite/graphite2.nix b/pkgs/development/libraries/silgraphite/graphite2.nix
index 5e7358fa15f9a..ec44d80d04a8d 100644
--- a/pkgs/development/libraries/silgraphite/graphite2.nix
+++ b/pkgs/development/libraries/silgraphite/graphite2.nix
@@ -28,6 +28,10 @@ stdenv.mkDerivation rec {
     #   https://github.com/silnrsi/graphite/pull/74
     substituteInPlace tests/CMakeLists.txt \
       --replace 'add_subdirectory(nametabletest)' '#add_subdirectory(nametabletest)'
+
+    # support cross-compilation by using target readelf binary:
+    substituteInPlace Graphite.cmake \
+      --replace 'readelf' "${stdenv.cc.targetPrefix}readelf"
   '';
 
   cmakeFlags = lib.optionals static [