diff --git a/dev-lang/v/v-9999.ebuild b/dev-lang/v/v-9999.ebuild new file mode 100644 index 0000000..ade83d6 --- /dev/null +++ b/dev-lang/v/v-9999.ebuild @@ -0,0 +1,63 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit toolchain-funcs + +# download once per week +WEEK=$(printf "%(%Y-week-%W)T") + +DESCRIPTION="Simple, fast, safe, compiled. For developing maintainable software." +HOMEPAGE="https://vlang.io" +SRC_URI=" + https://github.com/vlang/v/archive/master.tar.gz -> v-${WEEK}.tar.gz + https://github.com/vlang/vc/archive/master.tar.gz -> vc-${WEEK}.tar.gz +" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~arm64" + +# FIXME v build-tools pulls a number of modules +RESTRICT="network-sandbox" + +S="${WORKDIR}/v-master" + +src_compile() { + CC=$(tc-getCC) + + # bootstrap the compiler using its C translation and then rebuild from V + ${CC} ${CFLAGS} -g -std=gnu11 -o v ${WORKDIR}/vc-master/v.c ${LDFLAGS} -lm -lpthread || die + ./v -prod self || die + + # build tools + ./v build-tools || die + + # tell V it is managed by a package manager + touch cmd/tools/.disable_autorecompilation +} + +src_install() { + # compiler entry point + exeinto /usr/lib/vlang + doexe v + dosym /usr/lib/vlang/v /usr/bin/v + + # v subcommands + exeinto /usr/lib/vlang/cmd/tools + doexe cmd/tools/{check_os_api_parity,fast_job,map_fuzz,missdoc,oldv,performance_compare,repeat,test_if_v_test_system_works,test_os_process,vbin2v,vbuild-examples,vbuild-tools,vbuild-vbinaries,vcheck-md,vcomplete,vcreate,vfmt,vpm,vrepl,vself,vsetup-freetype,vsymlink,vtest,vtest-all,vtest-cleancode,vtest-fmt,vtest-parser,vtest-self,vtracev,vup,vwipe-cache} + + # standard library + insinto /usr/lib/vlang + doins -r vlib + + # docs + insinto /usr/lib/vlang/cmd/v + doins -r cmd/v/help + + insinto /usr/share/vlang + doins -r examples + dodoc -r doc + einstalldocs +}