n4n0GH / hello

the complete KDE theme
218 stars 26 forks source link

Missing build dependencies on Ubuntu 18.04 (KDE Neon) #41

Closed DiamondBond closed 4 years ago

DiamondBond commented 4 years ago
diamond@vega:~/git/hello/build$ cmake -DCMAKE_INSTALL_PREFIX="$PREFIX" ..
-- Could NOT find XCB_XEVIE (missing: XCB_XEVIE_LIBRARY XCB_XEVIE_INCLUDE_DIR) (found version "")
-- Could NOT find XCB_XPRINT (missing: XCB_XPRINT_LIBRARY XCB_XPRINT_INCLUDE_DIR) (found version "")
-- didnt find kwineffects.h, not building effects
-- didnt find kwineffects lib, not building effects
-- didnt find kwin glutils lib, not building effects
CMake Error at kwin-effects/CMakeLists.txt:84 (message):
  cant continue

-- Configuring incomplete, errors occurred!
See also "/home/diamond/git/hello/build/CMakeFiles/CMakeOutput.log".
See also "/home/diamond/git/hello/build/CMakeFiles/CMakeError.log".

xevie is not available in bionic repos as far as i know and xprint i believe is part of xcb-proto which is installed with version 1.13-1.

n4n0GH commented 4 years ago

Can you post the content of the log files?

DiamondBond commented 4 years ago

CMakeError.log

CMakeOutput.log

n4n0GH commented 4 years ago

Okay. So yes, you were right. Apparently xevie hasn't been available in Ubuntu since 16.04. Interesting. Only way I can see fixing this would be to have users install old packages.

@krisives you're my go to Ubuntu person; is it possible to host the missing packages in your repo?

krisives commented 4 years ago

It builds and works on KDE Neon for me as well as on Launchpad with these dependencies

 cmake, extra-cmake-modules,
 libecm1-dev,
 libkdecorations2-dev,
 libkf5codecs-dev,
 libkf5configwidgets-dev,
 libkf5coreaddons-dev,
 libkf5guiaddons-dev,
 libkf5i18n-dev,
 libkf5widgetsaddons-dev,
 libkf5windowsystem-dev,
 libqt5x11extras5-dev,
 libfftw3-dev,
 libkf5package-dev

It's possible some of those aren't needed, I'm not sure, as I mainly copied them from the files I made for SierraBreezeEnhanced since they are both very similar. But the fact that Launchpad can build it with the list above means it doesn't require anything other than that to build.

Here is a build log from Launchpad of a build for Bionic that gets used for anyone using KDE Neon (myself included)

https://launchpadlibrarian.net/454214543/buildlog_ubuntu-bionic-amd64.kde-hello_1.0-0~201912040801~rev54~pkg4~ubuntu18.04.1_BUILDING.txt.gz

Relevant parts:

-- Found XCB_XCB: /usr/lib/x86_64-linux-gnu/libxcb.so (found version "") 
-- Found XCB: /usr/lib/x86_64-linux-gnu/libxcb.so  found components:  XCB 
...
-- The following OPTIONAL packages have been found:

 * XCB, X protocol C-language Binding, <http://xcb.freedesktop.org>
   Required to pass style properties to native Windows on X11 Platform
 * Qt5Core

Doing a search with apt-file search libxcb.so shows that it comes from the libxcb1 and libxcb1-dev packages and the build logs shows that gets installed along with many other XCB dependencies.

As a sanity test to make sure nothing broke when the CMakeLists.txt was changed in 49e330cf5ee1bc735f0475d0bff41fc9faa4991f I went ahead and clicked the buttons on Launchpad to manually pull new code and rebuild the packages (this happens daily, but because of timezones it wasn't clear if this had happened already) It did rebuild without any issue for all of the Ubuntu distros, including Bionic. (Build log which is virtually identical to the previous one)

n4n0GH commented 4 years ago

Ah but this is about the KWin effects plugin. Nonetheless, yes there's an libxcb package but apparently it doesn't contain xevie anymore.

krisives commented 4 years ago

Also it's worth mentioning that above is only for the window decoration since the rest is currently not packaged on my PPA. With that in mind I did a git pull and made the entire project from source on KDE Neon itself, and it failed. It's worth noting it generated this cmake output:

- Found XCB_SYNC: /usr/lib/x86_64-linux-gnu/libxcb-sync.so (found version "1.13") 
-- Found XCB_UTIL: /usr/lib/x86_64-linux-gnu/libxcb-util.so (found version "0.4.0") 
-- Could NOT find XCB_XEVIE (missing: XCB_XEVIE_LIBRARY XCB_XEVIE_INCLUDE_DIR) (found version "")
-- Could NOT find XCB_XF86DRI (missing: XCB_XF86DRI_LIBRARY XCB_XF86DRI_INCLUDE_DIR) (found version "")
-- Could NOT find XCB_XINERAMA (missing: XCB_XINERAMA_LIBRARY XCB_XINERAMA_INCLUDE_DIR) (found version "")
-- Could NOT find XCB_XKB (missing: XCB_XKB_LIBRARY XCB_XKB_INCLUDE_DIR) (found version "")
-- Could NOT find XCB_XPRINT (missing: XCB_XPRINT_LIBRARY XCB_XPRINT_INCLUDE_DIR) (found version "")
-- Found XCB_XTEST: /usr/lib/x86_64-linux-gnu/libxcb-xtest.so (found version "1.13") 
-- Could NOT find XCB_XV (missing: XCB_XV_LIBRARY XCB_XV_INCLUDE_DIR) (found version "")
-- Could NOT find XCB_XVMC (missing: XCB_XVMC_LIBRARY XCB_XVMC_INCLUDE_DIR XCB_XV_FOUND) (found version "")
-- Found XCB: /usr/lib/x86_64-linux-gnu/libxcb.so;/usr/lib/x86_64-linux-gnu/libxcb-render.so;/usr/lib/x86_64-linux-gnu/libxcb-shape.so;/usr/lib/x86_64-linux-gnu/libxcb-xfixes.so;/usr/lib/x86_64-linux-gnu/libxcb-shm.so;/usr/lib/x86_64-linux-gnu/libxcb-util.so;/usr/lib/x86_64-linux-gnu/libxcb-composite.so;/usr/lib/x86_64-linux-gnu/libxcb-cursor.so;/usr/lib/x86_64-linux-gnu/libxcb-damage.so;/usr/lib/x86_64-linux-gnu/libxcb-dri2.so;/usr/lib/x86_64-linux-gnu/libxcb-dri3.so;/usr/lib/x86_64-linux-gnu/libxcb-glx.so;/usr/lib/x86_64-linux-gnu/libxcb-icccm.so;/usr/lib/x86_64-linux-gnu/libxcb-image.so;/usr/lib/x86_64-linux-gnu/libxcb-keysyms.so;/usr/lib/x86_64-linux-gnu/libxcb-present.so;/usr/lib/x86_64-linux-gnu/libxcb-randr.so;/usr/lib/x86_64-linux-gnu/libxcb-render-util.so;/usr/lib/x86_64-linux-gnu/libxcb-sync.so;/usr/lib/x86_64-linux-gnu/libxcb-xtest.so (found version "1.13")  

I think what is happening here is it's looking for an XCB to use and will prefer to use ones with various extensions if they exist. AFAIK "hello" doesn't use any of those.

I did notice an error when trying to run cmake on the "top level" package, it will fail being unable to find epoxy, despite the packages being installed. However, if you just cd into the window-decoration directory and build just that component it works fine.

I create a build.sh file within that directory that looks like this:

mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DKDE_INSTALL_LIBDIR=lib -DBUILD_TESTING=OFF -DKDE_INSTALL_USE_QT_SYS_PATHS=ON
make
sudo make install

The epoxy error was related to building the shaders, which was this:

CMakeFiles/kwin4_effect_helloshaders.dir/helloshaders.cpp.o: In function `HelloShadersEffect::paintWindow(KWin::EffectWindow*, int, QRegion, KWin::WindowPaintData&)':
helloshaders.cpp:(.text+0x1ce8): undefined reference to `epoxy_glCopyTexSubImage2D'
helloshaders.cpp:(.text+0x1dde): undefined reference to `epoxy_glEnable'
helloshaders.cpp:(.text+0x1dec): undefined reference to `epoxy_glBlendFunc'
helloshaders.cpp:(.text+0x1e43): undefined reference to `epoxy_glActiveTexture'
helloshaders.cpp:(.text+0x1fe3): undefined reference to `epoxy_glDisable'

Not sure how to handle that part because libepoxy0 and libepoxy-dev are both installed and pkg-config can find it without issue (eg. pkg-config --libs epoxy gives -lepoxy) I also double checked that all the packages in the README.md for kwin-effects were installed and they are. Looking closer I saw that a tab was used instead of spaces on that line of the CMakeLists.txt file, but changing it to spaces doesn't resolve the problem. I decided to run make VERBOSE=1 to see what command was being used and got this monstrosity:

/usr/bin/c++ -fPIC  -fno-operator-names -fno-exceptions -Wall -Wextra -Wcast-align -Wchar-subscripts -Wformat-security -Wno-long-long -Wpointer-arith -Wundef -Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type -Wvla -Wdate-time -Wsuggest-override -Wlogical-op -O3 -DNDEBUG -Wl,--no-undefined -Wl,--fatal-warnings -Wl,--enable-new-dtags  -shared  -o kwin4_effect_helloshaders.so CMakeFiles/kwin4_effect_helloshaders.dir/helloshaders.cpp.o CMakeFiles/kwin4_effect_helloshaders.dir/kwin4_effect_helloshaders_autogen/mocs_compilation.cpp.o -lkwineffects -lkwinglutils /usr/lib/x86_64-linux-gnu/libKF5ConfigWidgets.so.5.64.0 /usr/lib/x86_64-linux-gnu/libKF5GuiAddons.so.5.64.0 /usr/lib/x86_64-linux-gnu/libKF5WindowSystem.so.5.64.0 /usr/lib/x86_64-linux-gnu/libQt5X11Extras.so.5.13.2 /usr/lib/x86_64-linux-gnu/libxcb.so /usr/lib/x86_64-linux-gnu/libKF5Codecs.so.5.64.0 /usr/lib/x86_64-linux-gnu/libKF5WidgetsAddons.so.5.64.0 /usr/lib/x86_64-linux-gnu/libKF5ConfigGui.so.5.64.0 /usr/lib/x86_64-linux-gnu/libKF5ConfigCore.so.5.64.0 /usr/lib/x86_64-linux-gnu/libQt5Xml.so.5.13.2 /usr/lib/x86_64-linux-gnu/libKF5Auth.so.5.64.0 /usr/lib/x86_64-linux-gnu/libKF5AuthCore.so.5.64.0 /usr/lib/x86_64-linux-gnu/libKF5CoreAddons.so.5.64.0 /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.13.2 /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.13.2 /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.13.2 

Notably absent there is any linkage to epoxy, which is strange. Which is strange because it should be included from:

pkg_check_modules(EPOXY REQUIRED epoxy)

So I read the CMake documentation on pkg_check_modules and sure enough it's a straighforward wrapper for pkg-config and in this case it should define a variable called EPOXY_LIBRARIES - basically it appends _LIBRARIES to the name of the thing being found by pkg-config. Looking later in the CMakeLists.txt file you'll see the line that links these libraries in was actually:

${EPOXY_LINK_LIBRARIES}

Which doesn't actually exist, hence no epoxy. Changing this to:

${EPOXY_LIBRARIES}

Works in a resulting build. Assuming this all makes sense I propose we fix the kwin-effects/CMakeLists.txt to have the right variable name and while were at it fix the tabs being used instead of spaces since it doesn't match.

Let me know if I can help any further.

n4n0GH commented 4 years ago

I really need to set up a machine with native installations of some Linux distributions to check this stuff myself. But then I wouldn't be able to read your captivating essays. @DiamondBond can you pull the latest (4f2c80f) and see if it'll build?

n4n0GH commented 4 years ago

Closing this as I most likely won't be working on this any further (see 5f57998e).