Canop / broot

A new way to see and navigate directory trees : https://dystroy.org/broot
MIT License
10.48k stars 228 forks source link

Trouble installing on MSYS2/MINGW64 #99

Open runvnc opened 4 years ago

runvnc commented 4 years ago

Hello so I have a cargo install on my Windows computer and it seems like it works under MSYS2 Mingw64 but after running my Mingw64 terminal under Administrator and then trying broot and telling it to complete the br part it says this:

*runvnc@DESKTOP-O0LSE3G MINGW64 ~
# broot

Broot should be launched using a shell function (see https://github.com/Canop/broot for explanations).
The function is either missing, old or badly installed.
Can I install it now? [Y n]
Y
Removing C:\Users\runvnc\AppData\Roaming\dystroy\broot\data\launcher\bash\1.
Writing br shell function in C:\Users\runvnc\AppData\Roaming\dystroy\broot\data\launcher\bash\1.
Creating link from C:\Users\runvnc\AppData\Roaming\dystroy\broot\config\launcher\bash\br to C:\Users\runvnc\AppData\Roaming\dystroy\broot\data\launcher\bash\1.

I found neither .bashrc nor .zshrc.
If you're using bash or zsh, then installation isn't complete:
the br function initialization script won't be sourced unless you source it yourself.

So it looks like I need to manually figure out how to source the "br function initialization" and then add that to my .bashrc myself. So I think that means source the 'br' script but I am not sure.

runvnc commented 4 years ago

Well I sourced the br script, it is giving the same message when I run it as br. I think that maybe for my configuration or just in general this isn't set up to work with Mingw.

Canop commented 4 years ago

@runvnc I suspect this is the same problem than https://github.com/Canop/broot/issues/98 at the root

but my knowledge of cygwin is very (very) limited.

FrancescElies commented 10 months ago

Not sure if this is an option for you but broot works well under windows with nushell (which comes with many gnu coreutils integrated), it looks like there are more people happy with that setup see #460.

AeliusSaionji commented 1 month ago

I have written a PKGBUILD for compiling and distributing under msys2, but I haven't submitted it upstream at the time of writing.

# aelius
_pkgname=broot
pkgbase="mingw-w64-${_pkgname}"
pkgname=("${MINGW_PACKAGE_PREFIX}-${_pkgname}")
pkgver=1.39.1
pkgrel=1
pkgdesc='Fuzzy Search + tree + cd; a better way to navigate directories'
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
url='https://dystroy.org/broot/'
license=('MIT')
makedepends=("${MINGW_PACKAGE_PREFIX}-rust")
source=("https://github.com/Canop/broot/archive/v$pkgver/$_pkgname-v$pkgver.tar.gz")
sha256sums=('b186eaa995a50ef36f0d166104350e4f5c1a0b74cbe7ef101eb16b68fb028cdf')
# options=('')
conflicts=("${MINGW_PACKAGE_PREFIX}-${_pkgname}-git")

build() {
  cd $_pkgname-$pkgver
  cargo build --release --locked #--frozen
}

package() {
  cd $_pkgname-$pkgver
  install -Dt "${pkgdir}${MINGW_PREFIX}/bin" "target/release/$_pkgname"
  sed -i "s/#version/$pkgver/" man/page
  # Theoretically we could get the date from the CHANGELOG.md but it seems that the
  # CHANGELOG.md entry for the current version isn't actually in the current release.
  # changelog_date=$(sed -n "s/.*v$pkgver - \(.*\)$/\1/p" CHANGELOG.md)
  sed -i "s/#date//" man/page
  install -Dm644 man/page "${pkgdir}${MINGW_PREFIX}/share/man/man1/$_pkgname.1"
  install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/$_pkgname/LICENSE"
  install -Dm644 resources/icons/vscode/vscode.ttf "${pkgdir}${MINGW_PREFIX}/share/fonts/TTF/vscode.ttf"
}