sirjuddington / SLADE

It's a Doom editor
https://slade.mancubus.net
GNU General Public License v2.0
697 stars 105 forks source link

please add a linux build #1715

Open bacalhau-seco opened 2 weeks ago

bacalhau-seco commented 2 weeks ago

Editor

Resource editor, Map editor

Description of your feature request

i tried compiling the latest slade on linux, both on arch and on gentoo. it failed both times for diferent reasons. ive look it up in multiple forums but didnt find any way to do it, theres an issue from 2019 with some info but none of that helped me.

bacalhau-seco commented 2 weeks ago

im having the same issue as #765

Blzut3 commented 2 weeks ago

I have no idea why you'd be having that issue in particular unless you're trying to build an old version for some reason.

There are two semi-official Linux packages for Slade. For Arch/Gentoo you'd probably want to use the Flatpak. I also maintain a deb package for Debian/Ubuntu. You could potentially try extracting that package manually and running it although some of the dependencies are not ABI stable enough to be considered a universal Linux binary. Unfortunately it would be quite a bit of work to try to make a stable binary that works everywhere for Slade without the help of Flatpak's tooling.

bacalhau-seco commented 2 weeks ago

the package in gentoo's repos is old and doesnt even install wich is why i was trying to compile it manually in the first place, but that also didnt work. i followed the arch guide in the website.

Blzut3 commented 1 week ago

Post the output of cmake .. --fresh

TheCodeTherapy commented 1 week ago

@bacalhau-seco I haven't tried to build it on Arch on Gentoo, but as this issue's title refers to the Linux building process in general, I'll add some info that I hope to be helpful and save people some time and Google/GitHub searches...

My process to build it on Ubuntu 24.04 was:

1- Install all the library dependencies related to wx-gtk. In the case of my distro, I installed all the required ones (maybe even unnecessary ones 😅) with:

sudo apt install libwxgtk3.2-dev libwxgtk3.2-1t64 libwxbase3.2-1t64 libwxsvg-dev libftgl-dev libfreeimage-dev liblua5.4-dev libwxgtk-webview3.2-dev

2- Enter the dist directory and prepare to build:

cd dist
cmake .. --fresh

3- build the binary:

make -j$(nproc)

The binary was built and linked with no errors, and was ready to be executed with ./slade

The only remark I have about its usage on Linux is if you run it from a terminal, you'll see a constant stream of warning messages saying:

AcceleratedSurfaceDMABuf was unable to construct a complete framebuffer

Unfortunately I couldn't yet find the time to test it further or to check the source code to see the cause of such warning.

I hope that helps.

bacalhau-seco commented 1 week ago

this is the output of cmake .. --fresh

-- The C compiler identification is GNU 14.2.1
-- The CXX compiler identification is GNU 14.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Deprecation Warning at cmake/cotire.cmake:40 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.
Call Stack (most recent call first):
  cmake/unix.cmake:15 (include)
  src/CMakeLists.txt:42 (include)

-- cotire 1.7.9 loaded.
-- wx-config used is: /usr/bin/wx-config
-- wxWidgets version is: 3.2.5
-- gtk version is: 3
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
  Could NOT find wxWidgets (missing: wxWidgets_LIBRARIES) (Required is at
  least version "3.2.5")
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake/Modules/FindwxWidgets.cmake:1014 (find_package_handle_standard_args)
  cmake/unix.cmake:75 (find_package)
  src/CMakeLists.txt:42 (include)

-- Configuring incomplete, errors occurred!

i have installed x11-libs/wxGTK-3.2.5

Blzut3 commented 1 week ago

Did you have to provide any additional arguments to cmake before? Bizarre that you seemingly got Makefiles before but that command resulted in an error instead?

bacalhau-seco commented 1 week ago

i did not give it any more arguments. It always gives me this error

bacalhau-seco commented 1 week ago

I checked the other issue i mentioned but it seems that it was the wrong one. I cant find the one i wanted to link now, im really sorry for that. Also, heres some additional info that might be relevant: I managed to install it on arch from the AUR and after that compiling works, so now i think its some kind of dependency issue i was having on arch. Compiling on arch and sending the binary to gentoo also doesnt work. The version in the official repos https://packages.gentoo.org/packages/games-util/slade is old and it also fails to install:

>>> Failed to emerge games-util/slade-3.2.4, Log file:

>>>  '/var/tmp/portage/games-util/slade-3.2.4/temp/build.log'

 * Messages for package dev-lang/lua-5.1.5-r200:

 * Install additional packages for optional runtime features:
 *   app-emacs/lua-mode for Lua support for Emacs

 * Messages for package games-util/slade-3.2.4:

 * ERROR: games-util/slade-3.2.4::gentoo failed (compile phase):
 *   ninja -v -j8 -l8 failed
 * 
 * Call stack:
 *     ebuild.sh, line  136:  Called src_compile
 *   environment, line 2562:  Called cmake_src_compile
 *   environment, line 1093:  Called cmake_build
 *   environment, line 1060:  Called eninja
 *   environment, line 1542:  Called die
 * The specific snippet of code:
 *       "$@" || die -n "${*} failed"
 * 
 * If you need support, post the output of `emerge --info '=games-util/slade-3.2.4::gentoo'`,

the output of emerge --info is here: https://logpaste.com/DXGqn8ql

Blzut3 commented 1 week ago

My guess is that wxWidgets was compiled without webview support (or some other required component). I believe you can figure this out by looking at your wx/univ/setup.h and seeing what the value of wxUSE_WEBVIEW is.

When building for Ubuntu I custom compile wxWidgets since Slade is very picky. My wxWidgets configuration looks like (note $UsrPrefix is set to some arbitrary directory):

cmake .. -DwxBUILD_TOOLKIT=gtk3 -DCMAKE_BUILD_TYPE=Release \
    -DwxBUILD_SHARED=OFF -DwxUSE_LIBTIFF=builtin -DwxUSE_LIBLZMA=sys \
    -DwxUSE_LIBPNG=builtin -DCMAKE_INSTALL_PREFIX=$UsrPrefix \
    -DwxUSE_LIBJPEG=builtin -DwxUSE_WEBVIEW=ON -DwxUSE_REGEX=builtin \
    -DwxUSE_GLCANVAS_EGL=OFF

Then my Slade config looks like:

cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr \
    -DWITH_WXPATH=$UsrPrefix -DSFML_CONFIG=$UsrPrefix/lib/cmake/SFML/SFMLConfig.cmake \
    -DSFML_STATIC_LIBRARIES=TRUE -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON \
    -DSFML_LIBRARY="sfml-system;sfml-audio;sfml-network;sfml-window" \
    -DFLUIDSYNTH_LIBRARIES=fluidsynth

The main thing relevant there is the WITH_WXPATH since the rest is to handle custom static builds of SFML which may not be relevant to you.

TheCodeTherapy commented 5 days ago

Worth mentioning that the warning I referred to in my previous post is not just a harmless warning.

The cause of the warning prevents the proper functionality of the app, but apparently it's not Slade's fault. It's an upstream bug that I stumbled upon by working on other projects that use webkit2gtk in a X11 Linux environment with the 535 version of the nvidia drivers (driver installed by default on latest Ubuntu - 24.04 - when the proprietary drivers install is checked during the default installation process.

Apparently the bug does not occur when the user manually installs the 550 or later nvidia drivers from the PPA or from nvidia's installer, but for those using the default 535 driver installed by Ubuntu 24.04, there's a workaround.

You can work around the issue by:

export WEBKIT_DISABLE_DMABUF_RENDERER=1

... before running Slade's binary.

I hope that may save other users facing the same issue some time.