tools/vlang/PKGBUILD

70 lines
2.3 KiB
Bash
Raw Permalink Normal View History

2023-02-13 12:20:09 +01:00
# Maintainer: Jef Roosens
# Contributor: Logan Magee <mageelog@gmail.com>
#https://github.com/vlang/v/commit/5d4c9dc9fc11bf8648541c934adb64f27cb94e37
_v_commit_sha=5d4c9dc9fc11bf8648541c934adb64f27cb94e37
# https://github.com/vlang/vc/commit/7919b47d852650ca09e51a1f44cab0faa3a973eb
_vc_commit_sha=7919b47d852650ca09e51a1f44cab0faa3a973eb
2023-02-13 12:20:09 +01:00
pkgname=vieter-vlang
pkgver=5d4c9dc9
2023-02-13 12:20:09 +01:00
pkgrel=1
epoch=2
2023-02-13 12:20:09 +01:00
pkgdesc='Locked Vlang version used to develop Vieter'
arch=('x86_64' 'aarch64')
url='https://vlang.io'
license=('MIT')
depends=('glibc' 'libx11')
2023-02-13 12:20:09 +01:00
optdepends=('glfw: Needed for graphics support'
'freetype2: Needed for graphics support'
'openssl: Needed for http support')
makedepends=('git')
conflicts=('v' 'vlang')
source=("${pkgname}-${_v_commit_sha}.zip::https://github.com/vlang/v/archive/${_v_commit_sha}.zip"
"${pkgname}-vc-${_vc_commit_sha}.zip::https://github.com/vlang/vc/archive/${_vc_commit_sha}.zip")
2023-02-19 15:03:22 +01:00
b2sums=('4909852387c514146d649c79d6c936e2320d50efe195e79b28fdeee7336c2fd3add3871690bfccc157a1ef5429e262f0e408342b03111920cee603edc010a8d9'
'c23b544454a295e0edd9064a0ec5813a35b0379adfe77c8b07449441c948c6ba64013612ae4f98e9bedf0b2f0f99ed16afc80da09429bc47e172144e0e50f9d2')
pkgver() {
echo "${_v_commit_sha}" | cut -c -8
}
2023-02-13 12:20:09 +01:00
prepare() {
# In case the previous directory still exists
rm -rf "v-${_v_commit_sha}/vc"
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