From 0287df5dcbfe7043461bf6d79ae316c9d4b83e8d Mon Sep 17 00:00:00 2001 From: Maksim Bondarenkov Date: Thu, 19 Dec 2024 19:49:05 +0300 Subject: [PATCH] [new package] fish 4.0b1 currently can't be compiled for mingw --- mingw-w64-fish/PKGBUILD | 70 ++++++++++++++++ mingw-w64-fish/config-CLANG64.fish | 18 ++++ mingw-w64-fish/config-MINGW64.fish | 18 ++++ mingw-w64-fish/config-UCRT64.fish | 18 ++++ mingw-w64-fish/fish-CLANG64.install | 11 +++ mingw-w64-fish/fish-MINGW64.install | 11 +++ mingw-w64-fish/fish-UCRT64.install | 11 +++ mingw-w64-fish/msys2-CLANG64.fish | 125 ++++++++++++++++++++++++++++ mingw-w64-fish/msys2-MINGW64.fish | 125 ++++++++++++++++++++++++++++ mingw-w64-fish/msys2-UCRT64.fish | 125 ++++++++++++++++++++++++++++ mingw-w64-fish/msystem.fish | 55 ++++++++++++ mingw-w64-fish/perlbin.fish | 19 +++++ 12 files changed, 606 insertions(+) create mode 100644 mingw-w64-fish/PKGBUILD create mode 100644 mingw-w64-fish/config-CLANG64.fish create mode 100644 mingw-w64-fish/config-MINGW64.fish create mode 100644 mingw-w64-fish/config-UCRT64.fish create mode 100644 mingw-w64-fish/fish-CLANG64.install create mode 100644 mingw-w64-fish/fish-MINGW64.install create mode 100644 mingw-w64-fish/fish-UCRT64.install create mode 100644 mingw-w64-fish/msys2-CLANG64.fish create mode 100644 mingw-w64-fish/msys2-MINGW64.fish create mode 100644 mingw-w64-fish/msys2-UCRT64.fish create mode 100644 mingw-w64-fish/msystem.fish create mode 100644 mingw-w64-fish/perlbin.fish diff --git a/mingw-w64-fish/PKGBUILD b/mingw-w64-fish/PKGBUILD new file mode 100644 index 0000000000000..15173a00b6f35 --- /dev/null +++ b/mingw-w64-fish/PKGBUILD @@ -0,0 +1,70 @@ +# Maintainer: Maksim Bondarenkov + +_realname=fish +pkgbase=mingw-w64-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" +pkgver=4.0b1 +pkgrel=1 +pkgdesc='Smart and user friendly shell intended mostly for interactive use (mingw-w64)' +arch=('x86_64') +url="https://fishshell.com/" +msys2_repository_url="https://github.com/fish-shell/fish-shell" +msys2_references=( + "cpe: cpe:/a:fishshell:fish" +) +license=('spdx:GPL-2.0-only') +depends=("${MINGW_PACKAGE_PREFIX}-pcre2" + "${MINGW_PACKAGE_PREFIX}-gettext-runtime" + 'man-db') +makedepends=("${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-cmake" + "${MINGW_PACKAGE_PREFIX}-ninja" + "${MINGW_PACKAGE_PREFIX}-rust" + "${MINGW_PACKAGE_PREFIX}-gettext-tools") +optdepends=("${MINGW_PACKAGE_PREFIX}-python: for manual page completion parser and web configuration tool") +install=fish-${MSYSTEM}.install +backup=("${MINGW_PREFIX:1}/etc/fish/config.fish" + "${MINGW_PREFIX:1}/etc/fish/msys2.fish" + "${MINGW_PREFIX:1}etc/fish/perlbin.fish") +source=("https://github.com/fish-shell/fish-shell/releases/download/${pkgver}/${_realname}-${pkgver}.tar.xz"{,.asc} + config-CLANG64.fish + config-UCRT64.fish + config-MINGW64.fish + msys2-CLANG64.fish + msys2-UCRT64.fish + msys2-MINGW64.fish + msystem.fish + perlbin.fish) +sha256sums=('534334e10f85722214e9daff82a57cc3501235523f16f8f131c2344e4ec98da7' + 'SKIP' + 'a6097b634e236d2272744a6d5e0b31685a2198807d88eb091f4829ee4913ce36' + '925f9a45b9887f4bb74a5589cf1ab099dec376dd30b07e830042554befac9bdb' + '63b7634cda9048834cdbbd57bc842b7e6a49cb8541a578cafc2797a4a42ae8f8' + '921c8725fcc53157752d3c100da8b6585a68d5fee5d476d6867310984937fb36' + '1fdab0aba85dede9b29644957923d40314799b5d6541a25f7ba68ae9834ee267' + '30ec15d5fe54078e275d9b7f1e62ea4240f3bc069881fdcfe95eb9442f2121f0' + 'b1a7b7b4238170373dd8acdc36bcbd1fc3978b3525403b877576139d6090e30d' + 'b136a9fa94abf53e302f7a1cc28def03b58dd2326990c5f02ceb4988341a5ac6') +validpgpkeys=('003837986104878835FA516D7A67D962D88A709A') # David Adam + +build() { + MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=;-DCMAKE_INSTALL_SYSCONFDIR=" + cmake \ + -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \ + -DCMAKE_INSTALL_SYSCONFDIR=${MINGW_PREFIX}/etc \ + -DCMAKE_BUILD_TYPE=None \ + -S ${_realname}-${pkgver} \ + -B build-${MSYSTEM} + + cmake --build build-${MSYSTEM} +} + +package() { + rm -rf "${_realname}-${pkgver}/build-${MSYSTEM}/user_doc" + cmake --install build-${MSYSTEM} + + install -Dm644 config-${MSYSTEM}.fish "${pkgdir}${MINGW_PREFIX}/etc/fish/config.fish" + install -Dm644 msys2-${MSYSTEM}.fish "${pkgdir}${MINGW_PREFIX}/etc/fish/msys2.fish" + install -Dm644 msystem.fish "${pkgdir}${MINGW_PREFIX}/etc/fish/msystem.fish" + install -Dm644 perlbin.fish "${pkgdir}${MINGW_PREFIX}/etc/fish/perlbin.fish" +} diff --git a/mingw-w64-fish/config-CLANG64.fish b/mingw-w64-fish/config-CLANG64.fish new file mode 100644 index 0000000000000..0ab174651541f --- /dev/null +++ b/mingw-w64-fish/config-CLANG64.fish @@ -0,0 +1,18 @@ +# Put system-wide fish configuration entries here +# or in .fish files in conf.d/ +# Files in conf.d can be overridden by the user +# by files with the same name in $XDG_CONFIG_HOME/fish/conf.d + +# This file is run by all fish instances. +# To include configuration only for login shells, use +# if status --is-login +# ... +# end +# To include configuration only for interactive shells, use +# if status --is-interactive +# ... +# end + +if status --is-login + source /mingw64/etc/fish/msys2.fish +end diff --git a/mingw-w64-fish/config-MINGW64.fish b/mingw-w64-fish/config-MINGW64.fish new file mode 100644 index 0000000000000..6780ead394aa2 --- /dev/null +++ b/mingw-w64-fish/config-MINGW64.fish @@ -0,0 +1,18 @@ +# Put system-wide fish configuration entries here +# or in .fish files in conf.d/ +# Files in conf.d can be overridden by the user +# by files with the same name in $XDG_CONFIG_HOME/fish/conf.d + +# This file is run by all fish instances. +# To include configuration only for login shells, use +# if status --is-login +# ... +# end +# To include configuration only for interactive shells, use +# if status --is-interactive +# ... +# end + +if status --is-login + source /clang64/etc/fish/msys2.fish +end diff --git a/mingw-w64-fish/config-UCRT64.fish b/mingw-w64-fish/config-UCRT64.fish new file mode 100644 index 0000000000000..d5c0c9cde7c05 --- /dev/null +++ b/mingw-w64-fish/config-UCRT64.fish @@ -0,0 +1,18 @@ +# Put system-wide fish configuration entries here +# or in .fish files in conf.d/ +# Files in conf.d can be overridden by the user +# by files with the same name in $XDG_CONFIG_HOME/fish/conf.d + +# This file is run by all fish instances. +# To include configuration only for login shells, use +# if status --is-login +# ... +# end +# To include configuration only for interactive shells, use +# if status --is-interactive +# ... +# end + +if status --is-login + source /ucrt64/etc/fish/msys2.fish +end diff --git a/mingw-w64-fish/fish-CLANG64.install b/mingw-w64-fish/fish-CLANG64.install new file mode 100644 index 0000000000000..f8ee7235ecf87 --- /dev/null +++ b/mingw-w64-fish/fish-CLANG64.install @@ -0,0 +1,11 @@ +post_install() { + grep -q '/clang64/bin/fish' etc/shells || echo '/clang64/bin/fish' >> etc/shells +} + +post_upgrade() { + post_install +} + +pre_remove() { + sed -i '/^\/clang64\/bin\/fish/d' etc/shells +} diff --git a/mingw-w64-fish/fish-MINGW64.install b/mingw-w64-fish/fish-MINGW64.install new file mode 100644 index 0000000000000..d558b4af9a04c --- /dev/null +++ b/mingw-w64-fish/fish-MINGW64.install @@ -0,0 +1,11 @@ +post_install() { + grep -q '/mingw64/bin/fish' etc/shells || echo '/mingw64/bin/fish' >> etc/shells +} + +post_upgrade() { + post_install +} + +pre_remove() { + sed -i '/^\/mingw64\/bin\/fish/d' etc/shells +} diff --git a/mingw-w64-fish/fish-UCRT64.install b/mingw-w64-fish/fish-UCRT64.install new file mode 100644 index 0000000000000..ac70a05e7b409 --- /dev/null +++ b/mingw-w64-fish/fish-UCRT64.install @@ -0,0 +1,11 @@ +post_install() { + grep -q '/ucrt64/bin/fish' etc/shells || echo '/ucrt64/bin/fish' >> etc/shells +} + +post_upgrade() { + post_install +} + +pre_remove() { + sed -i '/^\/ucrt64\/bin\/fish/d' etc/shells +} diff --git a/mingw-w64-fish/msys2-CLANG64.fish b/mingw-w64-fish/msys2-CLANG64.fish new file mode 100644 index 0000000000000..5850bdcc4914f --- /dev/null +++ b/mingw-w64-fish/msys2-CLANG64.fish @@ -0,0 +1,125 @@ +# To the extent possible under law, the author(s) have dedicated all +# copyright and related and neighboring rights to this software to the +# public domain worldwide. This software is distributed without any warranty. +# You should have received a copy of the CC0 Public Domain Dedication along +# with this software. +# If not, see . + + +# System-wide profile file + +# Setup some default paths. Note that this order will allow user installed +# software to override 'system' software. +# Modifying these default path settings can be done in different ways. +# To learn more about startup files, refer to your shell's man page. + +set MSYS2_PATH /usr/local/bin /usr/bin /bin +set -x MANPATH /usr/local/man /usr/share/man /usr/man /share/man +set -x INFOPATH /usr/local/info /usr/share/info /usr/info /share/info + +if not set -q MSYS2_PATH_TYPE + set MSYS2_PATH_TYPE minimal +end + +switch $MSYS2_PATH_TYPE +case strict + # Do not inherit any path configuration, and allow for full customization + # of external path. This is supposed to be used in special cases such as + # debugging without need to change this file, but not daily usage. + set -ex ORIGINAL_PATH +case inherit + # Inherit previous path. Note that this will make all of the Windows path + # available in current shell, with possible interference in project builds. + if not set -q ORIGINAL_PATH + set -x ORIGINAL_PATH $PATH + end +case '*' + # Do not inherit any path configuration but configure a default Windows path + # suitable for normal usage with minimal external interference. + set -l PATH $MSYS2_PATH 2>/dev/null + set WIN_ROOT (cygpath -Wu) + set -x ORIGINAL_PATH $WIN_ROOT/System32 $WIN_ROOT $WIN_ROOT/System32/Wbem $WIN_ROOT/System32/WindowsPowerShell/v1.0/ +end + +set -e MINGW_MOUNT_POINT +source '/clang64/etc/fish/msystem.fish' +switch $MSYSTEM +case MINGW32 + set MINGW_MOUNT_POINT $MINGW_PREFIX + set -x PATH $MINGW_MOUNT_POINT/bin $MSYS2_PATH $ORIGINAL_PATH 2>/dev/null + set -x PKG_CONFIG_PATH "$MINGW_MOUNT_POINT/lib/pkgconfig:$MINGW_MOUNT_POINT/share/pkgconfig" + set ACLOCAL_PATH "$MINGW_MOUNT_POINT/share/aclocal:/usr/share/aclocal" + set -x MANPATH $MINGW_MOUNT_POINT/local/man $MINGW_MOUNT_POINT/share/man $MANPATH +case MINGW64 + set MINGW_MOUNT_POINT $MINGW_PREFIX + set -x PATH $MINGW_MOUNT_POINT/bin $MSYS2_PATH $ORIGINAL_PATH 2>/dev/null + set -x PKG_CONFIG_PATH "$MINGW_MOUNT_POINT/lib/pkgconfig:$MINGW_MOUNT_POINT/share/pkgconfig" + set ACLOCAL_PATH "$MINGW_MOUNT_POINT/share/aclocal:/usr/share/aclocal" + set -x MANPATH $MINGW_MOUNT_POINT/local/man $MINGW_MOUNT_POINT/share/man $MANPATH +case CLANG64 + set MINGW_MOUNT_POINT $MINGW_PREFIX + set -x PATH $MINGW_MOUNT_POINT/bin $MSYS2_PATH $ORIGINAL_PATH 2>/dev/null + set -x PKG_CONFIG_PATH "$MINGW_MOUNT_POINT/lib/pkgconfig:$MINGW_MOUNT_POINT/share/pkgconfig" + set ACLOCAL_PATH "$MINGW_MOUNT_POINT/share/aclocal:/usr/share/aclocal" + set -x MANPATH $MINGW_MOUNT_POINT/local/man $MINGW_MOUNT_POINT/share/man $MANPATH +case CLANGARM64 + set MINGW_MOUNT_POINT $MINGW_PREFIX + set -x PATH $MINGW_MOUNT_POINT/bin $MSYS2_PATH $ORIGINAL_PATH 2>/dev/null + set -x PKG_CONFIG_PATH "$MINGW_MOUNT_POINT/lib/pkgconfig:$MINGW_MOUNT_POINT/share/pkgconfig" + set ACLOCAL_PATH "$MINGW_MOUNT_POINT/share/aclocal:/usr/share/aclocal" + set -x MANPATH $MINGW_MOUNT_POINT/local/man $MINGW_MOUNT_POINT/share/man $MANPATH +case UCRT64 + set MINGW_MOUNT_POINT $MINGW_PREFIX + set -x PATH $MINGW_MOUNT_POINT/bin $MSYS2_PATH $ORIGINAL_PATH 2>/dev/null + set -x PKG_CONFIG_PATH "$MINGW_MOUNT_POINT/lib/pkgconfig:$MINGW_MOUNT_POINT/share/pkgconfig" + set ACLOCAL_PATH "$MINGW_MOUNT_POINT/share/aclocal:/usr/share/aclocal" + set -x MANPATH $MINGW_MOUNT_POINT/local/man $MINGW_MOUNT_POINT/share/man $MANPATH +case '*' + set -x PATH $MSYS2_PATH /opt/bin $ORIGINAL_PATH 2>/dev/null + set -x PKG_CONFIG_PATH "/usr/lib/pkgconfig:/usr/share/pkgconfig:/lib/pkgconfig" +end + +# TMP and TEMP as defined in the Windows environment must be kept +# for windows apps, even if started from msys2. However, leaving +# them set to the default Windows temporary directory or unset +# can have unexpected consequences for msys2 apps, so we define +# our own to match GNU/Linux behaviour. +# +# Note: this uppercase/lowercase workaround does not seem to work. +# In fact, it has been removed from Cygwin some years ago. See: +# +# * https://cygwin.com/git/gitweb.cgi?p=cygwin-apps/base-files.git;a=commitdiff;h=3e54b07 +# * https://cygwin.com/git/gitweb.cgi?p=cygwin-apps/base-files.git;a=commitdiff;h=7f09aef +# +if not set -q ORIGINAL_TMP + set ORIGINAL_TMP $TMP +end +if not set -q ORIGINAL_TEMP + set ORIGINAL_TEMP $TEMP +end +set -e TMP +set -e TEMP +set -x tmp (cygpath -w "$ORIGINAL_TMP" 2> /dev/null) +set -x temp (cygpath -w "$ORIGINAL_TEMP" 2> /dev/null) +set -x TMP "/tmp" +set -x TEMP "/tmp" + +# Define default printer +set p '/proc/registry/HKEY_CURRENT_USER/Software/Microsoft/Windows NT/CurrentVersion/Windows/Device' +if test -e $p + #Can't use read -d, fish too old + set PRINTER (cat $p) + set -x PRINTER (string split ',' $PRINTER)[1] +end +set -e p + +/usr/bin/hostname | read HOSTNAME +set -x HOSTNAME $HOSTNAME +source /clang64/etc/fish/perlbin.fish + +if set -q ACLOCAL_PATH + set -x ACLOCAL_PATH $ACLOCAL_PATH +end + +export USER PRINTER PS1 SHELL +set -e PATH_SEPARATOR diff --git a/mingw-w64-fish/msys2-MINGW64.fish b/mingw-w64-fish/msys2-MINGW64.fish new file mode 100644 index 0000000000000..1323deff40851 --- /dev/null +++ b/mingw-w64-fish/msys2-MINGW64.fish @@ -0,0 +1,125 @@ +# To the extent possible under law, the author(s) have dedicated all +# copyright and related and neighboring rights to this software to the +# public domain worldwide. This software is distributed without any warranty. +# You should have received a copy of the CC0 Public Domain Dedication along +# with this software. +# If not, see . + + +# System-wide profile file + +# Setup some default paths. Note that this order will allow user installed +# software to override 'system' software. +# Modifying these default path settings can be done in different ways. +# To learn more about startup files, refer to your shell's man page. + +set MSYS2_PATH /usr/local/bin /usr/bin /bin +set -x MANPATH /usr/local/man /usr/share/man /usr/man /share/man +set -x INFOPATH /usr/local/info /usr/share/info /usr/info /share/info + +if not set -q MSYS2_PATH_TYPE + set MSYS2_PATH_TYPE minimal +end + +switch $MSYS2_PATH_TYPE +case strict + # Do not inherit any path configuration, and allow for full customization + # of external path. This is supposed to be used in special cases such as + # debugging without need to change this file, but not daily usage. + set -ex ORIGINAL_PATH +case inherit + # Inherit previous path. Note that this will make all of the Windows path + # available in current shell, with possible interference in project builds. + if not set -q ORIGINAL_PATH + set -x ORIGINAL_PATH $PATH + end +case '*' + # Do not inherit any path configuration but configure a default Windows path + # suitable for normal usage with minimal external interference. + set -l PATH $MSYS2_PATH 2>/dev/null + set WIN_ROOT (cygpath -Wu) + set -x ORIGINAL_PATH $WIN_ROOT/System32 $WIN_ROOT $WIN_ROOT/System32/Wbem $WIN_ROOT/System32/WindowsPowerShell/v1.0/ +end + +set -e MINGW_MOUNT_POINT +source '/mingw64/etc/fish/msystem.fish' +switch $MSYSTEM +case MINGW32 + set MINGW_MOUNT_POINT $MINGW_PREFIX + set -x PATH $MINGW_MOUNT_POINT/bin $MSYS2_PATH $ORIGINAL_PATH 2>/dev/null + set -x PKG_CONFIG_PATH "$MINGW_MOUNT_POINT/lib/pkgconfig:$MINGW_MOUNT_POINT/share/pkgconfig" + set ACLOCAL_PATH "$MINGW_MOUNT_POINT/share/aclocal:/usr/share/aclocal" + set -x MANPATH $MINGW_MOUNT_POINT/local/man $MINGW_MOUNT_POINT/share/man $MANPATH +case MINGW64 + set MINGW_MOUNT_POINT $MINGW_PREFIX + set -x PATH $MINGW_MOUNT_POINT/bin $MSYS2_PATH $ORIGINAL_PATH 2>/dev/null + set -x PKG_CONFIG_PATH "$MINGW_MOUNT_POINT/lib/pkgconfig:$MINGW_MOUNT_POINT/share/pkgconfig" + set ACLOCAL_PATH "$MINGW_MOUNT_POINT/share/aclocal:/usr/share/aclocal" + set -x MANPATH $MINGW_MOUNT_POINT/local/man $MINGW_MOUNT_POINT/share/man $MANPATH +case CLANG64 + set MINGW_MOUNT_POINT $MINGW_PREFIX + set -x PATH $MINGW_MOUNT_POINT/bin $MSYS2_PATH $ORIGINAL_PATH 2>/dev/null + set -x PKG_CONFIG_PATH "$MINGW_MOUNT_POINT/lib/pkgconfig:$MINGW_MOUNT_POINT/share/pkgconfig" + set ACLOCAL_PATH "$MINGW_MOUNT_POINT/share/aclocal:/usr/share/aclocal" + set -x MANPATH $MINGW_MOUNT_POINT/local/man $MINGW_MOUNT_POINT/share/man $MANPATH +case CLANGARM64 + set MINGW_MOUNT_POINT $MINGW_PREFIX + set -x PATH $MINGW_MOUNT_POINT/bin $MSYS2_PATH $ORIGINAL_PATH 2>/dev/null + set -x PKG_CONFIG_PATH "$MINGW_MOUNT_POINT/lib/pkgconfig:$MINGW_MOUNT_POINT/share/pkgconfig" + set ACLOCAL_PATH "$MINGW_MOUNT_POINT/share/aclocal:/usr/share/aclocal" + set -x MANPATH $MINGW_MOUNT_POINT/local/man $MINGW_MOUNT_POINT/share/man $MANPATH +case UCRT64 + set MINGW_MOUNT_POINT $MINGW_PREFIX + set -x PATH $MINGW_MOUNT_POINT/bin $MSYS2_PATH $ORIGINAL_PATH 2>/dev/null + set -x PKG_CONFIG_PATH "$MINGW_MOUNT_POINT/lib/pkgconfig:$MINGW_MOUNT_POINT/share/pkgconfig" + set ACLOCAL_PATH "$MINGW_MOUNT_POINT/share/aclocal:/usr/share/aclocal" + set -x MANPATH $MINGW_MOUNT_POINT/local/man $MINGW_MOUNT_POINT/share/man $MANPATH +case '*' + set -x PATH $MSYS2_PATH /opt/bin $ORIGINAL_PATH 2>/dev/null + set -x PKG_CONFIG_PATH "/usr/lib/pkgconfig:/usr/share/pkgconfig:/lib/pkgconfig" +end + +# TMP and TEMP as defined in the Windows environment must be kept +# for windows apps, even if started from msys2. However, leaving +# them set to the default Windows temporary directory or unset +# can have unexpected consequences for msys2 apps, so we define +# our own to match GNU/Linux behaviour. +# +# Note: this uppercase/lowercase workaround does not seem to work. +# In fact, it has been removed from Cygwin some years ago. See: +# +# * https://cygwin.com/git/gitweb.cgi?p=cygwin-apps/base-files.git;a=commitdiff;h=3e54b07 +# * https://cygwin.com/git/gitweb.cgi?p=cygwin-apps/base-files.git;a=commitdiff;h=7f09aef +# +if not set -q ORIGINAL_TMP + set ORIGINAL_TMP $TMP +end +if not set -q ORIGINAL_TEMP + set ORIGINAL_TEMP $TEMP +end +set -e TMP +set -e TEMP +set -x tmp (cygpath -w "$ORIGINAL_TMP" 2> /dev/null) +set -x temp (cygpath -w "$ORIGINAL_TEMP" 2> /dev/null) +set -x TMP "/tmp" +set -x TEMP "/tmp" + +# Define default printer +set p '/proc/registry/HKEY_CURRENT_USER/Software/Microsoft/Windows NT/CurrentVersion/Windows/Device' +if test -e $p + #Can't use read -d, fish too old + set PRINTER (cat $p) + set -x PRINTER (string split ',' $PRINTER)[1] +end +set -e p + +/usr/bin/hostname | read HOSTNAME +set -x HOSTNAME $HOSTNAME +source /mingw64/etc/fish/perlbin.fish + +if set -q ACLOCAL_PATH + set -x ACLOCAL_PATH $ACLOCAL_PATH +end + +export USER PRINTER PS1 SHELL +set -e PATH_SEPARATOR diff --git a/mingw-w64-fish/msys2-UCRT64.fish b/mingw-w64-fish/msys2-UCRT64.fish new file mode 100644 index 0000000000000..74c09dae4830b --- /dev/null +++ b/mingw-w64-fish/msys2-UCRT64.fish @@ -0,0 +1,125 @@ +# To the extent possible under law, the author(s) have dedicated all +# copyright and related and neighboring rights to this software to the +# public domain worldwide. This software is distributed without any warranty. +# You should have received a copy of the CC0 Public Domain Dedication along +# with this software. +# If not, see . + + +# System-wide profile file + +# Setup some default paths. Note that this order will allow user installed +# software to override 'system' software. +# Modifying these default path settings can be done in different ways. +# To learn more about startup files, refer to your shell's man page. + +set MSYS2_PATH /usr/local/bin /usr/bin /bin +set -x MANPATH /usr/local/man /usr/share/man /usr/man /share/man +set -x INFOPATH /usr/local/info /usr/share/info /usr/info /share/info + +if not set -q MSYS2_PATH_TYPE + set MSYS2_PATH_TYPE minimal +end + +switch $MSYS2_PATH_TYPE +case strict + # Do not inherit any path configuration, and allow for full customization + # of external path. This is supposed to be used in special cases such as + # debugging without need to change this file, but not daily usage. + set -ex ORIGINAL_PATH +case inherit + # Inherit previous path. Note that this will make all of the Windows path + # available in current shell, with possible interference in project builds. + if not set -q ORIGINAL_PATH + set -x ORIGINAL_PATH $PATH + end +case '*' + # Do not inherit any path configuration but configure a default Windows path + # suitable for normal usage with minimal external interference. + set -l PATH $MSYS2_PATH 2>/dev/null + set WIN_ROOT (cygpath -Wu) + set -x ORIGINAL_PATH $WIN_ROOT/System32 $WIN_ROOT $WIN_ROOT/System32/Wbem $WIN_ROOT/System32/WindowsPowerShell/v1.0/ +end + +set -e MINGW_MOUNT_POINT +source '/ucrt64/etc/fish/msystem.fish' +switch $MSYSTEM +case MINGW32 + set MINGW_MOUNT_POINT $MINGW_PREFIX + set -x PATH $MINGW_MOUNT_POINT/bin $MSYS2_PATH $ORIGINAL_PATH 2>/dev/null + set -x PKG_CONFIG_PATH "$MINGW_MOUNT_POINT/lib/pkgconfig:$MINGW_MOUNT_POINT/share/pkgconfig" + set ACLOCAL_PATH "$MINGW_MOUNT_POINT/share/aclocal:/usr/share/aclocal" + set -x MANPATH $MINGW_MOUNT_POINT/local/man $MINGW_MOUNT_POINT/share/man $MANPATH +case MINGW64 + set MINGW_MOUNT_POINT $MINGW_PREFIX + set -x PATH $MINGW_MOUNT_POINT/bin $MSYS2_PATH $ORIGINAL_PATH 2>/dev/null + set -x PKG_CONFIG_PATH "$MINGW_MOUNT_POINT/lib/pkgconfig:$MINGW_MOUNT_POINT/share/pkgconfig" + set ACLOCAL_PATH "$MINGW_MOUNT_POINT/share/aclocal:/usr/share/aclocal" + set -x MANPATH $MINGW_MOUNT_POINT/local/man $MINGW_MOUNT_POINT/share/man $MANPATH +case CLANG64 + set MINGW_MOUNT_POINT $MINGW_PREFIX + set -x PATH $MINGW_MOUNT_POINT/bin $MSYS2_PATH $ORIGINAL_PATH 2>/dev/null + set -x PKG_CONFIG_PATH "$MINGW_MOUNT_POINT/lib/pkgconfig:$MINGW_MOUNT_POINT/share/pkgconfig" + set ACLOCAL_PATH "$MINGW_MOUNT_POINT/share/aclocal:/usr/share/aclocal" + set -x MANPATH $MINGW_MOUNT_POINT/local/man $MINGW_MOUNT_POINT/share/man $MANPATH +case CLANGARM64 + set MINGW_MOUNT_POINT $MINGW_PREFIX + set -x PATH $MINGW_MOUNT_POINT/bin $MSYS2_PATH $ORIGINAL_PATH 2>/dev/null + set -x PKG_CONFIG_PATH "$MINGW_MOUNT_POINT/lib/pkgconfig:$MINGW_MOUNT_POINT/share/pkgconfig" + set ACLOCAL_PATH "$MINGW_MOUNT_POINT/share/aclocal:/usr/share/aclocal" + set -x MANPATH $MINGW_MOUNT_POINT/local/man $MINGW_MOUNT_POINT/share/man $MANPATH +case UCRT64 + set MINGW_MOUNT_POINT $MINGW_PREFIX + set -x PATH $MINGW_MOUNT_POINT/bin $MSYS2_PATH $ORIGINAL_PATH 2>/dev/null + set -x PKG_CONFIG_PATH "$MINGW_MOUNT_POINT/lib/pkgconfig:$MINGW_MOUNT_POINT/share/pkgconfig" + set ACLOCAL_PATH "$MINGW_MOUNT_POINT/share/aclocal:/usr/share/aclocal" + set -x MANPATH $MINGW_MOUNT_POINT/local/man $MINGW_MOUNT_POINT/share/man $MANPATH +case '*' + set -x PATH $MSYS2_PATH /opt/bin $ORIGINAL_PATH 2>/dev/null + set -x PKG_CONFIG_PATH "/usr/lib/pkgconfig:/usr/share/pkgconfig:/lib/pkgconfig" +end + +# TMP and TEMP as defined in the Windows environment must be kept +# for windows apps, even if started from msys2. However, leaving +# them set to the default Windows temporary directory or unset +# can have unexpected consequences for msys2 apps, so we define +# our own to match GNU/Linux behaviour. +# +# Note: this uppercase/lowercase workaround does not seem to work. +# In fact, it has been removed from Cygwin some years ago. See: +# +# * https://cygwin.com/git/gitweb.cgi?p=cygwin-apps/base-files.git;a=commitdiff;h=3e54b07 +# * https://cygwin.com/git/gitweb.cgi?p=cygwin-apps/base-files.git;a=commitdiff;h=7f09aef +# +if not set -q ORIGINAL_TMP + set ORIGINAL_TMP $TMP +end +if not set -q ORIGINAL_TEMP + set ORIGINAL_TEMP $TEMP +end +set -e TMP +set -e TEMP +set -x tmp (cygpath -w "$ORIGINAL_TMP" 2> /dev/null) +set -x temp (cygpath -w "$ORIGINAL_TEMP" 2> /dev/null) +set -x TMP "/tmp" +set -x TEMP "/tmp" + +# Define default printer +set p '/proc/registry/HKEY_CURRENT_USER/Software/Microsoft/Windows NT/CurrentVersion/Windows/Device' +if test -e $p + #Can't use read -d, fish too old + set PRINTER (cat $p) + set -x PRINTER (string split ',' $PRINTER)[1] +end +set -e p + +/usr/bin/hostname | read HOSTNAME +set -x HOSTNAME $HOSTNAME +source /ucrt64/etc/fish/perlbin.fish + +if set -q ACLOCAL_PATH + set -x ACLOCAL_PATH $ACLOCAL_PATH +end + +export USER PRINTER PS1 SHELL +set -e PATH_SEPARATOR diff --git a/mingw-w64-fish/msystem.fish b/mingw-w64-fish/msystem.fish new file mode 100644 index 0000000000000..4724a931c1796 --- /dev/null +++ b/mingw-w64-fish/msystem.fish @@ -0,0 +1,55 @@ +# This is a direct port of /etc/msystem. + +if test -z $MSYSTEM + set -x MSYSTEM MSYS +end + +set -e MSYSTEM_PREFIX +set -e MSYSTEM_CARCH +set -e MSYSTEM_CHOST + +set -e MINGW_CHOST +set -e MINGW_PREFIX +set -e MINGW_PACKAGE_PREFIX + +switch $MSYSTEM + case MINGW32 + set -x MSYSTEM_PREFIX '/mingw32' + set -x MSYSTEM_CARCH 'i686' + set -x MSYSTEM_CHOST 'i686-w64-mingw32' + set -x MINGW_CHOST "$MSYSTEM_CHOST" + set -x MINGW_PREFIX "$MSYSTEM_PREFIX" + set -x MINGW_PACKAGE_PREFIX "mingw-w64-$MSYSTEM_CARCH" + case MINGW64 + set -x MSYSTEM_PREFIX '/mingw64' + set -x MSYSTEM_CARCH 'x86_64' + set -x MSYSTEM_CHOST 'x86_64-w64-mingw32' + set -x MINGW_CHOST "$MSYSTEM_CHOST" + set -x MINGW_PREFIX "$MSYSTEM_PREFIX" + set -x MINGW_PACKAGE_PREFIX "mingw-w64-$MSYSTEM_CARCH" + case CLANG64 + set -x MSYSTEM_PREFIX '/clang64' + set -x MSYSTEM_CARCH 'x86_64' + set -x MSYSTEM_CHOST 'x86_64-w64-mingw32' + set -x MINGW_CHOST "$MSYSTEM_CHOST" + set -x MINGW_PREFIX "$MSYSTEM_PREFIX" + set -x MINGW_PACKAGE_PREFIX "mingw-w64-clang-$MSYSTEM_CARCH" + case CLANGARM64 + set -x MSYSTEM_PREFIX '/clangarm64' + set -x MSYSTEM_CARCH 'aarch64' + set -x MSYSTEM_CHOST 'aarch64-w64-mingw32' + set -x MINGW_CHOST "$MSYSTEM_CHOST" + set -x MINGW_PREFIX "$MSYSTEM_PREFIX" + set -x MINGW_PACKAGE_PREFIX "mingw-w64-clang-$MSYSTEM_CARCH" + case UCRT64 + set -x MSYSTEM_PREFIX '/ucrt64' + set -x MSYSTEM_CARCH 'x86_64' + set -x MSYSTEM_CHOST 'x86_64-w64-mingw32' + set -x MINGW_CHOST "$MSYSTEM_CHOST" + set -x MINGW_PREFIX "$MSYSTEM_PREFIX" + set -x MINGW_PACKAGE_PREFIX "mingw-w64-ucrt-$MSYSTEM_CARCH" + case '*' + set -x MSYSTEM_PREFIX '/usr' + set -x MSYSTEM_CARCH (/usr/bin/uname -m) + set -x MSYSTEM_CHOST (/usr/bin/uname -m)"-pc-msys" +end \ No newline at end of file diff --git a/mingw-w64-fish/perlbin.fish b/mingw-w64-fish/perlbin.fish new file mode 100644 index 0000000000000..6dd8a50e0cb60 --- /dev/null +++ b/mingw-w64-fish/perlbin.fish @@ -0,0 +1,19 @@ +# Set path to perl scriptdirs if they exist +# https://wiki.archlinux.org/index.php/Perl_Policy#Binaries_and_scripts +# Added /usr/bin/*_perl dirs for scripts +# Remove /usr/lib/perl5/*_perl/bin in next release + +function __addpath + set -l p $argv[1] + if test -d $p + set PATH $PATH $p + end +end + +__addpath /usr/bin/site_perl +__addpath /usr/lib/perl5/site_perl/bin +__addpath /usr/bin/vendor_perl +__addpath /usr/lib/perl5/vendor_perl/bin +__addpath /usr/bin/core_perl + +functions -e __addpath \ No newline at end of file