gamescope icon indicating copy to clipboard operation
gamescope copied to clipboard

Can't build gamescope on ubuntu 24.04

Open RoyvanEmpel opened this issue 1 year ago • 4 comments

Unable to build gamescope on ubuntu 24.04.

The latest version of gamescope requires wayland-server >= 1.23, the latest version for ubuntu seems to be 1.22.0 thats why i am trying to build the version tagged 3.14.19

I Ran:

git clone https://github.com/ValveSoftware/gamescope.git
cd gamescope/
git checkout tags/3.14.19
git submodule update --init
meson build/

Resulting in the ouput (the end of the output)

Dependency libliftoff found: YES 0.5.0 (overridden)
Run-time dependency benchmark found: NO (tried pkgconfig and cmake)
Build targets in project: 203

wlroots 0.18.0-dev

    drm-backend     : NO
    x11-backend     : NO
    libinput-backend: YES
    xwayland        : YES
    gles2-renderer  : NO
    vulkan-renderer : NO
    gbm-allocator   : NO
    session         : YES
    xcb-errors      : NO
    egl             : NO

gamescope undefined

  Subprojects
    glm            : YES
    libdisplay-info: YES
    libliftoff     : YES
    openvr         : YES
    stb            : YES
    vkroots        : YES
    wlroots        : YES

Found ninja-1.11.1 at /usr/bin/ninja

after this running ninja -C build/ gives the following error:

ninja: Entering directory `build/'
[1/2] Compiling C++ object src/gamescope.p/Backends_WaylandBackend.cpp.o
FAILED: src/gamescope.p/Backends_WaylandBackend.cpp.o
ccache c++ -Isrc/gamescope.p -Isrc -I../src -I../src/reshade/source -I../src/reshade/include -I../thirdparty/SPIRV-Headers/include/spirv/unified1 -Isubprojects/glm-0.9.9.8 -I../subprojects/glm-0.9.9.8 -Isubprojects/wlroots/include -I../subprojects/wlroots/include -I../subprojects/libliftoff/include -Isubprojects/stb -I../subprojects/stb -I../subprojects/libdisplay-info/include -I../subprojects/openvr/src -I../subprojects/openvr/headers -I../subprojects/openvr/src/vrcore -Isubprojects/openvr/__CMake_build -I../subprojects/openvr/__CMake_build -Isubprojects/openvr -I../subprojects/openvr -Iprotocol -I/usr/include/libdrm -I/usr/include/SDL2 -I/usr/include/pixman-1 -I/usr/include/pipewire-0.3 -I/usr/include/spa-0.2 -I/usr/include/libdecor-0 -fdiagnostics-color=always -D_GLIBCXX_ASSERTIONS=1 -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=c++20 -O0 -g -DWLR_USE_UNSTABLE -Wno-unused-parameter -Wno-missing-field-initializers -Wno-invalid-offsetof -Wno-unused-const-variable -Wno-volatile -Wno-ignored-qualifiers -Wno-missing-braces -ffast-math -DHAVE_PIPEWIRE=1 -DHAVE_OPENVR=1 '-DHWDATA_PNP_IDS="//usr/share/hwdata/pnp.ids"' -isystem/usr/include/libdrm -D_REENTRANT -pthread -DHAVE_DRM=1 -DHAVE_SDL2=1 -DHAVE_AVIF=0 -DHAVE_LIBCAP=1 -DHAVE_LIBEIS=0 -MD -MQ src/gamescope.p/Backends_WaylandBackend.cpp.o -MF src/gamescope.p/Backends_WaylandBackend.cpp.o.d -o src/gamescope.p/Backends_WaylandBackend.cpp.o -c ../src/Backends/WaylandBackend.cpp
../src/Backends/WaylandBackend.cpp: In member function ‘void gamescope::CWaylandInputThread::SetRelativePointer(bool)’:
../src/Backends/WaylandBackend.cpp:2128:34: error: ambiguous overload for ‘operator=’ (operand types are ‘std::atomic<std::shared_ptr<zwp_relative_pointer_v1> >’ and ‘std::nullptr_t’)
 2128 |             m_pRelativePointer = nullptr;
      |                                  ^~~~~~~
In file included from /usr/local/include/c++/12.2.0/memory:78,
                 from ../src/backend.h:12,
                 from ../src/Backends/WaylandBackend.cpp:1:
/usr/local/include/c++/12.2.0/bits/shared_ptr_atomic.h:585:12: note: candidate: ‘void std::atomic<std::shared_ptr<_Tp> >::operator=(const std::atomic<std::shared_ptr<_Tp> >&) [with _Tp = zwp_relative_pointer_v1]’ (deleted)
  585 |       void operator=(const atomic&) = delete;
      |            ^~~~~~~~
/usr/local/include/c++/12.2.0/bits/shared_ptr_atomic.h:600:7: note: candidate: ‘void std::atomic<std::shared_ptr<_Tp> >::operator=(std::shared_ptr<_Tp>) [with _Tp = zwp_relative_pointer_v1]’
  600 |       operator=(shared_ptr<_Tp> __desired) noexcept
      |       ^~~~~~~~
ninja: build stopped: subcommand failed.

RoyvanEmpel avatar Aug 29 '24 23:08 RoyvanEmpel

Hi, I have successfully built it on Mint 22 which is Ubuntu 24.04 based... I did have to build wayland and wayland-protocols though. I followed this post! BTW before that, you can try meson setup --wipe build/ and then ninja -C build/... during my attempts I encountered many weird errors during meson build/ and also ninja -C build/. Using this command fixed all of them for me...

mhmarf avatar Aug 31 '24 19:08 mhmarf

Hi, I have successfully built it on Mint 22 which is Ubuntu 24.04 based... I did have to build wayland and wayland-protocols though. I followed this post! BTW before that, you can try meson setup --wipe build/ and then ninja -C build/... during my attempts I encountered many weird errors during meson build/ and also ninja -C build/. Using this command fixed all of them for me...

Hmm, installing the wayland/wayland-protocols myself isn't my preferred way since I will need to update the packages manually if new updates come out.

Or is there an easy way to mark them to be updated when for example ubuntu 24.10 comes out? Looking online i can't find any way of making sure that this happens.

RoyvanEmpel avatar Aug 31 '24 19:08 RoyvanEmpel

I had no idea about any of these lol... sorry...

mhmarf avatar Sep 01 '24 08:09 mhmarf

I went through the build process locally today, and the latest version that I could get to build on Ubuntu 24.04 was 3.14.24.

Edit: I managed to successfully build gamescope 3.14.24, but it doesn't appear to actually work.

Edit 2: Actually it just doesn't work with the specific game I needed it for, it works with other games.

Follow the instructions at https://gist.github.com/russiantux/592b1267591c011bf765b14590774a5f to compile. Make sure you check the comment at https://gist.github.com/russiantux/592b1267591c011bf765b14590774a5f?permalink_comment_id=5140684#gistcomment-5140684 to get the latest version before the breaking change.

yesrod avatar Sep 06 '24 17:09 yesrod

Just ran into this issue as well. I installed the dependencies as outlined in the instructional link above and it worked. I feel like this could be fixed with proper dependency list in the readme.

While looking this up, I also found other issues related to dependencies were very common. The solution is to "use the newest OS". This was on a post of someone using 22.04, which was 2 years old at the time. This should not be the solution when compiling and it could all be solved with a proper dependency list. Especially in weird situations like where gamescope being included in 23.10 repositories but not 24.04.

Masong19hippows avatar Oct 06 '24 02:10 Masong19hippows

I do have a local Gamescope Wiki re-work I've been cooking to include a full package list (I'm a bit worried about bloating the main readme with 15+ links to dependencies) + build instructions for some of the major distros as a part of my ongoing documentation re-work, but it'll take some more time for me to cover distros I'm unfamiliar with.

matte-schwartz avatar Oct 06 '24 02:10 matte-schwartz

got an issue here as well, it really is not working well here. Its showing the same building results for me.

Edit: I've solved, i have compiled wayland from scratch to version 1.23, and after compiled gamescope. i've even compiled the nvidia-fix fork to see if would solve my issues with my hybrid gpu setup with nvidia as dGPU.

dCo3lh0 avatar Nov 15 '24 07:11 dCo3lh0

Hello, I have installed Kde Neon User Edition (24.04), try everything, it just worked out to install this pack from terminal "Sudo dpkg -i *.deb" has some glitch but it works!

https://github.com/akdor1154/gamescope-pkg/releases/download/v3.12.5-2/gamescope_3.12.5-2_amd64.deb

https://github.com/akdor1154/gamescope-pkg/releases

It is a previous version, but it is what there is U.U Ubuntu 24.04 Derivatives

Mushufaza avatar Nov 17 '24 02:11 Mushufaza

Hello, I have installed Kde Neon User Edition (24.04), try everything, it just worked out to install this pack from terminal "Sudo dpkg -i *.deb" has some glitch but it works!

https://github.com/akdor1154/gamescope-pkg/releases/download/v3.12.5-2/gamescope_3.12.5-2_amd64.deb

https://github.com/akdor1154/gamescope-pkg/releases

It is a previous version, but it is what there is U.U Ubuntu 24.04 Derivatives

well you can build as well but the last version using wayland 1.22 of gamescope is 3.14.24 so, you can compile it normally, for subsequent versions i had to build wayland so i could have the dependencies to build gamescope and now i have wayland 1.23 in Tuxedo OS 4 based on ubuntu 24.04 and gamescope 3.15.11 with nvidia-fix, from a fork from gamescope here. I've talked with akdor1154, he doesn't plan to build a new version, until he uses ubuntu 24.04, he is still in 22.04.

https://github.com/akdor1154/gamescope-pkg/issues/42

dCo3lh0 avatar Nov 17 '24 02:11 dCo3lh0

Thank you mhmarf for the hint with the missing packages. Another package I needed for a successful run of mason was libluajit-5.1-dev. Before runs cancelled with "Run-time dependency luajit found: NO (tried pkgconfig and cmake)".

NeubauerJohannes avatar Dec 09 '24 14:12 NeubauerJohannes