Skip to content

Instantly share code, notes, and snippets.

@xDShot
Last active September 9, 2016 15:14
Show Gist options
  • 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 <[email protected]>
# Maintainer: xDShot <[email protected]>
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