Skip to content

Conversation

@mkoeppe
Copy link

@mkoeppe mkoeppe commented May 18, 2025

Instead of hard-coding the exec_prefix in the installed fricas script, 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.

mkoeppe added a commit to passagemath/passagemath that referenced this pull request May 18, 2025
@hebisch
Copy link
Collaborator

hebisch commented May 28, 2025 via email

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
Copy link
Author

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.

@mkoeppe
Copy link
Author

mkoeppe commented May 28, 2025

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.

Likely it is used exactly to relocate the prebuilt binary package, and they would simply not have to set this variable any more.

@mkoeppe
Copy link
Author

mkoeppe commented May 28, 2025

FriCAS in principle runs on quite large variety of operating systems. My understanding was that some systems do not set "$0" to full pathname.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants