2021-07-12 22:59:46 +00:00
|
|
|
#!/usr/bin/env -S bash ../.port_include.sh
|
2022-04-03 11:28:15 +00:00
|
|
|
port=vlang
|
2021-08-14 17:45:31 +00:00
|
|
|
version=weekly.2021.31
|
2022-04-03 11:28:15 +00:00
|
|
|
workdir="v-${version}"
|
2023-07-10 11:10:29 +00:00
|
|
|
files=(
|
2023-09-02 04:32:27 +00:00
|
|
|
"https://github.com/vlang/v/archive/${version}.tar.gz#b0daf0a2e2cb6d463710952f4d2e8705c17d02a9270355b20861ff3fd5f72563"
|
2023-07-10 11:10:29 +00:00
|
|
|
)
|
2021-07-12 22:59:46 +00:00
|
|
|
|
|
|
|
build() {
|
|
|
|
(
|
|
|
|
cd "$workdir"
|
|
|
|
make CC=gcc all # local build
|
|
|
|
./v -prod -cc "$CC" -o v2 cmd/v
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
install() {
|
|
|
|
# v requires having rw access to the srcdir to rebuild on demand
|
|
|
|
# so we just copy that into the default user's home for now.
|
|
|
|
# proper system-wide dist builds will be added in vlang later
|
|
|
|
mkdir -p "${SERENITY_INSTALL_ROOT}/home/anon/vlang"
|
|
|
|
cp -rf "$workdir"/* "${SERENITY_INSTALL_ROOT}/home/anon/vlang"
|
|
|
|
ln -fs "${SERENITY_INSTALL_ROOT}/home/anon/vlang/v2" "${SERENITY_INSTALL_ROOT}/usr/local/bin/v"
|
|
|
|
}
|