awesomeWM / awesome

awesome window manager
https://awesomewm.org/
GNU General Public License v2.0
6.39k stars 598 forks source link

Cannot install Awesome WM locally (not system wide) #1942

Closed inspell closed 7 years ago

inspell commented 7 years ago

Hello. I am currently running Debian 8 (jessie) and have Awesome WM installed from Debian's repository - it is version v3.4.15 (Never Gonna Give You Up). I want to migrate to Awesome 4x and wanted to build and install Awesome from source from the master branch so I can port my configuration, test that everything is OK and then install it system wide. I am following this guide: https://awesomewm.org/doc/api/documentation/17-porting-tips.md.html

I have some problems with the installation (explained below) but I wanted to first apologize for raising this ticket because it may not actually be a bug but a lack of knowledge on my side.

Output of awesome --version: Building awesome from source (from master branch)

How to reproduce the issue:

cd path/to/awesome/code make cd build/ cmake -DCMAKE_INSTALL_PREFIX=$HOME/awesome4_test .. make install

Actual result: CMake Error at cmake_install.cmake:64 (file): file cannot create directory: /usr/local/share/awesome. Maybe need administrative privileges.

Makefile:66: recipe for target 'install' failed make: *** [install] Error 1

Expected result: AwesomeWM is installed locally in $HOME/awesome4_test with all necessary files and dependencies so I can run:

Xephyr :2 -screen 1280x800 & DISPLAY=:2 $HOME/awesome4_test/bin/awesome -c $HOME/.config/awesome4/rc.lua

When I execute the awesome command above I get

/home/v/awesome4_test/bin/awesome: error while loading shared libraries: libxcb-xrm.so.0: cannot open shared object file: No such file or directory

So I fix this with:

LD_LIBRARY_PATH=/usr/local/lib DISPLAY=:2 $HOME/awesome4_test/bin/awesome -c $HOME/.config/awesome4/rc.lua

but then I get:

2017-07-25 15:38:31 W: awesome: screen_scan_randr_crtcs:417: Ignoring RandR, only a compatibility layer is present. error while running function! stack traceback: [C]: in function 'require' /home/v/.config/awesome4/rc.lua:2: in main chunk error: /home/v/.config/awesome4/rc.lua:2: module 'gears' not found: no field package.preload['gears'] no file '/usr/local/share/lua/5.2/gears.lua' no file '/usr/local/share/lua/5.2/gears/init.lua' no file '/usr/local/lib/lua/5.2/gears.lua' no file '/usr/local/lib/lua/5.2/gears/init.lua' no file '/usr/share/lua/5.2/gears.lua' no file '/usr/share/lua/5.2/gears/init.lua' no file './gears.lua' no file '/home/v/.config/awesome/gears.lua' no file '/home/v/.config/awesome/gears/init.lua' no file '/etc/xdg/awesome/gears.lua' no file '/etc/xdg/awesome/gears/init.lua' no file '/usr/local/share/awesome/lib/gears.lua' no file '/usr/local/share/awesome/lib/gears/init.lua' no file '/usr/local/lib/lua/5.2/gears.so' no file '/usr/lib/x86_64-linux-gnu/lua/5.2/gears.so' no file '/usr/lib/lua/5.2/gears.so' no file '/usr/local/lib/lua/5.2/loadall.so' no file './gears.so' no file '/home/v/.config/awesome/gears.so' no file '/etc/xdg/awesome/gears.so' .... ....

I suspect that this error is caused because the make install command failed and was not able to create files in /usr/local and /usr/share but I don't want to install awesome 4 system wide without first porting my old awesome 3x configuration and testing that everything is OK with Xephyr. I was expecting that nothing will be written to the root partition if I pass the CMAKE_INSTALL_PREFIX parameter. I was temped to give SU privileges to the make install command but I wasn't sure whether this wont' break my current awesome 3x installation. So I stopped there and decided to ask for help before ruining my day ; )

blueyed commented 7 years ago

You should run cmake (which sets the prefix) before make. Start anew removing the build dir.

Elv13 commented 7 years ago

Also, awesome --search /path/to/lib need to point to the directory where gears, awful, wibox and so on are located. Either you do that or "fix" your LUA_PATH.

inspell commented 7 years ago

Ah, thank you very much. I got it working.

As you said, I removed the build directory, then created new build directory, cded to it, did the cmake command with the prefix, then make, then make install and everything appeared in the ~/awesome4_test directory. From there I was able to run awesome like so:

Xephyr :2 -screen 1280x800 & DISPLAY=:2 $HOME/awesome4_test/bin/awesome -c $HOME/.config/awesome4/rc.lua --search share/awesome/lib

This issue is resolved for me ; )