On 1/16/25 11:10, Ben Collins wrote:
On Thu, Jan 16, 2025 at 09:48:53AM -0500, Chris Knadle wrote:Greetings. I have a situation with mumble where the build is breaking on armel architecture. Upstream has identified that this bug is due to the mumble "link" plugin containing atomic memory operations. I would like to conditionally patch the source plugins/CMakeLists.txt file based on architecutre to not build that one plugin for armel. CDBS apparently has a way of doing this [1] and I would like to find a solution for doing this with debhelper. I've been searching and haven't found anything quite fitting.Can the patched code just look like: #ifdef __ARMEL__ // Patched code #else // original code with atomic memory ops #endif
Thank you. From this good hint I found an additional [1] piece that may get the rest of the way [And, ironic that this particular post on stackoverflow only received downvotes.]
---------------------- # Store in CMAKE_DEB_HOST_ARCH var the current build architecture # (Note: See link [2] below for details for this section) execute_process(COMMAND dpkg-architecture -qDEB_HOST_ARCH OUTPUT_VARIABLE CMAKE_DEB_HOST_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE ) #And use that information later in CMakeLists if(${CMAKE_DEB_HOST_ARCH} MATCHES "armhf") ... elseif(${CMAKE_DEB_HOST_ARCH} MATCHES "i386") ... else() ... endif() ----------------------Looking at the manpage for dpkg-architecture, the variable I may want to conditionally build upon might be DEB_TARGET_ARCH rather than DEB_HOST_ARCH.
[1] https://stackoverflow.com/questions/11944060/how-to-detect-target-architecture-using-cmake
[2] https://cmake.org/cmake/help/latest/command/execute_process.html -- Chris -- Chris Knadle Chris.Knadle@coredump.us