Skip to content

build of pkgsCross.aarch64-multiplatform.openalSoft with pipewire fails #183774

@Artturin

Description

@Artturin

https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2459

openal-soft-aarch64-unknown-linux-gnu> In file included from /nix/store/pkdf5x54hyhf0fga65bs5qy6ihg3r2i3-pipewire-aarch64-unknown-linux-gnu-0.3.56-dev/include/spa-0.2/spa/support/plugin.h:32,
openal-soft-aarch64-unknown-linux-gnu>                  from /nix/store/pkdf5x54hyhf0fga65bs5qy6ihg3r2i3-pipewire-aarch64-unknown-linux-gnu-0.3.56-dev/include/pipewire-0.3/pipewire/pipewire.h:32,
openal-soft-aarch64-unknown-linux-gnu>                  from /build/source/alc/backends/pipewire.cpp:68:
openal-soft-aarch64-unknown-linux-gnu> /nix/store/pkdf5x54hyhf0fga65bs5qy6ihg3r2i3-pipewire-aarch64-unknown-linux-gnu-0.3.56-dev/include/spa-0.2/spa/utils/json.h: In function 'char* spa_json_format_float(char*, int, float)':
openal-soft-aarch64-unknown-linux-gnu> /nix/store/pkdf5x54hyhf0fga65bs5qy6ihg3r2i3-pipewire-aarch64-unknown-linux-gnu-0.3.56-dev/include/spa-0.2/spa/utils/json.h:265:20: error: 'isnormal' was not declared in this scope; did you mean 'std::isnormal'?
openal-soft-aarch64-unknown-linux-gnu>   265 |  if (SPA_UNLIKELY(!isnormal(val))) {
openal-soft-aarch64-unknown-linux-gnu>       |                    ^~~~~~~~
openal-soft-aarch64-unknown-linux-gnu> /nix/store/pkdf5x54hyhf0fga65bs5qy6ihg3r2i3-pipewire-aarch64-unknown-linux-gnu-0.3.56-dev/include/spa-0.2/spa/utils/defs.h:244:46: note: in definition of macro 'SPA_UNLIKELY'
openal-soft-aarch64-unknown-linux-gnu>   244 | #define SPA_UNLIKELY(x) (__builtin_expect(!!(x),0))
openal-soft-aarch64-unknown-linux-gnu>       |                                              ^
openal-soft-aarch64-unknown-linux-gnu> In file included from /build/source/common/alnumeric.h:5,
openal-soft-aarch64-unknown-linux-gnu>                  from /build/source/alc/backends/pipewire.cpp:41:
openal-soft-aarch64-unknown-linux-gnu> /nix/store/fdr1d3dipncyg8piql2mrdadf54171z2-aarch64-unknown-linux-gnu-stage-final-gcc-debug-9.5.0/aarch64-unknown-linux-gnu/include/c++/9.5.0/cmath:654:5: note: 'std::isnormal' declared here
openal-soft-aarch64-unknown-linux-gnu>   654 |     isnormal(_Tp __x)
openal-soft-aarch64-unknown-linux-gnu>       |     ^~~~~~~~

they say its a toolchain issue

applying the following patch makes it work

diff --git a/pkgs/development/libraries/pipewire/default.nix b/pkgs/development/libraries/pipewire/default.nix
index 991ac1ad594..7e1faa50eb0 100644
--- a/pkgs/development/libraries/pipewire/default.nix
+++ b/pkgs/development/libraries/pipewire/default.nix
@@ -186,6 +186,10 @@ let
     '';
 
     postInstall = ''
+      sed '1i#include <cmath>' -i $dev/include/spa-0.2/spa/utils/json.h
+      substituteInPlace $dev/include/spa-0.2/spa/utils/json.h \
+        --replace "isnormal" "std::isnormal"
+
       mkdir $out/nix-support
       ${if (stdenv.hostPlatform == stdenv.buildPlatform) then ''
         pushd $lib/share/pipewire

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions