2022-07-07 14:16:10 -06:00
|
|
|
all: prepare debug
|
|
|
|
|
2024-06-01 16:45:12 -06:00
|
|
|
prepare: cleanrns getrns
|
2022-07-07 14:16:10 -06:00
|
|
|
|
|
|
|
clean:
|
2022-10-20 13:32:40 -06:00
|
|
|
@echo Cleaning...
|
2022-07-07 14:16:10 -06:00
|
|
|
-(rm ./__pycache__ -r)
|
|
|
|
-(rm ./app_storage -r)
|
2023-09-20 12:12:47 -06:00
|
|
|
-(rm ./share/pkg/* -r)
|
2024-12-10 12:24:09 -07:00
|
|
|
-(rm ./share/mirrors/* -rf)
|
2022-07-07 14:16:10 -06:00
|
|
|
-(rm ./bin -r)
|
2022-07-07 14:34:01 -06:00
|
|
|
|
|
|
|
cleanlibs:
|
|
|
|
buildozer android clean
|
2022-07-07 14:16:10 -06:00
|
|
|
|
2022-07-07 14:34:01 -06:00
|
|
|
cleanall: clean cleanlibs
|
|
|
|
|
2024-06-03 19:18:14 -06:00
|
|
|
pacthfiles: patchsdl injectxml patchpycodec2
|
2022-09-17 08:00:55 -06:00
|
|
|
|
|
|
|
patchsdl:
|
2022-10-20 13:32:40 -06:00
|
|
|
# Pach USB HID behaviour
|
|
|
|
cp patches/HIDDeviceUSB.java .buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/bootstrap_builds/sdl2/jni/SDL/android-project/app/src/main/java/org/libsdl/app/HIDDeviceUSB.java
|
|
|
|
cp patches/HIDDeviceUSB.java .buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/sideband/src/main/java/org/libsdl/app/HIDDeviceUSB.java
|
|
|
|
cp patches/HIDDeviceUSB.java .buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/sideband/jni/SDL/android-project/app/src/main/java/org/libsdl/app/HIDDeviceUSB.java
|
2022-09-17 08:00:55 -06:00
|
|
|
|
2022-10-20 13:32:40 -06:00
|
|
|
# Pach service loader
|
2022-09-20 09:28:39 -06:00
|
|
|
cp patches/PythonService.java .buildozer/android/platform/python-for-android/pythonforandroid/bootstraps/common/build/src/main/java/org/kivy/android/PythonService.java
|
2022-10-20 13:32:40 -06:00
|
|
|
cp patches/PythonService.java .buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/bootstrap_builds/sdl2/src/main/java/org/kivy/android/PythonService.java
|
|
|
|
cp patches/PythonService.java .buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/sideband/src/main/java/org/kivy/android/PythonService.java
|
2022-09-20 09:28:39 -06:00
|
|
|
|
2024-06-03 19:18:14 -06:00
|
|
|
patchpycodec2:
|
|
|
|
patchelf --replace-needed libcodec2.so.1.2 libcodec2.so .buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/sideband/_python_bundle__arm64-v8a/_python_bundle/site-packages/pycodec2/pycodec2.so
|
|
|
|
patchelf --replace-needed libcodec2.so.1.2 libcodec2.so .buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/sideband/_python_bundle__armeabi-v7a/_python_bundle/site-packages/pycodec2/pycodec2.so
|
|
|
|
|
2022-09-17 08:00:55 -06:00
|
|
|
injectxml:
|
2023-07-09 18:49:58 -06:00
|
|
|
# mkdir /home/markqvist/.local/lib/python3.11/site-packages/pythonforandroid/bootstraps/sdl2/build/src/main/xml
|
2022-10-20 13:32:40 -06:00
|
|
|
# Inject XML on arm64-v8a
|
|
|
|
mkdir -p .buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/sideband/src/main/res/xml
|
|
|
|
mkdir -p .buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/sideband/templates
|
|
|
|
cp patches/device_filter.xml .buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/sideband/src/main/res/xml/
|
2022-11-22 11:46:14 -07:00
|
|
|
cp patches/file_paths.xml .buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/sideband/src/main/res/xml/
|
2022-10-20 13:32:40 -06:00
|
|
|
cp patches/AndroidManifest.tmpl.xml .buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/sideband/templates/
|
2023-07-09 18:49:58 -06:00
|
|
|
cp patches/p4a_build.py .buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/sideband/build.py
|
2022-10-20 13:32:40 -06:00
|
|
|
|
2022-07-07 14:16:10 -06:00
|
|
|
debug:
|
|
|
|
buildozer android debug
|
|
|
|
|
2022-09-17 08:00:55 -06:00
|
|
|
prebake:
|
2022-10-20 13:32:40 -06:00
|
|
|
ifneq (,$(wildcard .buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/sideband/src/main/res/xml/device_filter.xml))
|
2022-09-17 09:11:49 -06:00
|
|
|
@echo Device filter XML exists, skipping prebake
|
|
|
|
else
|
2022-10-20 13:32:40 -06:00
|
|
|
@(echo Prebaking build before patching files...)
|
|
|
|
@(sleep 2)
|
2022-09-17 08:00:55 -06:00
|
|
|
-(buildozer android release)
|
|
|
|
@(echo Prebake finished, applying patches and rebuilding...)
|
2022-10-20 13:32:40 -06:00
|
|
|
@(sleep 2)
|
2022-09-17 09:11:49 -06:00
|
|
|
endif
|
2022-09-17 08:00:55 -06:00
|
|
|
|
2023-09-20 12:12:47 -06:00
|
|
|
fetchshare:
|
2024-03-16 15:52:41 -06:00
|
|
|
-(rm ./share/pkg/*)
|
|
|
|
-(rm ./share/mirrors/* -r)
|
2023-09-20 12:12:47 -06:00
|
|
|
cp ../../dist_archive/rns-*-py3-none-any.whl ./share/pkg/
|
|
|
|
cp ../../dist_archive/rnspure-*-py3-none-any.whl ./share/pkg/
|
|
|
|
cp ../../dist_archive/lxmf-*-py3-none-any.whl ./share/pkg/
|
|
|
|
cp ../../dist_archive/nomadnet-*-py3-none-any.whl ./share/pkg/
|
|
|
|
cp ../../dist_archive/rnsh-*-py3-none-any.whl ./share/pkg/
|
2023-10-16 12:21:57 -06:00
|
|
|
cp ../../dist_archive/RNode_Firmware_*_Source.zip ./share/pkg/
|
2024-03-26 07:51:08 -06:00
|
|
|
zip --junk-paths ./share/pkg/example_plugins.zip ../docs/example_plugins/*.py
|
2023-09-20 12:12:47 -06:00
|
|
|
cp -r ../../dist_archive/reticulum.network ./share/mirrors/
|
2023-11-04 14:43:33 -06:00
|
|
|
cp -r ../../dist_archive/unsigned.io ./share/mirrors/
|
2023-09-20 12:12:47 -06:00
|
|
|
cp ../../dist_archive/Reticulum\ Manual.pdf ./share/mirrors/Reticulum_Manual.pdf
|
|
|
|
cp ../../dist_archive/Reticulum\ Manual.epub ./share/mirrors/Reticulum_Manual.epub
|
2024-12-10 12:24:09 -07:00
|
|
|
cp -r ../../rnode-flasher ./share/mirrors/
|
|
|
|
-(rm ./share/mirrors/rnode-flasher/.git -rf)
|
2023-09-20 12:12:47 -06:00
|
|
|
|
2022-07-07 14:16:10 -06:00
|
|
|
release:
|
|
|
|
buildozer android release
|
|
|
|
|
2022-10-03 04:54:35 -06:00
|
|
|
postbuild:
|
|
|
|
$(MAKE) cleanrns
|
2022-07-07 14:16:10 -06:00
|
|
|
|
2023-09-20 12:12:47 -06:00
|
|
|
apk: prepare prebake pacthfiles fetchshare release postbuild
|
2022-07-07 14:16:10 -06:00
|
|
|
|
2023-09-20 12:12:47 -06:00
|
|
|
devapk: prepare prebake pacthfiles fetchshare debug postbuild
|
2022-07-07 14:16:10 -06:00
|
|
|
|
2022-07-08 05:53:04 -06:00
|
|
|
version:
|
|
|
|
@(echo $$(python ./gv.py))
|
|
|
|
|
2022-07-07 14:16:10 -06:00
|
|
|
install:
|
2022-10-20 13:32:40 -06:00
|
|
|
adb install bin/sideband-$$(python ./gv.py)-arm64-v8a_armeabi-v7a-release.apk
|
2022-07-07 14:16:10 -06:00
|
|
|
|
|
|
|
console:
|
2022-10-03 04:54:35 -06:00
|
|
|
(adb logcat | grep "python\|sidebandservice")
|
2022-07-07 14:16:10 -06:00
|
|
|
|
|
|
|
getrns:
|
2022-10-20 13:32:40 -06:00
|
|
|
(cp -rv ../../Reticulum/RNS ./;rm ./RNS/Utilities/RNS)
|
|
|
|
-(rm ./RNS/__pycache__ -r)
|
2022-11-22 06:25:01 -07:00
|
|
|
(cp -rv ../../LXMF/LXMF ./;rm ./LXMF/Utilities/LXMF)
|
|
|
|
-(rm ./LXMF/__pycache__ -r)
|
2022-07-07 14:16:10 -06:00
|
|
|
|
|
|
|
cleanrns:
|
|
|
|
-(rm ./RNS -r)
|
2022-11-22 06:25:01 -07:00
|
|
|
-(rm ./LXMF -r)
|