From ca213228f063bb8d64feb2660fbae57e6b4700d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sat, 19 Nov 2022 10:32:17 +0100 Subject: [PATCH] libvterm: fix cross compilation --- .../libraries/libvterm/default.nix | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/libvterm/default.nix b/pkgs/development/libraries/libvterm/default.nix index 066dcb4f34f4..f1e217f2b3e5 100644 --- a/pkgs/development/libraries/libvterm/default.nix +++ b/pkgs/development/libraries/libvterm/default.nix @@ -9,17 +9,26 @@ stdenv.mkDerivation rec { sha256 = "10gaqygmmwp0cwk3j8qflri5caf8vl3f7pwfl2svw5whv8wkn0k2"; }; - patchPhase = '' - sed -i -e s@/usr@$out@ -e /ldconfig/d Makefile + preInstall = '' + mkdir -p $out/include $out/lib ''; - preInstall = '' - mkdir -p $out/include - mkdir -p $out/lib + postPatch = '' + substituteInPlace Makefile \ + --replace "gcc" "${stdenv.cc.targetPrefix}cc" \ + --replace "ldconfig" "" \ + --replace "/usr" "$out" + + makeFlagsArray+=("PKG_CFG=`${stdenv.cc.targetPrefix}pkg-config --cflags glib-2.0`") ''; + # For headers + propagatedBuildInputs = [ glib ]; + + strictDeps = true; + nativeBuildInputs = [ pkg-config ]; - buildInputs = [ glib ncurses ]; + buildInputs = [ ncurses ]; meta = with lib; { homepage = "http://libvterm.sourceforge.net/";