makedeb
Simple, fast, safe, compiled language for developing maintainable software
Viewing /PKGBUILD
.
Click here to go back to the Git tree for vlang-git.
# Maintainer: John Ruschmeyer <jruschme@gmail.com>
# Contributor: Logan Magee <mageelog@gmail.com>
# Contributor: Dimitris Kiziridis <ragouel at outlook dot com>
# Contributor: whoami <whoami@systemli.org>
# Contributor: Jefferson González <jgmdev@gmail.com>
# Contributor: Chloe Kudryavtsev <toast@toastin.space>
pkgname=vlang-git
pkgver=0.3.r416.gd75c62b80
pkgrel=1
pkgdesc='Simple, fast, safe, compiled language for developing maintainable software'
arch=('amd64')
url='https://vlang.io'
license=('MIT')
depends=('libc-bin')
makedepends=('git' 'libssl-dev')
provides=('vlang')
conflicts=('v' 'vlang' 'vlang-bin')
source=('vlang::git+https://github.com/vlang/v')
sha256sums=('SKIP')
pkgver() {
cd ../vlang
git fetch --unshallow || git fetch --all
# Weekly tags are considered older than semantic tags that are older than
# them, so to prevent version resolution problems we exclude weekly tags.
git describe --long --tags --exclude "weekly*" | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
prepare() {
# `v up` should be disabled, as it can break the installed package.
echo "println('v up is disabled; see the AUR page for more information.')" > 'vlang/cmd/tools/vup.v'
}
build() {
cd "${srcdir}/vlang"
# We don't require optimizations when compiling the bootstrap executable and
# -O2 actually breaks `./v self` (resulting in "cgen error:"), so we empty
# CFLAGS and LDFLAGS to ensure successful compilation.
CFLAGS="" LDFLAGS="" prod=1 make
# vpm and vdoc fail to compile with "unsupported linker option" when LDFLAGS
# is set
LDFLAGS="" ./v build-tools
}
package() {
cd "${srcdir}/vlang"
install -d "$pkgdir/usr/lib/vlang" "$pkgdir/usr/share/vlang" "$pkgdir/usr/bin"
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -Dm755 v "$pkgdir/usr/lib/vlang"
cp -a cmd "$pkgdir/usr/lib/vlang/"
cp -a examples "$pkgdir/usr/share/vlang/"
cp -a thirdparty "$pkgdir/usr/lib/vlang/"
cp -a vlib "$pkgdir/usr/lib/vlang/"
cp v.mod "$pkgdir/usr/lib/vlang/"
ln -s /usr/lib/vlang/v "$pkgdir/usr/bin/v"
touch "$pkgdir/usr/lib/vlang/cmd/tools/.disable_autorecompilation"
}