Install TeXmacs with Maxima on mac with M1

It seems apple do not want to make easy to modify the environment of running applications. This indeed could have security concerns. I guess the proper way to support multiple paths is to allow the user to set up an optional TeXmacs preference to override the standard search path mechanisms in plugins. This makes sense and would not be difficult to do.

1 Like

The key here is that you should NOT modify the global PATH as some programs may rely on the BSD utilities’ behavior. A TeXmacs preference is the way to go, as @mgubi said.

I’m looking at the plugin right now and it will search also into the path TeXmacs.app/Contents/Resources/maxima/bin. So I guess a rapid solution is to symlink that directory to the directory where the executable can be found. Of course as soon as one reinstall TeXmacs this change will be lost, but in the meanwhile should work.

OK, so for everyone who has maxima installed, a work-around is the following steps:

  1. Open a terminal.
  2. Verify that maxima is correctly installed on your system by typing which maxima - must print a path to maxima.
  3. Open TeXmacs.
  4. Verify that TeXmacs can not find maxima.
  5. Open a Scheme session in a TeXmacs document—from the menu: Insert->Session->Scheme (entry at the top of the Session submenu).
  6. Type (getenv "PATH") to see which paths TeXmacs will examine for maxima.
  7. Choose one of the paths (for instance /usr/local/bin).
  8. Symlink maxima into one of the paths you got in step 6, by typing the following in your terminal:
sudo ln -s $(which maxima) [the path you chose]/maxima

where [the path you chose] is the path you chose from step 6.

  1. Close and re-open TeXmacs - maxima should be detected.

This is mostly a summary of the 66 posts so far.

3 Likes

A bit late, but supporting plugins on M1 is scheduled for Mogan v1.1.2.

Mogan v1.1.2 rc4 is released, just improved the maxima support on macOS M1.

NOTE: it assumes you install maxima via homebrew and the maxima binary is in /opt/homebrew/opt/maxima/bin

And the fix will be backported to GNU TeXmacs later after the stable release of Mogan.

2 Likes

I just saw maxima the configuration in wxMaxima and perhaps it can inspire TeXmacs developers to do something similar.

You can set the path to maxima, set environment variables and various parameters for maxima.

It looks like the Maxima program Autodetect, only did which maxima to get the path. But I’m guessing :slight_smile:

1 Like

I agree with you. And further more, I think plugins should be maintained outside of TeXmacs.

I planned to create a plugin center, but I am still busy working on fixing bugs.

My installation on on MacBook Air/M2, ventura 13.3.1.
maxima installed via homebrew into /opt/homebrew/bin.

I followed the following post on the apple stackexchange:
https://apple.stackexchange.com/questions/128897/how-to-use-etc-paths-d-to-add-executable-files-to-my-path:

Use /etc/paths.d/ to add a path to /opt/homebrew/bin:
I created a file in that directory. I named it homebrew-bin. I put a single line of text in it:
/opt/homebrew/bin
I need to be a superuser to be able to do that. (I did it via terminal, sudo and vim)

I then started TeXmacs app and updated the plugins (Tools/Update/Plugins).

Mirko

Don’t

You can just install your local copy of the maxima plugin and hard code the Homebrew Maxima path.

Can you explain the danger/downside of /etc/paths.d? To me the only downside is that it becomes part of PATH for all users. Otherwise, it looks very legitimate. (But, then again, I am very new to MacOS)

This directory is described in the documentation. It is read by path_helper when the shell starts - that is described in its manpage. Both /etc/profile and /etc/zprofile call path_helper.

Thanks,

When you use Homebrew you install tons of programs that have same names as the system-included ones. If you change /etc/paths.d the PATH will be changed for all apps, and some applications may not be expecting this. This is why Homebrew only set the PATH for interactive shells at install.