From eb7b7559373767996a80e48e20c58e08fe251c98 Mon Sep 17 00:00:00 2001 From: pancake Date: Tue, 13 Jul 2021 00:59:46 +0200 Subject: [PATCH] Ports: Add vlang weekly.2021.28 package --- Ports/AvailablePorts.md | 1 + Ports/vlang/package.sh | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100755 Ports/vlang/package.sh diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md index 504754d0a23..29b91a4fb8c 100644 --- a/Ports/AvailablePorts.md +++ b/Ports/AvailablePorts.md @@ -118,6 +118,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^ | [`quake`](quake/) | Quake | 0.65 | https://github.com/SerenityOS/SerenityQuake | | [`quake2`](quake2/) | QuakeII | 0.1 | https://github.com/SerenityOS/SerenityQuakeII | | [`r0`](r0/) | r0 (minimalistic commandline hexadecimal editor) | 0.8 | https://github.com/radareorg/r0 | +| [`vlang`](vlang/) | V programming language | weekly.2021.28 | https://github.com/vlang/v | | [`radare2`](radare2/) | radare2 reverse engineering framework | 5.4.0-git | https://github.com/radareorg/radare2 | | [`readline`](readline/) | GNU Readline Library | 8.1 | https://tiswww.case.edu/php/chet/readline/rltop.html | | [`rsync`](rsync/) | rsync | 3.1.3 | https://rsync.samba.org/ | diff --git a/Ports/vlang/package.sh b/Ports/vlang/package.sh new file mode 100755 index 00000000000..08f5cfd60af --- /dev/null +++ b/Ports/vlang/package.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env -S bash ../.port_include.sh +port=v +auth_type=sha256 +version=weekly.2021.28 +files="https://codeload.github.com/vlang/v/tar.gz/refs/tags/$version v-$version.tar.gz a6a28e5a7984439d20e8cc31a01984ced065da9d7bd9ccc1a171f94ca2a06c68" + +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" +}