On Wed, Oct 16, 2024 at 08:03:14PM +0200, Helmut Grohne wrote:
> hyprland fails to cross build from source with an "Exec format error"
> when running hyprwayland-scanner. The most common way to fix this is
> marking the originating package Multi-Arch: foreign. That is
> hyprwayland-scanner in this case, but before doing so it must be
> considered whether such a marking is actually correct. First and
> foremost, the question is whether the hyprwayland-scanner exhibits
> architecture-dependent behaviour. There are two strong clues against.
> One is that it deals with textual input and output formats. It
> effectively translates between different forms of source. The other clue
> is that it has a similar job to wayland-scanner and that is contained in
> a binary packaged marked Multi-Arch: foreign (and thus deemed to not
> have any architecture-dependent behaviour). To me this is sufficient
> ground to move forward. Do you agree? But then, hyprwayland-scanner also
> contains a .pc file and cmake support files. Those are installed into
> architecture-dependent paths and that clearly violates Multi-Arch:
> foreign. I looked into those files and they don't have architecture
> dependent content (beyond the cmake files where the filename is
> normalized for the /usr-merge). It should be feasible to install those
> files into /usr/share instead of /usr/lib. Both cmake and pkgconf search
> those corresponding locations and in doing so, the
> architecture-dependent path goes (and the violation of Multi-Arch:
> foreign) goes missing. Once moved, I think the Multi-Arch: foreign
> marking is technically correct. Building hyprland succeeded with a thus
> modified hyprwayland-scanner and a cross build of hyprland proceeded
> quite a bit further. Please consider applying the attached patch.

The cmake files now gained bit-dependent content. We can tell cmake to
stop doing that. I'm attaching an additional patch to truly make the
cmake stuff architecture-independent.

Helmut
--- hyprwayland-scanner-0.4.2.orig/CMakeLists.txt
+++ hyprwayland-scanner-0.4.2/CMakeLists.txt
@@ -51,6 +51,7 @@
 write_basic_package_version_file(
   "hyprwayland-scanner-config-version.cmake"
   VERSION "${VERSION}"
+  ARCH_INDEPENDENT
   COMPATIBILITY AnyNewerVersion)
 
 # Installation

Reply via email to