From 8a34e6539cfc4b6b4a7bf3e3fe7062b01e654ba0 Mon Sep 17 00:00:00 2001
From: Albert Graef <aggraef@gmail.com>
Date: Wed, 14 Apr 2021 12:53:35 +0200
Subject: [PATCH] debuild: Adjust the arm64 build to use Maurits Lamers' nwjs
 package.

---
 debuild/Makefile     |  7 ++++++-
 debuild/debian/rules | 12 +++++++++---
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/debuild/Makefile b/debuild/Makefile
index 3895b7d36..053f9746f 100644
--- a/debuild/Makefile
+++ b/debuild/Makefile
@@ -48,7 +48,9 @@ nwjsver = 0.28.1
 nwjspkg = nwjs-sdk-v$(nwjsver)-linux
 nwjsver_arm = 0.27.6
 nwjspkg_arm = nwjs-sdk-v$(nwjsver_arm)-linux
-nwjs = $(nwjspkg)-ia32.tar.gz $(nwjspkg)-x64.tar.gz $(nwjspkg_arm)-arm.tar.gz
+nwjsver_arm64 = 0.23.7
+nwjspkg_arm64 = nwjs-sdk-without-nacl-v$(nwjsver_arm64)-linux
+nwjs = $(nwjspkg)-ia32.tar.gz $(nwjspkg)-x64.tar.gz $(nwjspkg_arm)-arm.tar.gz $(nwjspkg_arm64)-arm64.tar.gz
 
 # Submodules (Gem, etc.). You can list them with 'make submodules'.
 #submodules = Gem externals/miXed $(addprefix l2ork_addons/, cwiid fftease3.0-32bit lyonpotpourri rtcmix-in-pd)
@@ -117,5 +119,8 @@ $(debsrc):
 debian/nwjs/$(nwjspkg_arm)-arm.tar.gz:
 	mkdir -p debian/nwjs &&	cd debian/nwjs && wget https://github.com/LeonardLaszlo/nw.js-armv7-binaries/releases/download/v$(nwjsver_arm)/$(notdir $@)
 
+debian/nwjs/$(nwjspkg_arm64)-arm64.tar.gz:
+	mkdir -p debian/nwjs &&	cd debian/nwjs && wget https://github.com/LeonardLaszlo/nw.js-armv7-binaries/releases/download/v$(nwjsver_arm64)/$(notdir $@)
+
 debian/nwjs/$(nwjspkg)-%.tar.gz:
 	mkdir -p debian/nwjs &&	cd debian/nwjs && wget http://dl.nwjs.io/v$(nwjsver)/$(notdir $@)
diff --git a/debuild/debian/rules b/debuild/debian/rules
index 5cf265d2b..d8c498f3f 100755
--- a/debuild/debian/rules
+++ b/debuild/debian/rules
@@ -6,13 +6,15 @@
 
 nwjsver = 0.28.1
 nwjspkg = nwjs-sdk-v$(nwjsver)-linux
+nwjsdir = nwjs-sdk-v$(nwjsver)-linux
 
 ifeq ("$(shell dpkg-architecture -qDEB_HOST_ARCH)","armhf")
 arch = arm
 nwjsver = 0.27.6
 else ifeq ("$(shell dpkg-architecture -qDEB_HOST_ARCH)","arm64")
-arch = arm
-nwjsver = 0.27.6
+arch = arm64
+nwjsver = 0.23.7
+nwjspkg = nwjs-sdk-without-nacl-v$(nwjsver)-linux
 else ifeq ("$(shell dpkg-architecture -qDEB_HOST_ARCH)","amd64")
 arch = x64
 else
@@ -41,7 +43,7 @@ override_dh_auto_test:
 override_dh_auto_build:
 # Copy the nw.js sources to where purr-data wants them.
 	@echo "DEB_HOST_ARCH = $(shell dpkg-architecture -qDEB_HOST_ARCH)"
-	tar -xf debian/nwjs/$(nwjspkg)-$(arch).tar.gz && rm -rf pd/nw/nw && mv $(nwjspkg)-$(arch) pd/nw/nw
+	tar -xf debian/nwjs/$(nwjspkg)-$(arch).tar.gz && rm -rf pd/nw/nw && mv $(nwjsdir)-$(arch) pd/nw/nw
 	cd l2ork_addons && (export V=0 inst_dir=$(prefix); ./tar_em_up.sh -Bn)
 	make check prefix=$(prefix)
 
@@ -59,6 +61,10 @@ ifeq ($(arch),ia32)
 # This causes trouble in 32 bit builds (64 bit executable in the 32 bit nw.js distribution?), remove it.
 	cd debian/purr-data$(prefix)/lib/pd-l2ork && rm -rf bin/nw/minidump_stackwalk
 endif
+ifeq ($(arch),arm64)
+# Same issue in arm64 builds.
+	cd debian/purr-data$(prefix)/lib/pd-l2ork && rm -rf bin/nw/minidump_stackwalk
+endif
 # Add the bash completion file again, and edit it accordingly.
 	mkdir -p debian/purr-data/etc/bash_completion.d
 	sed -e 's/pd-l2ork/purr-data/g' < scripts/bash_completion/pd-l2ork > debian/purr-data/etc/bash_completion.d/purr-data
-- 
GitLab