phillipberndt/fakexrandr

"make install" fails

Opened this issue · 3 comments

"make install" fails, and I get the following errors:

TARGET_DIR=sed -nre 's/#define FAKEXRANDR_INSTALL_DIR "([^"]+)"/\1/p' config.h;
[ -d $TARGET_DIR ] || exit 1;
install libXrandr.so $TARGET_DIR;
ln -s libXrandr.so $TARGET_DIR/libXrandr.so.2 || true;
ln -s libXrandr.so $TARGET_DIR/libXinerama.so.1 || true;
ldconfig
install: cannot create regular file '/usr/local/lib/libXrandr.so': Permission denied
ln: failed to create symbolic link '/usr/local/lib/libXrandr.so.2': Permission denied
ln: failed to create symbolic link '/usr/local/lib/libXinerama.so.1': Permission denied
/sbin/ldconfig.real: Can't create temporary cache file /etc/ld.so.cache~: Permission denied
Makefile:19: recipe for target 'install' failed
make: *** [install] Error 1

Can I install without doing sudo? I'm on Ubuntu 16.04. Thanks.

No, you can't. You can however copy the generated libXrandr.so to any directory, create the symlinks manually, and add the directory to your library search path by adding export LD_LIBRARY_PATH=/full/path to your user's bashrc.

I see. It would be a time-saver to have an option for this in the "make install". An idea for a feature maybe?

Anyway, thanks!

I haven't used fakexrandr in a while, but I've got this change stashed from nearly 2 years ago.

diff --git a/Makefile b/Makefile
index 2321194..bf83c19 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-PREFIX=/home/nmschulte/.local
+PREFIX=/usr
 CFLAGS=-O2
 
 ifeq ($(shell pkg-config --errors-to-stdout --print-errors xcb-randr),)
diff --git a/configure b/configure
index 565130d..24467e8 100755
--- a/configure
+++ b/configure
@@ -28,7 +28,7 @@ REAL_LIBRARY_DIR=$(dirname "${REAL_LIBRARY}")
 
 # 3) Determine location for fake xrandr library
 LIBRARY_DIRECTORIES=($(ldconfig -v 2>/dev/null | grep -oE '^/[^:]+'))
-FAKE_LIBRARY_DIRECTORY=/home/nmschulte/.local/lib
+FAKE_LIBRARY_DIRECTORY=
 CANDIDATES=
 for DIR in ${LIBRARY_DIRECTORIES[@]}; do
        if [ "$DIR" == "${REAL_LIBRARY_DIR}" ]; then