TheWaveWarden / odin2

Odin 2 Synthesizer Plugin
GNU General Public License v3.0
545 stars 51 forks source link

[Bug Report] Upstream issue: juceaide fails to build on Arch Linux due to missing include (patch included) #431

Open ralgar opened 2 years ago

ralgar commented 2 years ago

Hello, maintainer of the Arch Linux package here. Glad to see the new build system, it's much better!

Describe the bug juceaide fails to build with the following error:

CMake Error at libs/JUCELV2/extras/Build/juceaide/CMakeLists.txt:92 (message):
  Failed to build juceaide

  [ 12%] Building CXX object
  extras/Build/juceaide/CMakeFiles/juceaide.dir/Main.cpp.o

  In file included from
  /home/ryzer/Projects/aur-packages/odin2-synthesizer/src/odin2/libs/JUCELV2/modules/juce_gui_basics/juce_gui_basics.h:270,

                   from /home/ryzer/Projects/aur-packages/odin2-synthesizer/src/odin2/libs/JUCELV2/extras/Build/juce_build_tools/juce_build_tools.h:56,
                   from /home/ryzer/Projects/aur-packages/odin2-synthesizer/src/odin2/libs/JUCELV2/extras/Build/juceaide/Main.cpp:26:

  /home/ryzer/Projects/aur-packages/odin2-synthesizer/src/odin2/libs/JUCELV2/modules/juce_gui_basics/windows/juce_ComponentPeer.h:
  In member function ‘void juce::ComponentPeer::setAppStyle(Style)’:

  /home/ryzer/Projects/aur-packages/odin2-synthesizer/src/odin2/libs/JUCELV2/modules/juce_gui_basics/windows/juce_ComponentPeer.h:442:18:
  error: ‘exchange’ is not a member of ‘std’

    442 |         if (std::exchange (style, s) != style)
        |                  ^~~~~~~~

To Reproduce:

Expected behavior: Expected it to build.

System Info:

Additional context: This is an upstream problem in JUCE/JUCELV2, caused by a missing include in modules/juice_gui_basics/juce_gui_basics.h.

There has already been a pull request submitted in the juce-framework/JUCE repository here, which will eventually trickle down to lv2-porting-project/JUCE. I've also patched it in my PKGBUILD, I'm just posting this in case you want to patch it here, or in case anybody else runs into this issue when trying to build Odin 2.

Here's a patch to be applied in the JUCELV2 submodule:

From 5ea95fb74bba1d2200dcc098d058f512afda26fc Mon Sep 17 00:00:00 2001
From: Ryan Algar <59636191+ralgar@users.noreply.github.com>
Date: Sat, 18 Jun 2022 12:26:23 -0700
Subject: [PATCH] Add missing <utility> include

---
 modules/juce_gui_basics/juce_gui_basics.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/juce_gui_basics/juce_gui_basics.h b/modules/juce_gui_basics/juce_gui_basics.h
index f497d0385..7aa655afa 100644
--- a/modules/juce_gui_basics/juce_gui_basics.h
+++ b/modules/juce_gui_basics/juce_gui_basics.h
@@ -54,6 +54,8 @@
 #pragma once
 #define JUCE_GUI_BASICS_H_INCLUDED

+#include <utility>
+
 #include <juce_graphics/juce_graphics.h>
 #include <juce_data_structures/juce_data_structures.h>

--
2.36.1

After the patch is applied, the rest of the build completes as expected. The JUCE submodule is missing the include as well, however it doesn't seem to be a problem for building Odin 2 on Linux.

TheWaveWarden commented 2 years ago

Cool, thanks for letting us know! Best course of action is probably to wait for the upstream patch.

ralgar commented 2 years ago

Agreed! It's easy enough to apply the patch if anyone needs. :)

soundsbyjs commented 2 years ago

Agreed! It's easy enough to apply the patch if anyone needs. :)

took me two seconds :) thanks for opening this issue!