androidenv.buildTools: patch hard-coded /bin/ls paths

This commit is contained in:
Nick Novitski 2018-10-24 20:36:33 -07:00
parent ad501e4c2f
commit f5c2960a11
2 changed files with 8 additions and 3 deletions

View File

@ -1,4 +1,4 @@
{stdenv, stdenv_32bit, fetchurl, unzip, zlib_32bit, ncurses_32bit, file, zlib, ncurses}: {stdenv, stdenv_32bit, fetchurl, unzip, zlib_32bit, ncurses_32bit, file, zlib, ncurses, coreutils}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "28.0.3"; version = "28.0.3";
@ -20,9 +20,14 @@ stdenv.mkDerivation rec {
unzip $src unzip $src
mv android-* ${version} mv android-* ${version}
cd ${version}
for f in $(grep -Rl /bin/ls .); do
sed -i -e "s|/bin/ls|${coreutils}/bin/ls|" "$f"
done
${stdenv.lib.optionalString (stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux") ${stdenv.lib.optionalString (stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux")
'' ''
cd ${version}
ln -s ${ncurses.out}/lib/libncurses.so.5 `pwd`/lib64/libtinfo.so.5 ln -s ${ncurses.out}/lib/libncurses.so.5 `pwd`/lib64/libtinfo.so.5

View File

@ -10,7 +10,7 @@ rec {
}; };
buildTools = import ./build-tools.nix { buildTools = import ./build-tools.nix {
inherit (pkgs) stdenv fetchurl unzip zlib file; inherit (pkgs) stdenv fetchurl unzip zlib file coreutils;
stdenv_32bit = pkgs_i686.stdenv; stdenv_32bit = pkgs_i686.stdenv;
zlib_32bit = pkgs_i686.zlib; zlib_32bit = pkgs_i686.zlib;
ncurses_32bit = pkgs_i686.ncurses5; ncurses_32bit = pkgs_i686.ncurses5;