From a2183c8dbea015c303011bcb3dc3098c17ce3c0a Mon Sep 17 00:00:00 2001 From: Alvaro Figueroa Date: Tue, 8 Oct 2024 19:48:42 -0600 Subject: [PATCH 1/3] Adding riscv64-native recipe --- recipes/riscv64-native/Dockerfile | 33 ++++++++++++++++++++++++++++ recipes/riscv64-native/run.sh | 36 +++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 recipes/riscv64-native/Dockerfile create mode 100755 recipes/riscv64-native/run.sh diff --git a/recipes/riscv64-native/Dockerfile b/recipes/riscv64-native/Dockerfile new file mode 100644 index 0000000..a3dae01 --- /dev/null +++ b/recipes/riscv64-native/Dockerfile @@ -0,0 +1,33 @@ +FROM ubuntu:20.04 + +ARG GID=1000 +ARG UID=1000 + +RUN addgroup --gid $GID node \ + && adduser --gid $GID --uid $UID --disabled-password --gecos node node + +RUN apt-get update \ + && apt-get dist-upgrade -y \ + && apt-get install -y software-properties-common \ + && add-apt-repository -y ppa:ubuntu-toolchain-r/test \ + && apt-get update \ + && apt-get install -y \ + git \ + g++-9 \ + curl \ + make \ + python3 \ + python3-distutils \ + ccache \ + xz-utils \ + build-essential + +COPY --chown=node:node run.sh /home/node/run.sh + +VOLUME /home/node/.ccache +VOLUME /out +VOLUME /home/node/node.tar.xz + +USER node + +ENTRYPOINT [ "/home/node/run.sh" ] diff --git a/recipes/riscv64-native/run.sh b/recipes/riscv64-native/run.sh new file mode 100755 index 0000000..52215d5 --- /dev/null +++ b/recipes/riscv64-native/run.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +set -e +set -x + +release_urlbase="$1" +disttype="$2" +customtag="$3" +datestring="$4" +commit="$5" +fullversion="$6" +source_url="$7" +config_flags="--openssl-no-asm" + +cd /home/node + +tar -xf node.tar.xz +cd "node-${fullversion}" + +export CC="ccache" +export CXX="ccache" + +make -j$(getconf _NPROCESSORS_ONLN) binary V= \ + DESTCPU="riscv64" \ + ARCH="riscv64" \ + VARIATION="" \ + DISTTYPE="$disttype" \ + CUSTOMTAG="$customtag" \ + DATESTRING="$datestring" \ + COMMIT="$commit" \ + RELEASE_URLBASE="$release_urlbase" \ + CONFIG_FLAGS="$config_flags" + +# If removal of ICU is desired, add "BUILD_INTL_FLAGS=--with-intl=none" above + +mv node-*.tar.?z /out/ From bd1f3cdd8aaa94e2e0d845fa401df5b5826099ee Mon Sep 17 00:00:00 2001 From: Alvaro Figueroa Date: Tue, 8 Oct 2024 19:51:55 -0600 Subject: [PATCH 2/3] Adding riscv64-native recipe, missing should-build.sh --- recipes/riscv64-native/should-build.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 recipes/riscv64-native/should-build.sh diff --git a/recipes/riscv64-native/should-build.sh b/recipes/riscv64-native/should-build.sh new file mode 100755 index 0000000..9ba2bb7 --- /dev/null +++ b/recipes/riscv64-native/should-build.sh @@ -0,0 +1,10 @@ +#!/bin/bash -xe + +__dirname=$1 +fullversion=$2 + +. ${__dirname}/_decode_version.sh + +decode "$fullversion" + +test "$major" -ge "17" && test "$major" -lt "22" From 9df59d5414b308d3dc8e0b464ac5e4bc6ae2e038 Mon Sep 17 00:00:00 2001 From: Alvaro Figueroa Date: Tue, 8 Oct 2024 20:46:09 -0600 Subject: [PATCH 3/3] Adding riscv64-native to _config.sh --- bin/_config.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/_config.sh b/bin/_config.sh index 346d402..c5439d2 100644 --- a/bin/_config.sh +++ b/bin/_config.sh @@ -8,6 +8,7 @@ recipes=( "x64-pointer-compression" "x64-usdt" "riscv64" + "riscv64-native" "loong64" "x64-debug" )