Merge pull request #202044 from Mic92/libvterm

libvterm: fix cross compilation
This commit is contained in:
Guillaume Girol
2022-11-26 20:04:20 +00:00
committed by GitHub
2 changed files with 20 additions and 8 deletions
@@ -17,8 +17,11 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ perl libtool ];
makeFlags = [ "PREFIX=$(out)" ]
++ lib.optional stdenv.isDarwin "LIBTOOL=${libtool}/bin/libtool";
makeFlags = [
"CC=${stdenv.cc.targetPrefix}cc"
"LIBTOOL=${libtool}/bin/libtool"
"PREFIX=$(out)"
];
enableParallelBuilding = true;
@@ -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/";