Skip to content

Instantly share code, notes, and snippets.

@xDShot
Last active September 9, 2016 15:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xDShot/8f1e3b03c41f666c0efee4fb3aa9ac89 to your computer and use it in GitHub Desktop.
Save xDShot/8f1e3b03c41f666c0efee4fb3aa9ac89 to your computer and use it in GitHub Desktop.
Updated PKGBUILD for the 'micro' package on the AUR. Makefile is completely broken, so we are going in 'hard way'. What a shame.
# Maintainer: Youngbin Han <sukso96100@gmail.com>
# Maintainer: xDShot <xdshot9000@gmail.com>
pkgname=micro
pkgver=1.0.3
pkgrel=1
pkgdesc="A modern and intuitive terminal-based text editor"
arch=('x86_64' 'i686')
url="https://github.com/zyedidia/micro"
license=('MIT')
makedepends=('go')
optdepends=(xclip)
conflicts=("micro-git")
source=("https://github.com/zyedidia/micro/archive/v$pkgver.tar.gz")
sha256sums=('dc9a693d9eedbbf5a0048a092172a56de6b2b608f7d1419274c12416a840876d')
prepare(){
cd "${srcdir}/${pkgname}-${pkgver}"
export GOPATH=`pwd`
msg2 "Building the runtime"
go get -u github.com/jteeuwen/go-bindata/...
$GOPATH/bin/go-bindata -nometadata -o runtime.go runtime/...
mv runtime.go cmd/micro
msg2 "Checking for dependencies"
go get -d ./cmd/micro
msg2 "Updating tcell"
git -C $GOPATH/src/github.com/zyedidia/tcell pull
}
build(){
export DATE=$go run tools/build-date.go)
cd "${srcdir}/${pkgname}-${pkgver}"
export GOPATH=`pwd`
msg2 "Building micro after building the runtime and checking dependencies"
go build -ldflags "-X main.Version=v$pkgver -X 'main.CompileDate=$DATE'" -o micro ./cmd/micro
}
package(){
install -Dm755 "${srcdir}/${pkgname}-${pkgver}/micro" "${pkgdir}/usr/bin/micro"
install -Dm644 "${srcdir}/${pkgname}-${pkgver}/LICENSE" "${pkgdir}/usr/share/licenses/$pkgname/LICENSE"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment