Skip to content
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

Search for runtime files in shared directory, to support system-wide installation #68

Closed
wants to merge 1 commit into from

Conversation

vrza
Copy link
Contributor

@vrza vrza commented Jun 2, 2022

Check directories relative to the directory the executable is run from.

If runtime files dir is not found under ${exedir}/root/lotus, try searching in ${exedir}/../share/lotus.

This should help support system-wide installation and packaging.

Related to issue #66

@vrza
Copy link
Contributor Author

vrza commented Jun 2, 2022

@taviso what do you think about this approach?

The location for the default config file can admittedly be nicer, e.g. $PREFIX/share/lotus/123.v10/etc/l123set.cf

@vrza vrza force-pushed the shared-runtime branch 2 times, most recently from 4c91f22 to 4f1abaf Compare June 2, 2022 16:57
Check directories relative to the directory executable is run from.

If runtime files dir is not found under ${exedir}/root/lotus,
try searching in ${exedir}/../share/lotus

This should help support system-wide installation and packaging.
@vrza
Copy link
Contributor Author

vrza commented Jun 3, 2022

Thinking about this further, another approach could be:

  • install runtime files, 123 binary, and default config under the same directory tree, e.g. /opt/lotus/123.v10
  • man pages installed into a standard dir in MANPATH e.g. /usr/local/share/man/ or /usr/share/man/

Then either:

  • install 123 in a standard dir in PATH, e.g. /usr/local/bin/ or /usr/bin/ as a symlink to the 123 binary
  • 123 binary resolves the symlink, if invoked through it, to find default config and runtime files

or:

  • install 123 in a standard dir in PATH, e.g. /usr/local/bin/ or /usr/bin/ as a symlink to a wrapper shell script that resolves the symlink to find the location of the 123 binary and execs the binary
  • 123 binary finds default config and runtime files relative to where it was exec'd from

@vrza
Copy link
Contributor Author

vrza commented Jun 3, 2022

Discussion related to #20

@vrza vrza mentioned this pull request Jun 3, 2022
@taviso
Copy link
Owner

taviso commented Jun 3, 2022

Sorry for the slow response - I was focused on the keymap issue. This looks good to me, I rolled back the extract script temporarily because of bug reports, as soon as that returns I think this is good to merge.

@vrza
Copy link
Contributor Author

vrza commented Jun 3, 2022

No rush. I can create a new branch with the fixed extract file and with the unified filesystem approach described above:

${PREFIX}/bin/123
${PREFIX}/share/lotus/123.v10/
${PREFIX}/etc/l123set.cf

@vrza
Copy link
Contributor Author

vrza commented Jun 3, 2022

@taviso Created a new PR based on current main branch for your convenience:

#70

Some files have been moved around (most notably binary is now built as bin/123) so please test on whatever setup you can. I tested on Linux, works for me in both git directory as well as installed system-wide in /usr/local.

@taviso
Copy link
Owner

taviso commented Jun 3, 2022

Thank you, closing as #70 has now been merged instead.

@taviso taviso closed this Jun 3, 2022
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.

None yet

2 participants