POV-Ray / povray

The Persistence of Vision Raytracer: http://www.povray.org/
GNU Affero General Public License v3.0
1.35k stars 282 forks source link

An installation directory has wrong path, on ./configure <...> #374

Closed zebulon-1st closed 5 years ago

zebulon-1st commented 5 years ago

Summary

On ./configure, the list of installation directories shows one of them has wrong path if neither using global installation nor using actual user HOME path local installation.

I have my own HOME that is "/home/joe". But, because I have already another version of povray installed locally in it, and I don't want to uninstall it before, I made another home directory to store the 3.7-stable locally in it. So, I would use PREFIX=/home/povray-3.7-stable instead of PREFIX=/home/joe (which = "$HOME").

Environment

Unix Build Command Sequence

cd unix ; prebuild.sh ; cd ..
./configure CC=gcc CXX=g++ COMPILED_BY="Frantz [zebulon] Balinski <hidden here@hidden here>" --prefix="/home/povray-3.7-stable" --enable-watch-cursor --disable-io-restrictions --with-x

Unix Configure Output

...
The POV-Ray components will be installed in the following directories:
  Program (executable):       /home/povray-3.7-stable/bin
  System configuration files: /home/povray-3.7-stable/etc/povray/3.7
  User configuration files:   /home/joe/.povray/3.7
  Standard include files:     /home/povray-3.7-stable/share/povray-3.7/include
  Standard INI files:         /home/povray-3.7-stable/share/povray-3.7/ini
  Standard demo scene files:  /home/povray-3.7-stable/share/povray-3.7/scenes
  Documentation (text, HTML): /home/povray-3.7-stable/share/doc/povray-3.7
  Unix man page:              /home/povray-3.7-stable/share/man
===============================================================================

Steps to Reproduce

# I already have a version of povray (3.7RC7 + mandelbulb patch) installed in my /home/joe session -- and I use it at the moment
# Now, create a special local installation home directory for v3.7 stable
cd /home
sudo mkdir povray-3.7-stable
sudo chown -R "$USER:$USER" povray-3.7-stable

# Configure 3.7 stable for unix
cd ~/Sources
mkdir povray-3.7-stable
cd povray-3.7-stable
git clone --branch 3.7-stable https://github.com/POV-Ray/povray.git
cd povray
cd unix; ./prebuild.sh; cd ..

Expected Behavior

The User configuration files should be /home/povray-3.7-stable/.povray/3.7 ($PREFIX/.povray/3.7)

Actual Behavior

The User configuration files directory is set to /home/joe/.povray/3.7 ($HOME/.povray/3.7)

zebulon-1st commented 5 years ago

Note : version 3.8 alpha has the same error.

So, I now understand better why the make check test rendering failed with error functions.inc : unknown internal function 79 which is the mandelbulb patch from my 3.7RC7+mandelbulb_patch version yet installed in my $HOME /home/joe/

c-lipka commented 5 years ago

This is actually the intended behaviour. The PREFIX= setting is there to change the location of the files shared by all users, so that you can choose e.g. whether to install somewhere in /bin/, /etc/bin or whatever.

The location of user-specific files is currently hard-coded (except for the $HOME directory portion). For the sake of convenience the ./configure script displays the corresponding directory for the installing user, but it gives no control over it. You'd need to modify the source files to change it.

It may be sufficient to change the AC_INIT(..., [povray]) invocation in unix/configure.ac (somewhere around line 45; you'll need to re-run unix/prebuild.sh), but I can't guarantee, as I'm not really a Unix jockey.

(Also, I'd highly recommend changing the path for the patched version, rather than the official one.)

zebulon-1st commented 5 years ago

Another way, is to add a user (create a new user session) that will get this version installed in. But I'ill to set user (su) to this one, when I would use this version instead of the one I already have. By this way, I even could install the v3.8, in another user session, too.

So I could have :

And then, I haven't to break the initial code to adapt it for this particular need.

wfpokorny commented 5 years ago

I routinely have and run multiple versions of POV-Ray on my Ubuntu system. As Christoph said user files are hard coded in $HOME/.povray... When POV_Ray runs it always uses those user files. I specifically don't want this behavior when testing versions of POV-Ray.

So, I use the unix POVINI environment variable point to the common povray.ini file I want to use with my day to day work. The location for me today is $HOME/pov/povray.ini but i can be whatever.

I create then for each other installed version of POV-Ray bash wrapper scripts (p370, p380,pJG,pUber, etc) which internally look roughly like this:

!/bin/bash

export POVINI=/run/shm/tmpDir/tmpUser/MyP380/etc/povray/3.8/povray.ini echo "" >$HOME/.povray/3.8/povray.ini echo "" >$HOME/.povray/3.8/povray.conf /run/shm/tmpDir/tmpUser/MyP380/bin/povray $@ exit $?

The echoes make sure the usual $HOME/.povray files are there, but empty. Instead of the command povray I use p370 or whatever to switch versions.

Perhaps something like this could work for you too? I see as I've typed this you are thinking multiple users. That should work too without modification of the build process or anything else. Ringing in my head says there is an extra flag to really change the effective $HOME or not with su...

Probably the build / run-time process could be more flexible with respect to multiple versions of POV-Ray - but I've never really thought about the particulars of such a change.

zebulon-1st commented 5 years ago

@wfpokorny Well... my own idea about using extra users is not the best way, because I'm logged in as user "joe", even if I "su pov37" or "su pov38" in a shell : 1) I can't use +d povray option. X server cannot find display for these extra users : No protocol specified. And, povray just crash with a beautifull segmentation fault. 2) because of the rights that each user have on his own files, it's harder to use files from another user. Or I have to create a special group "povray", and add each user in it ; even "joe".

... So, I think your method is simplest and easier to set.