-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# Modified from https://gitlab.archlinux.org/archlinux/packaging/packages/lf/-/blob/6ffd2d8ad375a154f184b11c3d6ac8e46162c3b9/PKGBUILD | ||
|
||
_realname=lf | ||
pkgbase=mingw-w64-${_realname} | ||
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" | ||
pkgver=31 | ||
pkgrel=1 | ||
pkgdesc='A terminal file manager inspired by ranger' | ||
arch=(any) | ||
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') | ||
url='https://github.com/gokcehan/lf' | ||
license=('MIT') | ||
makedepends=('git' "${MINGW_PACKAGE_PREFIX}-go") | ||
_commit='c8163439f50d2c55453977b3c480fd858c5f3b4d' | ||
source=("$pkgname::git+$url#commit=$_commit") | ||
b2sums=('SKIP') | ||
|
||
pkgver() { | ||
cd "$pkgname" | ||
|
||
git describe --tags | sed 's/^r//' | ||
} | ||
|
||
prepare() { | ||
cd "$pkgname" | ||
|
||
# create directory for build output | ||
mkdir build | ||
|
||
# download dependencies | ||
export GOPATH="${srcdir}" | ||
go mod download | ||
} | ||
|
||
build() { | ||
cd "$pkgname" | ||
|
||
# set Go flags | ||
export CGO_CPPFLAGS="${CPPFLAGS}" | ||
export CGO_CFLAGS="${CFLAGS}" | ||
export CGO_CXXFLAGS="${CXXFLAGS}" | ||
export GOPATH="${srcdir}" | ||
|
||
go build -v \ | ||
-buildmode=pie \ | ||
-mod=readonly \ | ||
-modcacherw \ | ||
-ldflags "-compressdwarf=false \ | ||
-linkmode external \ | ||
-extldflags ${LDFLAGS} \ | ||
-X main.gVersion=$pkgver" \ | ||
-o build \ | ||
. | ||
} | ||
|
||
check() { | ||
cd "$pkgname" | ||
|
||
go test -v ./... | ||
} | ||
|
||
package() { | ||
cd "$pkgname" | ||
|
||
# binary | ||
install -vDm755 -t "$pkgdir/usr/bin" build/lf | ||
|
||
# man page | ||
install -vDm644 -t "$pkgdir/usr/share/man/man1" lf.1 | ||
|
||
# documentation | ||
install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md etc/lfrc.example | ||
|
||
# desktop file | ||
install -vDm644 -t "$pkgdir/usr/share/applications" lf.desktop | ||
|
||
# vim integration | ||
install -vDm644 -t "$pkgdir/usr/share/vim/vimfiles/syntax" etc/lf.vim | ||
install -vDm644 -t "$pkgdir/usr/share/vim/vimfiles/ftdetect" etc/lf.vim | ||
|
||
# shell integrations | ||
install -vDm644 -t "$pkgdir/etc/profile.d" etc/*.{sh,csh} | ||
install -vDm644 -t "$pkgdir/usr/share/fish/vendor_functions.d" etc/lfcd.fish | ||
|
||
# shell completions | ||
install -vDm644 etc/lf.bash "$pkgdir/usr/share/bash/bash-completion/completions/lf" | ||
install -vDm644 etc/lf.fish "$pkgdir/usr/share/fish/vendor_completions.d/lf.fish" | ||
install -vDm644 etc/lf.zsh "$pkgdir/usr/share/zsh/site-functions/_lf" | ||
|
||
# license | ||
install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE | ||
} |