~comcloudway/ccw-aports

4197ed59d453583726bc238a7fbf6a6eada7c866 — Jakob Meier 1 year, 26 days ago b078182
testing/vlang: moved to upstream alpine aports/testing
3 files changed, 0 insertions(+), 91 deletions(-)

D testing/vlang/APKBUILD
D testing/vlang/explicit_cast.patch
D testing/vlang/fix-tools.patch
D testing/vlang/APKBUILD => testing/vlang/APKBUILD +0 -69
@@ 1,69 0,0 @@
# Contributor: Jakob Meier <comcloudway@ccw.icu>
# Maintainer: Jakob Meier <comcloudway@ccw.icu>

_vc_commit_sha=63e76fdbcc57a16ff7af10274ad916b4c4141220

pkgname=vlang
pkgver=0.4
pkgrel=0
pkgdesc="Simple, fast, safe, compiled language for developing maintainable software."
url="https://vlang.io"
arch="x86_64 aarch64"
license="MIT"
makedepends="gcc gc-dev libx11-dev"
case "$CARCH" in
	aarch64) _arch="arm64" ;;
	x86_64) _arch="amd64" ;;
esac
source="
v-$pkgver.tar.gz::https://github.com/vlang/v/archive/refs/tags/$pkgver.tar.gz
vc-$pkgver.zip::https://github.com/vlang/vc/archive/$_vc_commit_sha.zip
fix-tools.patch
"
builddir="$srcdir/v-$pkgver"
options="net"

build() {
	mv "../vc-$_vc_commit_sha" ./vc

	# cannot rely on prebuild tcc libgc.a
	# needs gc-dev
	mkdir -p thirdparty/tcc/lib
	ln -s /usr/lib/libgc.a thirdparty/tcc/lib/libgc.a

	gcc -std=gnu11 -w -o v1 vc/v.c -lm -lpthread #-lexecinfo
	./v1 -no-parallel -o v2 -prod cmd/v
	./v2 -o v -prod cmd/v
	rm -rf v1 v2

	./v run ./cmd/tools/detect_tcc.v

	VEXE=$builddir/v ./v build-tools
}

check() {
	# tests take ages
	# also some of them seem quite useless
	# and others fail
	# make check
	./v self
}

package() {
	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
}
sha512sums="
668ec724620b1c8f31668d51eee41d44a75e02a86656ecf42ac7deff544b3fc7426284b522d25925e2a503a1041f7c1ad197abe6160b86133f667a585fb10a47  v-0.4.tar.gz
190fa1d276096d298a80d37b6cffae643a10102a40138309ea5b99f424ec40fba998c130c2bd2ec200ddfd31322e605131b92b7761ee4a6ff37bfa2fbc25bfa5  vc-0.4.zip
4145172913432edc26a0e36a992b1aebaa1925395d4bc8fb2c44a27df1e097946c4f6d32dfd5e20a94c7511da4ccdcb5e03515938268b0d20ccee31e69bdabe8  fix-tools.patch
"

D testing/vlang/explicit_cast.patch => testing/vlang/explicit_cast.patch +0 -11
@@ 1,11 0,0 @@
--- ./vlib/rand/constants/constants.v.old
+++ ./vlib/rand/constants/constants.v
@@ -3,7 +3,7 @@
 // Commonly used constants across RNGs - some taken from "Numerical Recipes".
 pub const (
 	lower_mask     = u64(0x00000000FFFFFFFF)
-	max_u32        = 0xFFFFFFFF
+	max_u32        = u32(0xFFFFFFFF)
 	max_u64        = u64(0xFFFFFFFFFFFFFFFF)
 	max_u32_as_f32 = f32(max_u32) + 1
 	max_u64_as_f64 = f64(max_u64) + 1

D testing/vlang/fix-tools.patch => testing/vlang/fix-tools.patch +0 -11
@@ 1,11 0,0 @@
--- a/cmd/tools/vbuild-tools.v
+++ b/cmd/tools/vbuild-tools.v
@@ -16,7 +16,7 @@
 // non_packaged_tools are tools that should not be packaged with
 // prebuild versions of V, to keep the size smaller.
 // They are mainly usefull for the V project itself, not to end users.
-const non_packaged_tools = ['gen1m', 'gen_vc', 'fast', 'wyhash']
+const non_packaged_tools = ['gen1m', 'gen_vc', 'fast', 'wyhash', 'v']
 
 fn main() {
 	util.ensure_modules_for_all_tools_are_installed('-v' in os.args)