2021-01-04 23:31:04 +01:00
|
|
|
{ pkgs ? import <nixpkgs> {
|
2023-09-09 16:44:04 +02:00
|
|
|
config.android_sdk.accept_license = true;
|
|
|
|
config.allowUnfree = true;
|
|
|
|
} }:
|
2021-01-04 23:31:04 +01:00
|
|
|
|
|
|
|
let
|
2023-09-09 16:44:04 +02:00
|
|
|
jdk = pkgs.openjdk17;
|
|
|
|
build_tools_version = "33.0.1";
|
2022-03-24 18:42:44 +01:00
|
|
|
|
2021-01-04 23:31:04 +01:00
|
|
|
android = pkgs.androidenv.composeAndroidPackages {
|
2023-09-09 16:44:04 +02:00
|
|
|
buildToolsVersions = [ build_tools_version ];
|
|
|
|
platformVersions = [ "33" ];
|
2021-01-04 23:31:04 +01:00
|
|
|
abiVersions = [ "armeabi-v7a" ];
|
|
|
|
};
|
|
|
|
|
2023-09-09 16:44:04 +02:00
|
|
|
ANDROID_SDK_ROOT = "${android.androidsdk}/libexec/android-sdk";
|
|
|
|
|
|
|
|
# Without this option, aapt2 fails to run with a permissions error.
|
|
|
|
gradle_wrapped = pkgs.runCommandLocal "gradle-wrapped" {
|
|
|
|
nativeBuildInputs = with pkgs; [ makeBinaryWrapper ];
|
|
|
|
} ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
ln -s ${pkgs.gradle}/bin/gradle $out/bin/gradle
|
|
|
|
wrapProgram $out/bin/gradle \
|
|
|
|
--add-flags "-Dorg.gradle.project.android.aapt2FromMavenOverride=${ANDROID_SDK_ROOT}/build-tools/${build_tools_version}/aapt2"
|
|
|
|
'';
|
|
|
|
|
|
|
|
in pkgs.mkShell {
|
|
|
|
buildInputs =
|
|
|
|
[ pkgs.findutils pkgs.fontforge jdk android.androidsdk gradle_wrapped ];
|
|
|
|
JAVA_HOME = jdk.home;
|
|
|
|
inherit ANDROID_SDK_ROOT;
|
2021-01-04 23:31:04 +01:00
|
|
|
}
|