Skip to content

Commit 557c944

Browse files
committed
update post-install scripts
1 parent b01a1de commit 557c944

File tree

3 files changed

+30
-21
lines changed

3 files changed

+30
-21
lines changed

assets/post_install_linux.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@ ${PREFIX}/bin/conda env config vars set MAMBA_NO_BANNER=1
1313
echo "ℹ️ Pinning BLAS implementation to OpenBLAS."
1414
echo "libblas=*=*openblas" >>${PREFIX}/conda-meta/pinned
1515

16-
echo "ℹ️ Running mne sys_info."
17-
${PREFIX}/bin/conda run mne sys_info || true
16+
# TODO later: make a standalone version of something like mne.sys_info(),
17+
# but tailored to the Scientific Python stack. Probably that's a standalone
18+
# post-install script that gets sourced here
19+
# echo "ℹ️ Running mne sys_info."
20+
# ${PREFIX}/bin/conda run mne sys_info || true

assets/post_install_macOS.sh

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
set -eo pipefail
66

7-
logger -p 'install.info' "ℹ️ Running the custom MNE-Python post-install script."
7+
logger -p 'install.info' "ℹ️ Running the custom Scientific Python post-install script."
88

99
# This doesn't appear to be working: even when the installer is run through
1010
# sudo, SUDO_USER is unset. Leave it here for reference:
@@ -14,11 +14,11 @@ logger -p 'install.info' "ℹ️ Running the custom MNE-Python post-install scri
1414
# ☠️ This is ugly and bound to break, but seems to do the job for now. ☠️
1515
# Don't name the variable USER, as this one is already set.
1616
USER_FROM_HOMEDIR=`basename $HOME`
17-
MNE_VERSION=`basename "$(dirname $PREFIX)"`
17+
SPI_VERSION=`basename "$(dirname $PREFIX)"`
1818
logger -p 'install.info' "📓 USER_FROM_HOMEDIR=$USER_FROM_HOMEDIR"
1919
logger -p 'install.info' "📓 DSTROOT=$DSTROOT"
2020
logger -p 'install.info' "📓 PREFIX=$PREFIX"
21-
logger -p 'install.info' "📓 MNE_VERSION=$MNE_VERSION"
21+
logger -p 'install.info' "📓 SPI_VERSION=$SPI_VERSION"
2222

2323
# Guess whether it's a system-wide or only-me install
2424
if [[ "$PREFIX" == "/Applications/"* ]]; then
@@ -28,23 +28,23 @@ else
2828
APP_DIR="$HOME"/Applications
2929
PERMS=""
3030
fi
31-
MNE_APP_DIR_ROOT="${APP_DIR}/MNE-Python"
32-
MNE_APP_DIR="${MNE_APP_DIR_ROOT}/${MNE_VERSION}"
33-
logger -p 'install.info' "📓 MNE_APP_DIR=$MNE_APP_DIR"
31+
SPI_APP_DIR_ROOT="${APP_DIR}/Scientific-Python"
32+
SPI_APP_DIR="${SPI_APP_DIR_ROOT}/${SPI_VERSION}"
33+
logger -p 'install.info' "📓 SPI_APP_DIR=$SPI_APP_DIR"
3434

35-
logger -p 'install.info' "ℹ️ Moving root MNE .app bundles from $APP_DIR to $MNE_APP_DIR."
36-
$PERMS mv "$APP_DIR"/*\(MNE\).app "$MNE_APP_DIR"/
35+
logger -p 'install.info' "ℹ️ Moving root Scientific Python .app bundles from $APP_DIR to $SPI_APP_DIR."
36+
$PERMS mv "$APP_DIR"/*\(ScientificPython\).app "$SPI_APP_DIR"/
3737

38-
logger -p 'install.info' "ℹ️ Fixing permissions of MNE .app bundles in $MNE_APP_DIR: new owner will be ${USER_FROM_HOMEDIR}."
39-
$PERMS chown -R "$USER_FROM_HOMEDIR" "$MNE_APP_DIR"
38+
logger -p 'install.info' "ℹ️ Fixing permissions of Scientific Python .app bundles in $SPI_APP_DIR: new owner will be ${USER_FROM_HOMEDIR}."
39+
$PERMS chown -R "$USER_FROM_HOMEDIR" "$SPI_APP_DIR"
4040

41-
MNE_ICON_PATH="$PREFIX/Menu/mne.png"
42-
logger -p 'install.info' "ℹ️ Setting custom folder icon for $MNE_APP_DIR and $MNE_APP_DIR_ROOT to $MNE_ICON_PATH."
43-
for destPath in "$MNE_APP_DIR" "$MNE_APP_DIR_ROOT"; do
44-
logger -p 'install.info' "ℹ️ Setting custom folder icon for $destPath to $MNE_ICON_PATH."
41+
SPI_ICON_PATH="$PREFIX/Menu/mne.png" # TODO FIXME where is this image coming from / what would be the equivalent for Scientific Python?
42+
logger -p 'install.info' "ℹ️ Setting custom folder icon for $SPI_APP_DIR and $SPI_APP_DIR_ROOT to $SPI_ICON_PATH."
43+
for destPath in "$SPI_APP_DIR" "$SPI_APP_DIR_ROOT"; do
44+
logger -p 'install.info' "ℹ️ Setting custom folder icon for $destPath to $SPI_ICON_PATH."
4545
osascript \
4646
-e 'set destPath to "'"${destPath}"'"' \
47-
-e 'set iconPath to "'"${MNE_ICON_PATH}"'"' \
47+
-e 'set iconPath to "'"${SPI_ICON_PATH}"'"' \
4848
-e 'use framework "Foundation"' \
4949
-e 'use framework "AppKit"' \
5050
-e "set imageData to (current application's NSImage's alloc()'s initWithContentsOfFile:iconPath)" \
@@ -77,8 +77,11 @@ echo "libblas=*=*openblas" >> ${PREFIX}/conda-meta/pinned
7777
logger -p 'install.info' "ℹ️ Fixing permissions of entire conda environment for user=${USER_FROM_HOMEDIR}."
7878
chown -R "$USER_FROM_HOMEDIR" "${PREFIX}"
7979

80-
logger -p 'install.info' "ℹ️ Running mne sys_info."
81-
${DSTBIN}/conda run mne sys_info || true
80+
# TODO later: make a standalone version of something like mne.sys_info(),
81+
# but tailored to the Scientific Python stack. Probably that's a standalone
82+
# post-install script that gets sourced here
83+
# logger -p 'install.info' "ℹ️ Running mne sys_info."
84+
# ${DSTBIN}/conda run mne sys_info || true
8285

8386
logger -p 'install.info' "ℹ️ Opening in Finder ${MNE_APP_DIR}/."
8487
open -R "${MNE_APP_DIR}/"

assets/post_install_windows.bat

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,8 @@ echo Disabling mamba package manager banner.
1212
echo Pinning BLAS implementation to OpenBLAS.
1313
echo libblas=*=*openblas >> "%PREFIX%\conda-meta\pinned"
1414

15-
echo Running mne sys_info.
16-
"%PREFIX%\Scripts\conda" run mne sys_info || echo
15+
:: TODO later: make a standalone version of something like mne.sys_info(),
16+
:: but tailored to the Scientific Python stack. Probably that's a standalone
17+
:: post-install script that gets sourced here
18+
:: echo Running mne sys_info.
19+
:: "%PREFIX%\Scripts\conda" run mne sys_info || echo

0 commit comments

Comments
 (0)