|
| 1 | +# To the extent possible under law, the author(s) have dedicated all |
| 2 | +# copyright and related and neighboring rights to this software to the |
| 3 | +# public domain worldwide. This software is distributed without any warranty. |
| 4 | +# You should have received a copy of the CC0 Public Domain Dedication along |
| 5 | +# with this software. |
| 6 | +# If not, see <https://creativecommons.org/publicdomain/zero/1.0/>. |
| 7 | + |
| 8 | + |
| 9 | +# System-wide profile file |
| 10 | + |
| 11 | +# Setup some default paths. Note that this order will allow user installed |
| 12 | +# software to override 'system' software. |
| 13 | +# Modifying these default path settings can be done in different ways. |
| 14 | +# To learn more about startup files, refer to your shell's man page. |
| 15 | + |
| 16 | +set MSYS2_PATH /usr/local/bin /usr/bin /bin |
| 17 | +set -x MANPATH /usr/local/man /usr/share/man /usr/man /share/man |
| 18 | +set -x INFOPATH /usr/local/info /usr/share/info /usr/info /share/info |
| 19 | + |
| 20 | +if not set -q MSYS2_PATH_TYPE |
| 21 | + set MSYS2_PATH_TYPE minimal |
| 22 | +end |
| 23 | + |
| 24 | +switch $MSYS2_PATH_TYPE |
| 25 | +case strict |
| 26 | + # Do not inherit any path configuration, and allow for full customization |
| 27 | + # of external path. This is supposed to be used in special cases such as |
| 28 | + # debugging without need to change this file, but not daily usage. |
| 29 | + set -ex ORIGINAL_PATH |
| 30 | +case inherit |
| 31 | + # Inherit previous path. Note that this will make all of the Windows path |
| 32 | + # available in current shell, with possible interference in project builds. |
| 33 | + if not set -q ORIGINAL_PATH |
| 34 | + set -x ORIGINAL_PATH $PATH |
| 35 | + end |
| 36 | +case '*' |
| 37 | + # Do not inherit any path configuration but configure a default Windows path |
| 38 | + # suitable for normal usage with minimal external interference. |
| 39 | + set -l PATH $MSYS2_PATH 2>/dev/null |
| 40 | + set WIN_ROOT (cygpath -Wu) |
| 41 | + set -x ORIGINAL_PATH $WIN_ROOT/System32 $WIN_ROOT $WIN_ROOT/System32/Wbem $WIN_ROOT/System32/WindowsPowerShell/v1.0/ |
| 42 | +end |
| 43 | + |
| 44 | +set -e MINGW_MOUNT_POINT |
| 45 | +source '/clang64/etc/fish/msystem.fish' |
| 46 | +switch $MSYSTEM |
| 47 | +case MINGW32 |
| 48 | + set MINGW_MOUNT_POINT $MINGW_PREFIX |
| 49 | + set -x PATH $MINGW_MOUNT_POINT/bin $MSYS2_PATH $ORIGINAL_PATH 2>/dev/null |
| 50 | + set -x PKG_CONFIG_PATH "$MINGW_MOUNT_POINT/lib/pkgconfig:$MINGW_MOUNT_POINT/share/pkgconfig" |
| 51 | + set ACLOCAL_PATH "$MINGW_MOUNT_POINT/share/aclocal:/usr/share/aclocal" |
| 52 | + set -x MANPATH $MINGW_MOUNT_POINT/local/man $MINGW_MOUNT_POINT/share/man $MANPATH |
| 53 | +case MINGW64 |
| 54 | + set MINGW_MOUNT_POINT $MINGW_PREFIX |
| 55 | + set -x PATH $MINGW_MOUNT_POINT/bin $MSYS2_PATH $ORIGINAL_PATH 2>/dev/null |
| 56 | + set -x PKG_CONFIG_PATH "$MINGW_MOUNT_POINT/lib/pkgconfig:$MINGW_MOUNT_POINT/share/pkgconfig" |
| 57 | + set ACLOCAL_PATH "$MINGW_MOUNT_POINT/share/aclocal:/usr/share/aclocal" |
| 58 | + set -x MANPATH $MINGW_MOUNT_POINT/local/man $MINGW_MOUNT_POINT/share/man $MANPATH |
| 59 | +case CLANG64 |
| 60 | + set MINGW_MOUNT_POINT $MINGW_PREFIX |
| 61 | + set -x PATH $MINGW_MOUNT_POINT/bin $MSYS2_PATH $ORIGINAL_PATH 2>/dev/null |
| 62 | + set -x PKG_CONFIG_PATH "$MINGW_MOUNT_POINT/lib/pkgconfig:$MINGW_MOUNT_POINT/share/pkgconfig" |
| 63 | + set ACLOCAL_PATH "$MINGW_MOUNT_POINT/share/aclocal:/usr/share/aclocal" |
| 64 | + set -x MANPATH $MINGW_MOUNT_POINT/local/man $MINGW_MOUNT_POINT/share/man $MANPATH |
| 65 | +case CLANGARM64 |
| 66 | + set MINGW_MOUNT_POINT $MINGW_PREFIX |
| 67 | + set -x PATH $MINGW_MOUNT_POINT/bin $MSYS2_PATH $ORIGINAL_PATH 2>/dev/null |
| 68 | + set -x PKG_CONFIG_PATH "$MINGW_MOUNT_POINT/lib/pkgconfig:$MINGW_MOUNT_POINT/share/pkgconfig" |
| 69 | + set ACLOCAL_PATH "$MINGW_MOUNT_POINT/share/aclocal:/usr/share/aclocal" |
| 70 | + set -x MANPATH $MINGW_MOUNT_POINT/local/man $MINGW_MOUNT_POINT/share/man $MANPATH |
| 71 | +case UCRT64 |
| 72 | + set MINGW_MOUNT_POINT $MINGW_PREFIX |
| 73 | + set -x PATH $MINGW_MOUNT_POINT/bin $MSYS2_PATH $ORIGINAL_PATH 2>/dev/null |
| 74 | + set -x PKG_CONFIG_PATH "$MINGW_MOUNT_POINT/lib/pkgconfig:$MINGW_MOUNT_POINT/share/pkgconfig" |
| 75 | + set ACLOCAL_PATH "$MINGW_MOUNT_POINT/share/aclocal:/usr/share/aclocal" |
| 76 | + set -x MANPATH $MINGW_MOUNT_POINT/local/man $MINGW_MOUNT_POINT/share/man $MANPATH |
| 77 | +case '*' |
| 78 | + set -x PATH $MSYS2_PATH /opt/bin $ORIGINAL_PATH 2>/dev/null |
| 79 | + set -x PKG_CONFIG_PATH "/usr/lib/pkgconfig:/usr/share/pkgconfig:/lib/pkgconfig" |
| 80 | +end |
| 81 | + |
| 82 | +# TMP and TEMP as defined in the Windows environment must be kept |
| 83 | +# for windows apps, even if started from msys2. However, leaving |
| 84 | +# them set to the default Windows temporary directory or unset |
| 85 | +# can have unexpected consequences for msys2 apps, so we define |
| 86 | +# our own to match GNU/Linux behaviour. |
| 87 | +# |
| 88 | +# Note: this uppercase/lowercase workaround does not seem to work. |
| 89 | +# In fact, it has been removed from Cygwin some years ago. See: |
| 90 | +# |
| 91 | +# * https://cygwin.com/git/gitweb.cgi?p=cygwin-apps/base-files.git;a=commitdiff;h=3e54b07 |
| 92 | +# * https://cygwin.com/git/gitweb.cgi?p=cygwin-apps/base-files.git;a=commitdiff;h=7f09aef |
| 93 | +# |
| 94 | +if not set -q ORIGINAL_TMP |
| 95 | + set ORIGINAL_TMP $TMP |
| 96 | +end |
| 97 | +if not set -q ORIGINAL_TEMP |
| 98 | + set ORIGINAL_TEMP $TEMP |
| 99 | +end |
| 100 | +set -e TMP |
| 101 | +set -e TEMP |
| 102 | +set -x tmp (cygpath -w "$ORIGINAL_TMP" 2> /dev/null) |
| 103 | +set -x temp (cygpath -w "$ORIGINAL_TEMP" 2> /dev/null) |
| 104 | +set -x TMP "/tmp" |
| 105 | +set -x TEMP "/tmp" |
| 106 | + |
| 107 | +# Define default printer |
| 108 | +set p '/proc/registry/HKEY_CURRENT_USER/Software/Microsoft/Windows NT/CurrentVersion/Windows/Device' |
| 109 | +if test -e $p |
| 110 | + #Can't use read -d, fish too old |
| 111 | + set PRINTER (cat $p) |
| 112 | + set -x PRINTER (string split ',' $PRINTER)[1] |
| 113 | +end |
| 114 | +set -e p |
| 115 | + |
| 116 | +/usr/bin/hostname | read HOSTNAME |
| 117 | +set -x HOSTNAME $HOSTNAME |
| 118 | +source /clang64/etc/fish/perlbin.fish |
| 119 | + |
| 120 | +if set -q ACLOCAL_PATH |
| 121 | + set -x ACLOCAL_PATH $ACLOCAL_PATH |
| 122 | +end |
| 123 | + |
| 124 | +export USER PRINTER PS1 SHELL |
| 125 | +set -e PATH_SEPARATOR |
0 commit comments