From 3bfd3e73bfd46a112b8054bdd705f3afae7f71bf Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Wed, 5 Dec 2018 21:37:13 +0100 Subject: [PATCH] Reintroduce licenseAccepted option --- .../mobile/androidenv/compose-android-packages.nix | 9 ++++++++- pkgs/development/mobile/androidenv/default.nix | 3 ++- pkgs/top-level/all-packages.nix | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/pkgs/development/mobile/androidenv/compose-android-packages.nix b/pkgs/development/mobile/androidenv/compose-android-packages.nix index 9125d3140e22..690f9712a10c 100644 --- a/pkgs/development/mobile/androidenv/compose-android-packages.nix +++ b/pkgs/development/mobile/androidenv/compose-android-packages.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, requireFile, makeWrapper, unzip, autoPatchelfHook, pkgs, pkgs_i686}: +{stdenv, fetchurl, requireFile, makeWrapper, unzip, autoPatchelfHook, pkgs, pkgs_i686, licenseAccepted ? false}: { toolsVersion ? "25.2.5" , platformToolsVersion ? "28.0.1" @@ -20,6 +20,13 @@ , includeExtras ? [] }: +if !licenseAccepted then throw '' + You must accept the Android Software Development Kit License Agreement at + https://developer.android.com/studio/terms + by setting nixpkgs config option 'android_sdk.accept_license = true;' + '' +else assert licenseAccepted; + let inherit (pkgs) stdenv fetchurl makeWrapper unzip; diff --git a/pkgs/development/mobile/androidenv/default.nix b/pkgs/development/mobile/androidenv/default.nix index b7aaccd37632..925601054225 100644 --- a/pkgs/development/mobile/androidenv/default.nix +++ b/pkgs/development/mobile/androidenv/default.nix @@ -1,11 +1,12 @@ { pkgs ? import {} , pkgs_i686 ? import { system = "i686-linux"; } +, licenseAccepted ? false }: rec { composeAndroidPackages = import ./compose-android-packages.nix { inherit (pkgs) stdenv fetchurl requireFile makeWrapper unzip autoPatchelfHook; - inherit pkgs pkgs_i686; + inherit pkgs pkgs_i686 licenseAccepted; }; buildApp = import ./build-app.nix { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ba6d60fef872..679a9b059193 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -831,7 +831,7 @@ in androidenv = callPackage ../development/mobile/androidenv { pkgs_i686 = pkgsi686Linux; - #licenseAccepted = (config.android_sdk.accept_license or false); + licenseAccepted = config.android_sdk.accept_license or false; }; androidndkPkgs = androidndkPkgs_17c;