mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-25 17:55:21 +00:00
androidenv: fix android cross-compilers
These were completely broken. Even if they managed to output a binary, it wouldn't actually run on the actual device.
This commit is contained in:
@@ -16,7 +16,7 @@ deployAndroidPackage {
|
||||
patchInstructions = lib.optionalString (os == "linux") (''
|
||||
patchShebangs .
|
||||
|
||||
# Fix the shebangs of the auto-generated scripts.
|
||||
# LEGACY: Fix the shebangs of the auto-generated scripts.
|
||||
substituteInPlace ./build/tools/make_standalone_toolchain.py \
|
||||
--replace '#!/bin/bash' '#!${pkgs.bash}/bin/bash'
|
||||
|
||||
@@ -29,6 +29,15 @@ deployAndroidPackage {
|
||||
# TODO: allow this stuff
|
||||
rm -rf docs tests
|
||||
|
||||
# Ndk now has a prebuilt toolchains inside, the file layout has changed, we do a symlink
|
||||
# to still support the old standalone toolchains builds.
|
||||
if [ -d $out/libexec/android-sdk/ndk ] && [ ! -d $out/libexec/android-sdk/ndk-bundle ]; then
|
||||
ln -sf $out/libexec/android-sdk/ndk/${package.revision} $out/libexec/android-sdk/ndk-bundle
|
||||
else
|
||||
echo "The ndk-bundle layout has changed. The nix expressions have to be updated!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Patch the executables of the toolchains, but not the libraries -- they are needed for crosscompiling
|
||||
if [ -d $out/libexec/android-sdk/ndk-bundle/toolchains/renderscript/prebuilt/linux-x86_64/lib64 ]; then
|
||||
addAutoPatchelfSearchPath $out/libexec/android-sdk/ndk-bundle/toolchains/renderscript/prebuilt/linux-x86_64/lib64
|
||||
|
||||
Reference in New Issue
Block a user