2021-01-04 23:31:04 +01:00
|
|
|
{ pkgs ? import <nixpkgs> {
|
2022-03-23 10:23:13 +01:00
|
|
|
config.android_sdk.accept_license = true;
|
|
|
|
config.allowUnfree = true;
|
|
|
|
} }:
|
2021-01-04 23:31:04 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
android = pkgs.androidenv.composeAndroidPackages {
|
2021-09-21 00:42:26 +02:00
|
|
|
buildToolsVersions = [ "30.0.3" ];
|
2021-12-12 23:48:05 +01:00
|
|
|
platformVersions = [ "30" ];
|
2021-01-04 23:31:04 +01:00
|
|
|
abiVersions = [ "armeabi-v7a" ];
|
|
|
|
};
|
|
|
|
|
2022-03-23 10:23:13 +01:00
|
|
|
buildInputs =
|
|
|
|
[ pkgs.findutils pkgs.openjdk8 android.androidsdk pkgs.fontforge ];
|
|
|
|
|
|
|
|
# Env variable required by the Makefile
|
2021-04-11 21:02:03 +02:00
|
|
|
ANDROID_HOME = "${android.androidsdk}/libexec/android-sdk";
|
2022-03-23 10:23:13 +01:00
|
|
|
|
|
|
|
# Build the debug APK. Exposed as an attribute, used in CI
|
|
|
|
debug-apk = pkgs.stdenv.mkDerivation {
|
|
|
|
name = "unexpected-keyboard-debug";
|
|
|
|
src = ./.;
|
|
|
|
inherit buildInputs ANDROID_HOME;
|
|
|
|
buildPhase = ''
|
|
|
|
make
|
|
|
|
'';
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
mv _build/*.apk $out
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
in pkgs.mkShell { inherit buildInputs ANDROID_HOME; } // {
|
|
|
|
inherit debug-apk;
|
2021-01-04 23:31:04 +01:00
|
|
|
}
|