vlang/PKGBUILD

61 lines
2.0 KiB
Bash

# Maintainer: Jef Roosens
# Contributor: Logan Magee <mageelog@gmail.com>
# Commit hashes of 0.3 release in v & vc repositories
_v_commit_sha=ec758604538c00cceb142d324609a241e665f7c7
_vc_commit_sha=5dc8384638f515a098f75296fa7123c5e6a4964a
pkgname=vlang
pkgver=0.3.0
pkgrel=1
pkgdesc='Simple, fast, safe, compiled language for developing maintainable software'
arch=('x86_64' 'aarch64')
url='https://vlang.io'
license=('MIT')
depends=('glibc')
optdepends=('glfw: Needed for graphics support'
'freetype2: Needed for graphics support'
'openssl: Needed for http support')
makedepends=('git')
conflicts=('v' 'vlang-bin' 'vlang-git')
source=("v-${_v_commit_sha}.zip::https://github.com/vlang/v/archive/${_v_commit_sha}.zip"
"vc-${_vc_commit_sha}.zip::https://github.com/vlang/vc/archive/${_vc_commit_sha}.zip")
sha256sums=('46e4a7893c475ab17bf7b1e596bd2be2608169b8a3d74b2910f12a1ed8a32d4a'
'570e64a76c848b8575ec286b9b23d788a97dc4d23ba029cba5e987bbcce41a6b')
prepare() {
mv "vc-${_vc_commit_sha}" "v-${_v_commit_sha}/vc"
# We have to set local=1 because we manually download a specific vc
# version. This flag also disables downloading tcc, so we do that
# beforehand.
make -C "v-${_v_commit_sha}" fresh_tcc
}
build() {
cd "v-${_v_commit_sha}"
CFLAGS="" LDFLAGS="" make prod=1 local=1
# Compile all tools
LDFLAGS='' ./v build-tools
}
package() {
cd "v-${_v_commit_sha}"
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"
}
# vim: ft=bash