Description: Avoid building the 'link' plugin on armel
Author: Christopher Knadle <Chris.Knadle@coredump.us>
Forwarded: not-needed
Last-Updated: 2025-01-18

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,3 +1,4 @@
+
 # Copyright 2020-2023 The Mumble Developers. All rights reserved.
 # Use of this source code is governed by a BSD-style license
 # that can be found in the LICENSE file at the root of the
@@ -177,6 +178,17 @@
 	message(STATUS "Disabling the overlay on ARM macOS")
 endif()
 
+# Use Debian's dpkg-architecture to get the specific CPU architecture
+# This will be used later in plugins/CMakeLists.txt to avoid building
+# the "link" plugin for armel which is casuing the build to fail there
+execute_process(COMMAND
+  dpkg-architecture
+    -qDEB_HOST_ARCH
+  OUTPUT_VARIABLE
+    CMAKE_DEB_HOST_ARCH
+  OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+
 if(overlay)
 	if(WIN32)
 		add_subdirectory(overlay)
--- a/plugins/CMakeLists.txt
+++ b/plugins/CMakeLists.txt
@@ -1,4 +1,3 @@
-# Copyright 2020-2023 The Mumble Developers. All rights reserved.
 # Use of this source code is governed by a BSD-style license
 # that can be found in the LICENSE file at the root of the
 # Mumble source tree or at <https://www.mumble.info/LICENSE>.
@@ -13,10 +12,15 @@
 
 set(AVAILABLE_PLUGINS "")
 
-# Plugins available on all platforms
-list(APPEND AVAILABLE_PLUGINS
-	"link"
-)
+# Avoid building 'link' plugin on armel which causes the build to fail
+if(${CMAKE_DEB_HOST_ARCH} MATCHES "armel")
+	message(STATUS "Avoid building link plugin on armel")
+else()
+	# Plugins available on all platforms
+	list(APPEND AVAILABLE_PLUGINS
+		"link"
+	)
+endif()
 
 if(${CMAKE_BUILD_TYPE} MATCHES Debug)
 	message("Including TestPlugin in debug mode")
