Compare commits

...

5 Commits

12 changed files with 106 additions and 151 deletions

3
.gitignore vendored
View File

@ -10,4 +10,5 @@ out
.zsign_cache/ .zsign_cache/
deps/codemirror/cm6.js deps/codemirror/cm6.js
deps/prettier/standalone.mjs deps/prettier/standalone.mjs
deps/lit

View File

@ -8,14 +8,14 @@ VERSION_NUMBER := 0.0.17-wip
VERSION_NAME := Please enjoy responsibly. VERSION_NAME := Please enjoy responsibly.
SQLITE_URL := https://www.sqlite.org/2024/sqlite-amalgamation-3450200.zip 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 PROJECT = tildefriends
BUILD_DIR ?= out BUILD_DIR ?= out
UNAME_S := $(shell uname -s) UNAME_S := $(shell uname -s)
UNAME_M := $(shell uname -m) 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) ifeq ($(UNAME_M),x86_64)
ifneq ($(UNAME_S),Haiku) 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 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 $(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/ @$(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) JAVA_FILES := out/gen/com/unprompted/tildefriends/R.java $(wildcard src/android/com/unprompted/tildefriends/*.java)
@ -809,10 +810,6 @@ apklog:
.PHONY: apklog .PHONY: apklog
fetchdeps: 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" @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 -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) @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

36
default.nix Normal file
View File

@ -0,0 +1,36 @@
with import <nixpkgs> {};
stdenv.mkDerivation rec {
pname = "tildefriends";
version = "0.0.16";
src = fetchurl {
url = "https://dev.tildefriends.net/cory/${pname}/archive/v${version}.tar.gz";
sha256 = "19iay794xxs3j3mhnpl4vwx65sflw5vvjaahp0jk85wlwlrc7ddw";
};
nativeBuildInputs = [
gnumake
openssl
];
# buildInputs = [ ]
#doCheck = true;
strictDeps = true;
outputs = [ "out" ];
meta = with lib; {
#description = "A program that produces a familiar, friendly greeting";
#longDescription = ''
# GNU Hello is a program that prints "Hello, world!" when you run it.
# It is fully customizable.
#'';
#homepage = "https://www.gnu.org/software/hello/manual/";
#changelog = "https://git.savannah.gnu.org/cgit/hello.git/plain/NEWS?h=v${version}";
license = licenses.gpl3Plus;
maintainers = [ maintainers.tasiaiso ];
platforms = platforms.all;
};
}

View File

@ -5,17 +5,17 @@
"packages": { "packages": {
"": { "": {
"dependencies": { "dependencies": {
"@codemirror/lang-css": "^6.2.1", "@codemirror/lang-css": "6.2.1",
"@codemirror/lang-html": "^6.4.8", "@codemirror/lang-html": "6.4.8",
"@codemirror/lang-javascript": "^6.2.2", "@codemirror/lang-javascript": "6.2.2",
"@codemirror/lang-json": "^6.0.1", "@codemirror/lang-json": "6.0.1",
"@codemirror/theme-one-dark": "^6.1.2", "@codemirror/theme-one-dark": "6.1.2",
"@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-node-resolve": "15.2.3",
"codemirror": "^6.0.1", "codemirror": "6.0.1",
"rollup": "^4.13.0" "rollup": "4.13.0"
}, },
"devDependencies": { "devDependencies": {
"@rollup/plugin-terser": "^0.4.4" "@rollup/plugin-terser": "0.4.4"
} }
}, },
"node_modules/@codemirror/autocomplete": { "node_modules/@codemirror/autocomplete": {

View File

@ -3,16 +3,16 @@
"build": "rollup --config rollup.config.mjs --input editor.mjs" "build": "rollup --config rollup.config.mjs --input editor.mjs"
}, },
"dependencies": { "dependencies": {
"@codemirror/lang-css": "^6.2.1", "@codemirror/lang-css": "6.2.1",
"@codemirror/lang-html": "^6.4.8", "@codemirror/lang-html": "6.4.8",
"@codemirror/lang-javascript": "^6.2.2", "@codemirror/lang-javascript": "6.2.2",
"@codemirror/lang-json": "^6.0.1", "@codemirror/lang-json": "6.0.1",
"@codemirror/theme-one-dark": "^6.1.2", "@codemirror/theme-one-dark": "6.1.2",
"@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-node-resolve": "15.2.3",
"codemirror": "^6.0.1", "codemirror": "6.0.1",
"rollup": "^4.13.0" "rollup": "4.13.0"
}, },
"devDependencies": { "devDependencies": {
"@rollup/plugin-terser": "^0.4.4" "@rollup/plugin-terser": "0.4.4"
} }
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

3
package-lock.json generated
View File

@ -5,9 +5,10 @@
"packages": { "packages": {
"": { "": {
"name": "tildefriends", "name": "tildefriends",
"hasInstallScript": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"prettier": "^3.2.5" "prettier": "3.2.5"
} }
}, },
"node_modules/prettier": { "node_modules/prettier": {

View File

@ -7,6 +7,6 @@
"author": "Cory McWilliams", "author": "Cory McWilliams",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"prettier": "^3.2.5" "prettier": "3.2.5"
} }
} }

13
shell.nix Normal file
View File

@ -0,0 +1,13 @@
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "env";
nativeBuildInputs = [
cmake
openssl
nodePackages.npm
jdk11
];
buildInputs = [
];
}

7
tools/install_dependencies.sh Normal file → Executable file
View File

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