diff --git a/install-wear.sh b/install-wear.sh new file mode 100755 index 0000000..d1c3de9 --- /dev/null +++ b/install-wear.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# Install prrrrrrrrr on a Wear OS watch (armeabi-v7a / 32-bit ARM). +# Connect the watch via ADB (Wi-Fi or USB debugging) before running. + +set -euo pipefail + +adb uninstall me.jappie.prrrrrrrrr 2>/dev/null || true +adb install "$(nix-build nix/apk.nix --argstr androidArch armv7a)/prrrrrrrrr.apk" diff --git a/nix/android.nix b/nix/android.nix index 74d715b..aeacc0a 100644 --- a/nix/android.nix +++ b/nix/android.nix @@ -1,10 +1,11 @@ # Android shared library — uses haskell-mobile's lib.nix. { sources ? import ../npins +, androidArch ? "aarch64" , mainModule ? ../app/MobileMain.hs }: let haskellMobileSrc = sources.haskell-mobile; - lib = import "${haskellMobileSrc}/nix/lib.nix" { inherit sources; }; + lib = import "${haskellMobileSrc}/nix/lib.nix" { inherit sources androidArch; }; in lib.mkAndroidLib { inherit haskellMobileSrc mainModule; diff --git a/nix/apk.nix b/nix/apk.nix index 8d46c2e..7b697b5 100644 --- a/nix/apk.nix +++ b/nix/apk.nix @@ -1,12 +1,13 @@ # APK packaging — uses haskell-mobile's lib.nix. -{ sources ? import ../npins }: +{ sources ? import ../npins, androidArch ? "aarch64" }: let haskellMobileSrc = sources.haskell-mobile; - lib = import "${haskellMobileSrc}/nix/lib.nix" { inherit sources; }; - sharedLib = import ./android.nix { inherit sources; }; + abiDir = { aarch64 = "arm64-v8a"; armv7a = "armeabi-v7a"; }.${androidArch}; + lib = import "${haskellMobileSrc}/nix/lib.nix" { inherit sources androidArch; }; + sharedLib = import ./android.nix { inherit sources androidArch; }; in lib.mkApk { - inherit sharedLib; + sharedLibs = [{ lib = sharedLib; inherit abiDir; }]; androidSrc = ../android; apkName = "prrrrrrrrr.apk"; name = "prrrrrrrrr-apk"; diff --git a/npins/sources.json b/npins/sources.json index a998f7b..cbba99e 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -9,9 +9,9 @@ }, "branch": "master", "submodules": false, - "revision": "29d821c470163c29793e4068ec147883af57ec29", - "url": "https://github.com/jappeace/haskell-mobile/archive/29d821c470163c29793e4068ec147883af57ec29.tar.gz", - "hash": "sha256-umDNrUFu9/euQ5bq4OzwOYyuvTXfvNAAVg5nO7lF7gM=" + "revision": "93516d40ed92695a1e8cbfc9711f60a9c1bb54ed", + "url": "https://github.com/jappeace/haskell-mobile/archive/93516d40ed92695a1e8cbfc9711f60a9c1bb54ed.tar.gz", + "hash": "sha256-lqg6cUatXNJdjYKhpvmwajlhVne2jVdr4ShT0slT+OI=" }, "nixpkgs": { "type": "Channel",