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

Add App bundle and wrappers to enable better system integration #3

Open
bjeurissen opened this issue Jan 20, 2021 · 1 comment
Open

Comments

@bjeurissen
Copy link
Member

Similar to the standalone installer could we add OS integration into to the homebrew formula?

The following layout seems to accomplish this:

➜  bin git:(master) pwd            
/opt/homebrew/opt/mrtrix3/bin

Replace mrview binary with wrapper:

➜  bin git:(master) cat mrview                      
#!/bin/bash
f="${BASH_SOURCE}"
while [[ -L "${f}" ]]; do
 f2="$(readlink "${f}")"
 if [[ "${f2}" = /* ]]; then f="${f2}"; else f="$(dirname "${f}")/${f2}"; fi
done
f=$(dirname "${f}")
"${f}"/MRView.app/Contents/MacOS/mrview "$@"

Replace shview binary with wrapper:

➜  bin git:(master) cat shview
#!/bin/bash
f="${BASH_SOURCE}"
while [[ -L "${f}" ]]; do
 f2="$(readlink "${f}")"
 if [[ "${f2}" = /* ]]; then f="${f2}"; else f="$(dirname "${f}")/${f2}"; fi
done
f=$(dirname "${f}")
"${f}"/SHView.app/Contents/MacOS/shview "$@"

Move mrview into MRview.app application bundle:

➜  bin git:(master) tree MRView.app
MRView.app
└── Contents
    ├── Info.plist
    ├── MacOS
    │   └── mrview --> actual mrview binary moved here
    ├── Resources
    │   ├── mrview.icns
    │   └── mrview_doc.icns
    └── lib -> ../../../lib

4 directories, 4 files

Move shview into SHView.app application bundle:

➜  bin git:(master) tree SHView.app
SHView.app
└── Contents
    ├── Info.plist
    ├── MacOS
    │   └── shview --> actual shview binary moved here
    ├── Resources -> ../../MRView.app/Contents/Resources
    └── lib -> ../../../lib

4 directories, 2 files

I first installed mrview using homebrew and then made these changes manually.

Would this be technically feasible within the formula?
Would this be desirable?

@bjeurissen
Copy link
Member Author

I added support for Application bundles to the MRtrix3 ./build script in this branch.

This way the standalone, homebrew, anaconda, and compilation from scratch installation approaches can all reuse it.

Is this something that people would be happy with?

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

No branches or pull requests

1 participant