-
Notifications
You must be signed in to change notification settings - Fork 48
Make fricas installation relocatable #197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…tallation relocatable
|
On Sun, May 18, 2025 at 10:40:47AM -0700, Matthias Köppe wrote:
Instead of hard-coding the `exec_prefix` in the installed `fricas` script, obtain it from the invocation of the script.
I have some doubts about this patch. First, current design allows
you to easily customize behaviour: you can prepend to 'fricas'
script your own script which computes desired FRICAS_PREFIX
(or set FRICAS_PREFIX in environment before invoking 'fricas'
script). You remove this possibility of customization, replacing
it by fixed behaviour, that is depending on relative positions.
Second, FriCAS in principle runs on quite large variety of operating
systems. My understanding was that some systems do not set "$0"
to full pathname.
Extra remark1: 'resolvelinks.sh' tries to produce relative path
when given a relative path as input. But the only supported
seting of FRICAS is absolute.
Extra remark2: FRICAS_PREFIX exists to support installers on
Mac OSX. I do not know if it is used in current packages,
but if used your change can in principle break them.
…--
Waldek Hebisch
|
| echo 'exec_prefix=$$(resolvelinks "$$0")' >> '${COMMAND}'.tmp | ||
| echo 'exec_prefix=$${exec_prefix%/*}' >> '${COMMAND}'.tmp | ||
| echo 'exec_prefix=$${exec_prefix%/*}' >> '${COMMAND}'.tmp | ||
| echo 'exec_prefix=$$(cd $$exec_prefix && pwd -P)' >> '${COMMAND}'.tmp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note that here I make the exec_prefix absolute.
Likely it is used exactly to relocate the prebuilt binary package, and they would simply not have to set this variable any more. |
I can only note that the script was in use in Sage for a very long time, including when Cygwin was still supported. The script is so long because it achieves its goals even when "$0" is not the full pathname. |
Instead of hard-coding the
exec_prefixin the installedfricasscript, obtain it from the invocation of the script.The portable shell code for this also handles the situation when the script is invoked via symlinks.