helloSystem / Menu

Global menu bar written in Qt
44 stars 14 forks source link

Can't build on linux #59

Closed ByJumperX4 closed 3 years ago

ByJumperX4 commented 3 years ago

I'm trying to build Menu on my main production machine (Bedrock Linux) and here is what happens : On an Oracle Linux stratum, which is my main one, the cmake works, but when I make it fails :

$ ~/src/Menu/build> LANG=C cmake ..
-- Configuring done
-- Generating done
-- Build files have been written to: /home/byjumperx4/src/Menu/build
$ ~/src/Menu/build> LANG=C make
[  4%] Automatic MOC for target volume
[  4%] Automatic MOC for target menubar
[  6%] Automatic MOC for target statusnotifier
[  9%] Automatic MOC for target datetime
[  9%] Built target statusnotifier_autogen
[  9%] Built target datetime_autogen
[  9%] Built target menubar_autogen
[  9%] Built target volume_autogen
[ 27%] Built target datetime
[ 27%] Built target volume
[ 47%] Built target statusnotifier
[ 52%] Building CXX object src/CMakeFiles/menubar.dir/appmenuwidget.cpp.o
[ 52%] Building CXX object src/CMakeFiles/menubar.dir/main.cpp.o
/home/byjumperx4/src/Menu/src/main.cpp: In member function 'virtual bool Application::notify(QObject*, QEvent*)':
/home/byjumperx4/src/Menu/src/main.cpp:36:16: error: invalid use of incomplete type 'class QDebug'
         qDebug() << "probono: e.type():" << e->type();
                ^
In file included from /usr/include/qt5/QtCore/qglobal.h:1206,
                 from /usr/include/qt5/QtGui/qtguiglobal.h:43,
                 from /usr/include/qt5/QtWidgets/qtwidgetsglobal.h:43,
                 from /usr/include/qt5/QtWidgets/qframe.h:43,
                 from /usr/include/qt5/QtWidgets/QFrame:1,
                 from /home/byjumperx4/src/Menu/src/mainwindow.h:23,
                 from /home/byjumperx4/src/Menu/src/main.cpp:20:
/usr/include/qt5/QtCore/qlogging.h:57:7: note: forward declaration of 'class QDebug'
 class QDebug;
       ^~~~~~
/home/byjumperx4/src/Menu/src/main.cpp:39:20: error: invalid use of incomplete type 'class QDebug'
             qDebug() << "probono: QApplication::focusWidget()->objectName():" << QApplication::focusWidget()->objectName();
                    ^
In file included from /usr/include/qt5/QtCore/qglobal.h:1206,
                 from /usr/include/qt5/QtGui/qtguiglobal.h:43,
                 from /usr/include/qt5/QtWidgets/qtwidgetsglobal.h:43,
                 from /usr/include/qt5/QtWidgets/qframe.h:43,
                 from /usr/include/qt5/QtWidgets/QFrame:1,
                 from /home/byjumperx4/src/Menu/src/mainwindow.h:23,
                 from /home/byjumperx4/src/Menu/src/main.cpp:20:
/usr/include/qt5/QtCore/qlogging.h:57:7: note: forward declaration of 'class QDebug'
 class QDebug;
       ^~~~~~
/home/byjumperx4/src/Menu/src/main.cpp:40:20: error: invalid use of incomplete type 'class QDebug'
             qDebug() << "probono: QApplication::focusWidget()->metaObject()->className():" << QApplication::focusWidget()->metaObject()->className();
                    ^
In file included from /usr/include/qt5/QtCore/qglobal.h:1206,
                 from /usr/include/qt5/QtGui/qtguiglobal.h:43,
                 from /usr/include/qt5/QtWidgets/qtwidgetsglobal.h:43,
                 from /usr/include/qt5/QtWidgets/qframe.h:43,
                 from /usr/include/qt5/QtWidgets/QFrame:1,
                 from /home/byjumperx4/src/Menu/src/mainwindow.h:23,
                 from /home/byjumperx4/src/Menu/src/main.cpp:20:
/usr/include/qt5/QtCore/qlogging.h:57:7: note: forward declaration of 'class QDebug'
 class QDebug;
       ^~~~~~
make[2]: *** [src/CMakeFiles/menubar.dir/build.make:72: src/CMakeFiles/menubar.dir/main.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/byjumperx4/src/Menu/src/appmenuwidget.cpp: In member function 'void AppMenuWidget::actionAbout()':
/home/byjumperx4/src/Menu/src/appmenuwidget.cpp:737:12: error: 'sha' was not declared in this scope
         if(sha != "" && url != "" && build != "") {
            ^~~
/home/byjumperx4/src/Menu/src/appmenuwidget.cpp:737:12: note: suggested alternative: 'show'
         if(sha != "" && url != "" && build != "") {
            ^~~
            show
/home/byjumperx4/src/Menu/src/appmenuwidget.cpp:737:25: error: 'url' was not declared in this scope
         if(sha != "" && url != "" && build != "") {
                         ^~~
/home/byjumperx4/src/Menu/src/appmenuwidget.cpp:737:25: note: suggested alternative: 'QUrl'
         if(sha != "" && url != "" && build != "") {
                         ^~~
                         QUrl
/home/byjumperx4/src/Menu/src/appmenuwidget.cpp:737:38: error: 'build' was not declared in this scope
         if(sha != "" && url != "" && build != "") {
                                      ^~~~~
make[2]: *** [src/CMakeFiles/menubar.dir/build.make:163: src/CMakeFiles/menubar.dir/appmenuwidget.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:87: src/CMakeFiles/menubar.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
[ble: exit 2]
$ ~/src/Menu/build>

When I try to build from an Arch Linux strata with the dependencies that are on the README it won't event cmake:

$ ~/src/Menu/build> LANG=C strat arch cmake ..
-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /usr/sbin/cc
-- Check for working C compiler: /usr/sbin/cc - broken
CMake Error at /usr/share/cmake-3.19/Modules/CMakeTestCCompiler.cmake:66 (message):
  The C compiler

    "/usr/sbin/cc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/byjumperx4/src/Menu/build/CMakeFiles/CMakeTmp

    Run Build Command(s):/bedrock/cross/bin/gmake cmTC_46521/fast && /bedrock/cross/bin/gmake  -f CMakeFiles/cmTC_46521.dir/build.make CMakeFiles/cmTC_46521.dir/build
    gmake[1]: Entering directory '/home/byjumperx4/src/Menu/build/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_46521.dir/testCCompiler.c.o
    /usr/sbin/cc    -o CMakeFiles/cmTC_46521.dir/testCCompiler.c.o -c /home/byjumperx4/src/Menu/build/CMakeFiles/CMakeTmp/testCCompiler.c
    gmake[1]: /usr/sbin/cc: Command not found
    gmake[1]: *** [CMakeFiles/cmTC_46521.dir/build.make:85: CMakeFiles/cmTC_46521.dir/testCCompiler.c.o] Error 127
    gmake[1]: Leaving directory '/home/byjumperx4/src/Menu/build/CMakeFiles/CMakeTmp'
    gmake: *** [Makefile:140: cmTC_46521/fast] Error 2

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)

-- Configuring incomplete, errors occurred!
See also "/home/byjumperx4/src/Menu/build/CMakeFiles/CMakeOutput.log".
See also "/home/byjumperx4/src/Menu/build/CMakeFiles/CMakeError.log".
[ble: exit 1]
$ ~/src/Menu/build>
probonopd commented 3 years ago

hello @ByJumperX4 We are focusing on FreeBSD, to be specific: helloSystem. If someone gets this to build on Linux and wants to send a PR we'd be happy to merge it but I am currently not running a Linux system.

probonopd commented 3 years ago

I can build it on Debian Sid like this:

# Install dependencies for all helloSystem components
sudo apt -y install gcc cmake g++ qtbase5-dev pkgconf libqt5x11extras5-dev qttools5-dev \
libdbusmenu-qt5-dev libkf5dbusaddons-dev libkf5windowsystem-dev libxcb-util0-dev libxdamage-dev \
libxcb-damage0-dev libxcomposite-dev libxrender-dev libxcb-ewmh-dev libfm-dev \
libmenu-cache-dev qtdeclarative5-dev qtquickcontrols2-5-dev libqt5xdg-dev \
qtbase5-private-dev extra-cmake-modules \
libkdecorations2-dev libkf5guiaddons-dev libkf5configwidgets-dev gettext # Last line is for BreezeEnhanced

# Menu
git clone https://github.com/helloSystem/Menu
cd Menu
sed -i -e 's|TOPBAR_HEIGHT 21|TOPBAR_HEIGHT 30|g' src/mainwindow.cpp # FIXME: Otherwise menus don't fit in there on Debian
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
make -j$(nproc)
sudo make install