1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00

Merge pull request #42397 from obsidiansystems/more-android-fixes

androidndk: cleanups
This commit is contained in:
John Ericson 2018-06-22 17:17:53 -04:00 committed by GitHub
commit bbef861e0f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 12 deletions

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, zlib, ncurses5, p7zip, lib, makeWrapper
{ stdenv, fetchurl, zlib, ncurses5, unzip, lib, makeWrapper
, coreutils, file, findutils, gawk, gnugrep, gnused, jdk, which
, platformTools, python3, libcxx, version, sha256
}:
@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
phases = "buildPhase";
nativeBuildInputs = [ p7zip makeWrapper file ];
nativeBuildInputs = [ unzip makeWrapper file ];
buildCommand = let
bin_path = "$out/bin";
@ -32,11 +32,13 @@ stdenv.mkDerivation rec {
]) + ":${platformTools}/platform-tools";
in ''
mkdir -pv $out/libexec
mkdir -pv $out/lib64
ln -s ${ncurses5.out}/lib/libncursesw.so.5 $out/lib64/libtinfo.so.5
ln -s ${ncurses5.out}/lib/libncurses.so.5 $out/lib64/libncurses.so.5
cd $out/libexec
7z x $src
unzip -qq $src
# Steps to reduce output size
rm -rf docs sources tests
# We only support cross compiling with gcc for now
rm -rf toolchains/*-clang* toolchains/llvm-*
patchShebangs ${pkg_path}
@ -58,11 +60,11 @@ stdenv.mkDerivation rec {
}
cd ${pkg_path}
find $out \( \
find ${pkg_path}/toolchains \( \
\( -type f -a -name "*.so*" \) -o \
\( -type f -a -perm -0100 \) \
\) -exec patchelf --set-interpreter ${stdenv.cc.libc.out}/lib/ld-*so.? \
--set-rpath $out/lib64:${stdenv.lib.makeLibraryPath [ libcxx.out zlib.out ncurses5 ]} {} \;
--set-rpath ${stdenv.lib.makeLibraryPath [ libcxx zlib ncurses5 ]} {} \;
# fix ineffective PROGDIR / MYNDKDIR determination
for i in ndk-build ${lib.optionalString (version == "10e") "ndk-gdb ndk-gdb-py"}
do

View file

@ -49,7 +49,12 @@ stdenv.mkDerivation rec {
-d $out/libexec/${name} < ${ ./make-standalone-toolchain_r8e.patch }
cd ${pkg_path}
find $out \( \
# Steps to reduce output size
rm -rf docs sources tests
# We only support cross compiling with gcc for now
rm -rf toolchains/*-clang* toolchains/llvm-*
find ${pkg_path}/toolchains \( \
\( -type f -a -name "*.so*" \) -o \
\( -type f -a -perm -0100 \) \
\) -exec patchelf --set-interpreter ${stdenv.cc.libc.out}/lib/ld-*so.? \

View file

@ -226,7 +226,7 @@ rec {
androidndk_10e = import ./androidndk.nix {
inherit (buildPackages)
p7zip makeWrapper;
unzip makeWrapper;
inherit (pkgs)
stdenv fetchurl zlib ncurses5 lib python3 libcxx
coreutils file findutils gawk gnugrep gnused jdk which;
@ -237,7 +237,7 @@ rec {
androidndk_16b = import ./androidndk.nix {
inherit (buildPackages)
p7zip makeWrapper;
unzip makeWrapper;
inherit (pkgs)
stdenv fetchurl zlib ncurses5 lib python3 libcxx
coreutils file findutils gawk gnugrep gnused jdk which;
@ -248,7 +248,7 @@ rec {
androidndk_17 = import ./androidndk.nix {
inherit (buildPackages)
p7zip makeWrapper;
unzip makeWrapper;
inherit (pkgs)
stdenv fetchurl zlib ncurses5 lib python3 libcxx
coreutils file findutils gawk gnugrep gnused jdk which;