summary refs log tree commit diff
path: root/pkgs/development/mobile
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2018-06-24 16:42:10 -0400
committerMatthew Bauer <mjbauer95@gmail.com>2018-06-25 17:10:11 -0400
commitd9155904b347679163c6fe6702f8ec6384bd8c40 (patch)
tree64a44f268d3e4f7ad13bdf83b8612f935e57076d /pkgs/development/mobile
parent7652b2ef16375ed1e38056c69da4125b0c25c3f2 (diff)
downloadnixlib-d9155904b347679163c6fe6702f8ec6384bd8c40.tar
nixlib-d9155904b347679163c6fe6702f8ec6384bd8c40.tar.gz
nixlib-d9155904b347679163c6fe6702f8ec6384bd8c40.tar.bz2
nixlib-d9155904b347679163c6fe6702f8ec6384bd8c40.tar.lz
nixlib-d9155904b347679163c6fe6702f8ec6384bd8c40.tar.xz
nixlib-d9155904b347679163c6fe6702f8ec6384bd8c40.tar.zst
nixlib-d9155904b347679163c6fe6702f8ec6384bd8c40.zip
androidndk: add fullNDK option
Setting this to true will disable removing some of the unused parts of
the NDK toolchain that is unused in Nixpkgs but may be used by others.

/cc @bkchr
Diffstat (limited to 'pkgs/development/mobile')
-rw-r--r--pkgs/development/mobile/androidenv/androidndk.nix6
-rw-r--r--pkgs/development/mobile/androidenv/androidndk_r8e.nix5
2 files changed, 11 insertions, 0 deletions
diff --git a/pkgs/development/mobile/androidenv/androidndk.nix b/pkgs/development/mobile/androidenv/androidndk.nix
index 150d8d758699..1e8ea65c73d9 100644
--- a/pkgs/development/mobile/androidenv/androidndk.nix
+++ b/pkgs/development/mobile/androidenv/androidndk.nix
@@ -1,6 +1,9 @@
 { stdenv, fetchurl, zlib, ncurses5, unzip, lib, makeWrapper
 , coreutils, file, findutils, gawk, gnugrep, gnused, jdk, which
 , platformTools, python3, libcxx, version, sha256
+, fullNDK ? false # set to true if you want other parts of the NDK
+                  # that is not used by Nixpkgs like sources,
+                  # examples, docs, or LLVM toolchains
 }:
 
 stdenv.mkDerivation rec {
@@ -55,11 +58,14 @@ stdenv.mkDerivation rec {
     }
     cd ${pkg_path}
 
+  '' + lib.optionalString (!fullNDK) ''
     # 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 \) \
diff --git a/pkgs/development/mobile/androidenv/androidndk_r8e.nix b/pkgs/development/mobile/androidenv/androidndk_r8e.nix
index 44fa961b992f..3c12e16277d9 100644
--- a/pkgs/development/mobile/androidenv/androidndk_r8e.nix
+++ b/pkgs/development/mobile/androidenv/androidndk_r8e.nix
@@ -1,6 +1,9 @@
 { stdenv, fetchurl, zlib, ncurses, lib, makeWrapper
 , coreutils, file, findutils, gawk, gnugrep, gnused, jdk, which
 , platformTools
+, fullNDK ? false # set to true if you want other parts of the NDK
+                  # that is not used by Nixpkgs like sources,
+                  # examples, docs, or LLVM toolchains
 }:
 
 stdenv.mkDerivation rec {
@@ -49,11 +52,13 @@ stdenv.mkDerivation rec {
         -d $out/libexec/${name} < ${ ./make-standalone-toolchain_r8e.patch }
     cd ${pkg_path}
 
+  '' + lib.optionalString (!fullNDK) ''
     # 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 \) \