hyprwm / xdg-desktop-portal-hyprland

xdg-desktop-portal backend for Hyprland
BSD 3-Clause "New" or "Revised" License
273 stars 47 forks source link

Makefile and meson differences #95

Open Frontear opened 1 year ago

Frontear commented 1 year ago
vaxerski commented 1 year ago

shouldn't sdbus-cpp be statically linked with da makefile?

Frontear commented 1 year ago

afaik i dont see it. ran make in a clean chroot without sdbus and the code compiled without a hitch

vaxerski commented 1 year ago

well because sdbus-cpp is a subproject. CMake uses that, Meson uses a dep (because nix)

timblaktu commented 1 year ago

Re: "Makefile does not enforce runtime dependency sdbus-cpp".. build succeeds for me after separately installing the missing dependency sdbus-cpp-git.

Frontear commented 1 year ago

well because sdbus-cpp is a subproject. CMake uses that, Meson uses a dep (because nix)

I reckon though at least the Makefile should include those other files. I dont know their importance because the portal works fine without them, but for parity sake

LaptopDev commented 1 year ago

thanks for pointing this out, in fedora meson worked for me:

meson builddir
ninja -C builddir
maxwelljens commented 11 months ago

thanks for pointing this out, in fedora meson worked for me:

meson builddir
ninja -C builddir

I have Fedora 38. Tried the above, but upon ninja -C builddir I get the following error:

FAILED: src/xdg-desktop-portal-hyprland.p/core_PortalManager.cpp.o
c++ -Isrc/xdg-desktop-portal-hyprland.p -Isrc -I../src -I. -I.. -Iprotocols -I../protocols -I/usr/include/libdrm -I/usr/include/pipewire-0.3 -I/usr/include/spa-0.2 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -O3 -Wno-missing-field-initializers -Wno-narrowing -Wno-pointer-arith -Wno-unused-parameter -Wno-unused-value -fpermissive -std=c++23 -pthread -D_REENTRANT -MD -MQ src/xdg-desktop-portal-hyprland.p/core_PortalManager.cpp.o -MF src/xdg-desktop-portal-hyprland.p/core_PortalManager.cpp.o.d -o src/xdg-desktop-portal-hyprland.p/core_PortalManager.cpp.o -c ../src/core/PortalManager.cpp
In file included from ../src/core/PortalManager.cpp:1:
../src/core/PortalManager.hpp:84:14: error: ‘condition_variable’ in namespace ‘std’ does not name a type
   84 |         std::condition_variable loopSignal;
      |              ^~~~~~~~~~~~~~~~~~
../src/core/PortalManager.hpp:15:1: note: ‘std::condition_variable’ is defined in header ‘<condition_variable>’; did you forget to ‘#include <condition_variable>’?
   14 | #include <mutex>
  +++ |+#include <condition_variable>
   15 |
../src/core/PortalManager.hpp:86:33: error: field ‘shouldProcess’ has incomplete type ‘std::atomic<bool>’
   86 |         std::atomic<bool>       shouldProcess = false;
      |                                 ^~~~~~~~~~~~~
In file included from /usr/include/c++/13/bits/shared_ptr_atomic.h:33,
                 from /usr/include/c++/13/memory:81,
                 from ../src/core/PortalManager.hpp:3:
/usr/include/c++/13/bits/atomic_base.h:174:12: note: declaration of ‘class std::atomic<bool>’
  174 |     struct atomic;
      |            ^~~~~~
../src/core/PortalManager.hpp:91:14: error: ‘condition_variable’ in namespace ‘std’ does not name a type
   91 |         std::condition_variable              loopSignal;
      |              ^~~~~~~~~~~~~~~~~~
../src/core/PortalManager.hpp:91:9: note: ‘std::condition_variable’ is defined in header ‘<condition_variable>’; did you forget to ‘#include <condition_variable>’?
   91 |         std::condition_variable              loopSignal;
      |         ^~~
../src/core/PortalManager.hpp:95:30: error: ‘thread’ is not a member of ‘std’
   95 |         std::unique_ptr<std::thread>         thread;
      |                              ^~~~~~
../src/core/PortalManager.hpp:15:1: note: ‘std::thread’ is defined in header ‘<thread>’; did you forget to ‘#include <thread>’?
   14 | #include <mutex>
  +++ |+#include <thread>
   15 |
../src/core/PortalManager.hpp:95:36: error: template argument 1 is invalid
   95 |         std::unique_ptr<std::thread>         thread;
      |                                    ^
../src/core/PortalManager.hpp:95:36: error: template argument 2 is invalid
../src/core/PortalManager.hpp:95:14: error: ‘<expression error>’ in namespace ‘std’ does not name a type
   95 |         std::unique_ptr<std::thread>         thread;
      |              ^~~~~~~~~~~~~~~~~~~~~~~
../src/core/PortalManager.cpp: In lambda function:
../src/core/PortalManager.cpp:339:39: error: ‘struct CPortalManager::<unnamed>’ has no member named ‘loopSignal’
  339 |                 m_sEventLoopInternals.loopSignal.notify_all();
      |                                       ^~~~~~~~~~
../src/core/PortalManager.cpp: In member function ‘void CPortalManager::startEventLoop()’:
../src/core/PortalManager.cpp:344:21: error: ‘struct CPortalManager::<unnamed>’ has no member named ‘thread’
  344 |     m_sTimersThread.thread = std::make_unique<std::thread>([this] {
      |                     ^~~~~~
../src/core/PortalManager.cpp: In lambda function:
../src/core/PortalManager.cpp:358:29: error: ‘struct CPortalManager::<unnamed>’ has no member named ‘loopSignal’
  358 |             m_sTimersThread.loopSignal.wait_for(lk, std::chrono::milliseconds((int)nearest), [this] { return m_sTimersThread.shouldProcess; });
      |                             ^~~~~~~~~~
../src/core/PortalManager.cpp:379:39: error: ‘struct CPortalManager::<unnamed>’ has no member named ‘loopSignal’
  379 |                 m_sEventLoopInternals.loopSignal.notify_all();
      |                                       ^~~~~~~~~~
../src/core/PortalManager.cpp: In member function ‘void CPortalManager::startEventLoop()’:
../src/core/PortalManager.cpp:390:35: error: ‘struct CPortalManager::<unnamed>’ has no member named ‘loopSignal’
  390 |             m_sEventLoopInternals.loopSignal.wait(lk, [this] { return m_sEventLoopInternals.shouldProcess == true; }); // wait for events
      |                                   ^~~~~~~~~~
../src/core/PortalManager.cpp:455:21: error: ‘struct CPortalManager::<unnamed>’ has no member named ‘thread’
  455 |     m_sTimersThread.thread.release();
      |                     ^~~~~~
../src/core/PortalManager.cpp: In member function ‘void CPortalManager::addTimer(const CTimer&)’:
../src/core/PortalManager.cpp:517:21: error: ‘struct CPortalManager::<unnamed>’ has no member named ‘loopSignal’
  517 |     m_sTimersThread.loopSignal.notify_all();
      |                     ^~~~~~~~~~
../src/core/PortalManager.cpp: In member function ‘void CPortalManager::terminate()’:
../src/core/PortalManager.cpp:530:31: error: ‘struct CPortalManager::<unnamed>’ has no member named ‘loopSignal’
  530 |         m_sEventLoopInternals.loopSignal.notify_all();
      |                               ^~~~~~~~~~
../src/core/PortalManager.cpp:534:21: error: ‘struct CPortalManager::<unnamed>’ has no member named ‘loopSignal’
  534 |     m_sTimersThread.loopSignal.notify_all();
      |                     ^~~~~~~~~~
[25/32] Compiling C++ object src/xdg-desktop-portal-hyprland.p/shared_Session.cpp.o
FAILED: src/xdg-desktop-portal-hyprland.p/shared_Session.cpp.o
c++ -Isrc/xdg-desktop-portal-hyprland.p -Isrc -I../src -I. -I.. -Iprotocols -I../protocols -I/usr/include/libdrm -I/usr/include/pipewire-0.3 -I/usr/include/spa-0.2 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -O3 -Wno-missing-field-initializers -Wno-narrowing -Wno-pointer-arith -Wno-unused-parameter -Wno-unused-value -fpermissive -std=c++23 -pthread -D_REENTRANT -MD -MQ src/xdg-desktop-portal-hyprland.p/shared_Session.cpp.o -MF src/xdg-desktop-portal-hyprland.p/shared_Session.cpp.o.d -o src/xdg-desktop-portal-hyprland.p/shared_Session.cpp.o -c ../src/shared/Session.cpp
In file included from ../src/shared/Session.cpp:2:
../src/shared/../core/PortalManager.hpp:84:14: error: ‘condition_variable’ in namespace ‘std’ does not name a type
   84 |         std::condition_variable loopSignal;
      |              ^~~~~~~~~~~~~~~~~~
../src/shared/../core/PortalManager.hpp:15:1: note: ‘std::condition_variable’ is defined in header ‘<condition_variable>’; did you forget to ‘#include <condition_variable>’?
   14 | #include <mutex>
  +++ |+#include <condition_variable>
   15 |
../src/shared/../core/PortalManager.hpp:86:33: error: field ‘shouldProcess’ has incomplete type ‘std::atomic<bool>’
   86 |         std::atomic<bool>       shouldProcess = false;
      |                                 ^~~~~~~~~~~~~
In file included from /usr/include/c++/13/bits/shared_ptr_atomic.h:33,
                 from /usr/include/c++/13/memory:81,
                 from /usr/include/sdbus-c++/TypeTraits.h:36,
                 from /usr/include/sdbus-c++/IConnection.h:30,
                 from /usr/include/sdbus-c++/sdbus-c++.h:27,
                 from ../src/shared/Session.hpp:3,
                 from ../src/shared/Session.cpp:1:
/usr/include/c++/13/bits/atomic_base.h:174:12: note: declaration of ‘class std::atomic<bool>’
  174 |     struct atomic;
      |            ^~~~~~
../src/shared/../core/PortalManager.hpp:91:14: error: ‘condition_variable’ in namespace ‘std’ does not name a type
   91 |         std::condition_variable              loopSignal;
      |              ^~~~~~~~~~~~~~~~~~
../src/shared/../core/PortalManager.hpp:91:9: note: ‘std::condition_variable’ is defined in header ‘<condition_variable>’; did you forget to ‘#include <condition_variable>’?
   91 |         std::condition_variable              loopSignal;
      |         ^~~
../src/shared/../core/PortalManager.hpp:95:30: error: ‘thread’ is not a member of ‘std’
   95 |         std::unique_ptr<std::thread>         thread;
      |                              ^~~~~~
../src/shared/../core/PortalManager.hpp:15:1: note: ‘std::thread’ is defined in header ‘<thread>’; did you forget to ‘#include <thread>’?
   14 | #include <mutex>
  +++ |+#include <thread>
   15 |
../src/shared/../core/PortalManager.hpp:95:36: error: template argument 1 is invalid
   95 |         std::unique_ptr<std::thread>         thread;
      |                                    ^
../src/shared/../core/PortalManager.hpp:95:36: error: template argument 2 is invalid
../src/shared/../core/PortalManager.hpp:95:14: error: ‘<expression error>’ in namespace ‘std’ does not name a type
   95 |         std::unique_ptr<std::thread>         thread;
      |              ^~~~~~~~~~~~~~~~~~~~~~~
[30/32] Compiling C++ object hyprland-share-picker/hyprland-share-picker.p/main.cpp.o
ninja: build stopped: subcommand failed.
cgevans commented 7 months ago

I have Fedora 38. Tried the above, but upon ninja -C builddir I get the following error:

That may be related to #191 .