MartinF99 / PlastikStyle

GNU Lesser General Public License v2.1
15 stars 3 forks source link

Unable to install on EndeavourOS #7

Closed KarkanAlzwayed closed 1 year ago

KarkanAlzwayed commented 1 year ago

It fails to install on endeavour OS with multiple errors that I frankly don't understand much

Here is the terminal output after running the first and second commands

cmake -DCMAKE_INSTALL_PREFIX=/usr ./                                                                                                      ✔ 
CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:
  cmake_minimum_required() should be called prior to this top-level project()
  call.  Please see the cmake-commands(7) manual for usage documentation of
  both commands.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.27)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/kalzi/Downloads/qt5
    ~/Downloads/qt5  make                                                                                                                                      ✔ 
[ 25%] Building CXX object CMakeFiles/plastikstyle5.dir/plugin.o
/home/kalzi/Downloads/qt5/plugin.cpp:64:10: fatal error: plugin.moc: No such file or directory
   64 | #include "plugin.moc"
      |          ^~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/plastikstyle5.dir/build.make:104: CMakeFiles/plastikstyle5.dir/plugin.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/plastikstyle5.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
    ~/Downloads/qt5                                                            
MartinF99 commented 1 year ago

Oh I think I get what went wrong. Can you Download the source again? from the releases page. There's a folder named PlastikStyle-1.0.1 in there that contains a CMakeLists.txt file. That is the toplevel CMake file. The others do not work without it. (e.g. the one you were using (in the qt5 folder and qt6 folder) they are subdirectories that are parsed by the one in the base directory.

KarkanAlzwayed commented 1 year ago

I truly appreciate the very quick response. I have figured it out. Installation instructions are not clear. Here is what I did to get it to install: (I think you should update the installation instructions to something simpler :) )


    ~  git clone https://github.com/MartinF99/PlastikStyle.git                                                                                                 ✔ 
Cloning into 'PlastikStyle'...
remote: Enumerating objects: 229, done.
remote: Counting objects: 100% (229/229), done.
remote: Compressing objects: 100% (154/154), done.
remote: Total 229 (delta 86), reused 198 (delta 65), pack-reused 0
Receiving objects: 100% (229/229), 4.93 MiB | 13.68 MiB/s, done.
Resolving deltas: 100% (86/86), done.
    ~  cd PlastikStyle                                                                                                                                         ✔ 
    ~/PlastikStyle    master    mkdir PlastikStyle/build                                                                                                    ✔ 
mkdir: cannot create directory ‘PlastikStyle/build’: No such file or directory
    ~/PlastikStyle    master    mkdir build                                                                                                               1 ✘ 
    ~/PlastikStyle    master    cmake ../                                                                                                                   ✔ 
CMake Warning:
  Ignoring extra path from command line:

   "../"

CMake Error: The source directory "/home/kalzi" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
    ~/PlastikStyle    master    cmake                                                                                                                     1 ✘ 
Usage

  cmake [options] <path-to-source>
  cmake [options] <path-to-existing-build>
  cmake [options] -S <path-to-source> -B <path-to-build>

Specify a source directory to (re-)generate a build system for it in the
current working directory.  Specify an existing build directory to
re-generate its build system.

Run 'cmake --help' for more information.

    ~/PlastikStyle    master    cd build                                                                                                                    ✔ 
    ~/PlastikStyle/build    master    cmake ../                                                                                                             ✔ 
-- The C compiler identification is GNU 13.2.1
-- The CXX compiler identification is GNU 13.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
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found WrapAtomic: TRUE  
-- Found OpenGL: /usr/lib/libOpenGL.so   
-- Found WrapOpenGL: TRUE  
-- Found XKB: /usr/lib/libxkbcommon.so (found suitable version "1.5.0", minimum required is "0.5.0") 
-- Found WrapVulkanHeaders: /usr/include  
-- Configuring done (0.9s)
-- Generating done (0.0s)
-- Build files have been written to: /home/kalzi/PlastikStyle/build
    ~/PlastikStyle/build    master    make                                                                                                                  ✔ 
[  8%] Automatic MOC and UIC for target plastikstyle5
[  8%] Built target plastikstyle5_autogen
[ 16%] Building CXX object qt5/QStyle/CMakeFiles/plastikstyle5.dir/plastikstyle5_autogen/mocs_compilation.cpp.o
[ 25%] Building CXX object qt5/QStyle/CMakeFiles/plastikstyle5.dir/plastikstyle.cpp.o
[ 33%] Building CXX object qt5/QStyle/CMakeFiles/plastikstyle5.dir/qstylehelper.cpp.o
[ 41%] Building CXX object qt5/QStyle/CMakeFiles/plastikstyle5.dir/plugin.cpp.o
[ 50%] Linking CXX shared module libplastikstyle5.so
[ 50%] Built target plastikstyle5
[ 58%] Automatic MOC and UIC for target plastikstyle6
[ 58%] Built target plastikstyle6_autogen
[ 66%] Building CXX object qt6/QStyle/CMakeFiles/plastikstyle6.dir/plastikstyle6_autogen/mocs_compilation.cpp.o
[ 75%] Building CXX object qt6/QStyle/CMakeFiles/plastikstyle6.dir/plastikstyle.cpp.o
[ 83%] Building CXX object qt6/QStyle/CMakeFiles/plastikstyle6.dir/qstylehelper.cpp.o
[ 91%] Building CXX object qt6/QStyle/CMakeFiles/plastikstyle6.dir/plugin.cpp.o
[100%] Linking CXX shared module libplastikstyle6.so
[100%] Built target plastikstyle6
    ~/PlastikStyle/build    master    make install                                                                                                  ✔  17s  
[  8%] Automatic MOC and UIC for target plastikstyle5
[  8%] Built target plastikstyle5_autogen
[ 50%] Built target plastikstyle5
[ 58%] Automatic MOC and UIC for target plastikstyle6
[ 58%] Built target plastikstyle6_autogen
[100%] Built target plastikstyle6
Install the project...
-- Install configuration: ""
-- Installing: /usr/lib/qt/plugins/styles/libplastikstyle5.so
CMake Error at qt5/QStyle/cmake_install.cmake:60 (file):
  file INSTALL cannot copy file
  "/home/kalzi/PlastikStyle/build/qt5/QStyle/libplastikstyle5.so" to
  "/usr/lib/qt/plugins/styles/libplastikstyle5.so": Permission denied.
Call Stack (most recent call first):
  qt5/cmake_install.cmake:47 (include)
  cmake_install.cmake:47 (include)

make: *** [Makefile:100: install] Error 1
    ~/PlastikStyle/build    master    sudo make install                                                                                                   2 ✘ 
[sudo] password for kalzi: 
[  8%] Automatic MOC and UIC for target plastikstyle5
[  8%] Built target plastikstyle5_autogen
[ 50%] Built target plastikstyle5
[ 58%] Automatic MOC and UIC for target plastikstyle6
[ 58%] Built target plastikstyle6_autogen
[100%] Built target plastikstyle6
Install the project...
-- Install configuration: ""
-- Installing: /usr/lib/qt/plugins/styles/libplastikstyle5.so
-- Installing: /usr/lib/qt6/plugins/styles/libplastikstyle6.so
    ~/PlastikStyle/
MartinF99 commented 1 year ago

Did you use some graphical tool by chance? and which one? It tries to look for a CMakeLists.txt in your home directory. That's super strange.

MartinF99 commented 1 year ago

here's quick command line commands cd PlastikStyle mkdir build cd build cmake ../ -DCMAKE_INSTALL_PREFIX=/usr make

MartinF99 commented 1 year ago

the first one is made with the assumption that you are in the folder you were at when you cloned the source (in your case your home directory)

KarkanAlzwayed commented 1 year ago

Notice that running mkdir PlastikStyle/build fails. So I had to just make the build directory then cd into it. After that there was another failed attempt in the make install because it needs to be run with sudo.

I think the instructions should be as follows:

  1. clone repo then cd into it
  2. make the build directory thencd into it
  3. Run cmake ../
  4. run make
  5. Run sudo make install

For some reason, I didn't need the -DCMAKE_INSTALL_PREFIX=/usr part

MartinF99 commented 1 year ago

make install always needs to run as sudo unless you're installing something into a directory your user can write to.

KarkanAlzwayed commented 1 year ago

True. Are you ready for another issue report? lol