android sdk, makefile changes

This commit is contained in:
Tasia Iso 2024-03-22 20:25:32 +01:00
parent 658e7089be
commit 4c11667ebd
4 changed files with 35 additions and 10 deletions

View File

@ -8,14 +8,14 @@ VERSION_NUMBER := 0.0.17-wip
VERSION_NAME := Please enjoy responsibly.
SQLITE_URL := https://www.sqlite.org/2024/sqlite-amalgamation-3450200.zip
LIBUV_URL := https://dist.libuv.org/dist/v1.48.0/libuv-v1.48.0.tar.gz
PROJECT = tildefriends
BUILD_DIR ?= out
UNAME_S := $(shell uname -s)
UNAME_M := $(shell uname -m)
ANDROID_SDK ?= ~/Android/Sdk
#ANDROID_SDK ?= ~/Android/Sdk
ANDROID_SDK ?= /nix/store/54n9xsbb8gxa719g0bs7ghp336pax6mq-androidsdk/libexec/android-sdk
ifeq ($(UNAME_M),x86_64)
ifneq ($(UNAME_S),Haiku)
@ -685,6 +685,7 @@ out/res/drawable_icon.xml.flat: src/android/res/drawable/icon.xml
out/apk/res.apk out/gen/com/unprompted/tildefriends/R.java: out/res/layout_activity_main.xml.flat out/res/drawable_icon.xml.flat src/android/AndroidManifest.xml
@mkdir -p $(dir $@)
mkdir -p out/apk
@$(ANDROID_BUILD_TOOLS)/aapt2 link -I $(ANDROID_PLATFORM)/android.jar out/res/layout_activity_main.xml.flat out/res/drawable_icon.xml.flat --manifest src/android/AndroidManifest.xml -o out/apk/res.apk --java out/gen/
JAVA_FILES := out/gen/com/unprompted/tildefriends/R.java $(wildcard src/android/com/unprompted/tildefriends/*.java)
@ -809,10 +810,6 @@ apklog:
.PHONY: apklog
fetchdeps:
@echo "[fetch] libuv"
@test -f out/deps/libuv.tar.gz && test "$$(cat out/deps/libuv.txt 2>/dev/null)" = $(LIBUV_URL) || (mkdir -p out/deps/ && curl -q $(LIBUV_URL) -o out/deps/libuv.tar.gz)
@test -d deps/libuv/ && test "$$(cat out/deps/libuv.txt 2>/dev/null)" = $(LIBUV_URL) || (rm -rf deps/libuv/ && mkdir -p deps/libuv/ && tar -C deps/libuv/ -m --strip=1 -xf out/deps/libuv.tar.gz)
@echo -n $(LIBUV_URL) > out/deps/libuv.txt
@echo "[fetch] sqlite"
@test -f out/deps/sqlite.zip && test "$$(cat out/deps/sqlite.txt 2>/dev/null)" = $(SQLITE_URL) || (mkdir -p out/deps/ && curl -q $(SQLITE_URL) -o out/deps/sqlite.zip)
@test -d deps/sqlite/ && test "$$(cat out/deps/sqlite.txt 2>/dev/null)" = $(SQLITE_URL) || (mkdir -p deps/sqlite/ && unzip -qDjo -d deps/sqlite/ out/deps/sqlite.zip)

27
android-sdk.nix Normal file
View File

@ -0,0 +1,27 @@
with import <nixpkgs> {};
let
androidComposition = androidenv.composeAndroidPackages {
cmdLineToolsVersion = "9.0";
toolsVersion = "26.1.1";
platformToolsVersion = "34.0.5";
buildToolsVersions = [ "34.0.0" ];
includeEmulator = false;
#emulatorVersion = "30.3.4";
platformVersions = [ "34" ];
includeSources = false;
includeSystemImages = false;
#systemImageTypes = [ "google_apis_playstore" ];
#abiVersions = [ "armeabi-v7a" "arm64-v8a" ];
#cmakeVersions = [ "3.10.2" ];
includeNDK = true;
ndkVersions = ["26.0.10792818"];
useGoogleAPIs = false;
useGoogleTVAddOns = false;
#includeExtras = [
# "extras;google;gcm"
#];
};
in
androidComposition.androidsdk
# $ NIXPKGS_ACCEPT_ANDROID_SDK_LICENSE=1 NIXPKGS_ALLOW_UNFREE=1 nix-build android-sdk.nix --impure

View File

@ -5,6 +5,7 @@ stdenv.mkDerivation {
cmake
openssl
nodePackages.npm
jdk11
];
buildInputs = [

View File

@ -1,10 +1,10 @@
#! /bin/sh
cp node_modules/prettier/standalone.mjs deps/prettier
#cp node_modules/prettier/standalone.mjs deps/prettier
mkdir -p deps/lit
wget -O deps/lit/lit-all.min.js https://cdn.jsdelivr.net/gh/lit/dist@3.1.2/all/lit-all.min.js
wget -O deps/lit/lit-all.min.js.map https://cdn.jsdelivr.net/gh/lit/dist@3.1.2/all/lit-all.min.js.map
#mkdir -p deps/lit
#wget -O deps/lit/lit-all.min.js https://cdn.jsdelivr.net/gh/lit/dist@3.1.2/all/lit-all.min.js
#wget -O deps/lit/lit-all.min.js.map https://cdn.jsdelivr.net/gh/lit/dist@3.1.2/all/lit-all.min.js.map
cd deps/codemirror_src
npm i