From f2973f0536feac668f291077e64a789db3f928bd Mon Sep 17 00:00:00 2001 From: Dan Vargas <10914883+dvargas46@users.noreply.github.com> Date: Fri, 30 Apr 2021 06:33:29 -0500 Subject: [PATCH] pkg(ruby-3.0.1): add ruby 3.0.1 (#242) Co-authored-by: Vargas, Dan --- packages/ruby/3.0.1/build.sh | 21 +++++++++++++++++++++ packages/ruby/3.0.1/environment | 4 ++++ packages/ruby/3.0.1/metadata.json | 5 +++++ packages/ruby/3.0.1/run | 4 ++++ packages/ruby/3.0.1/test.rb | 1 + 5 files changed, 35 insertions(+) create mode 100755 packages/ruby/3.0.1/build.sh create mode 100644 packages/ruby/3.0.1/environment create mode 100644 packages/ruby/3.0.1/metadata.json create mode 100644 packages/ruby/3.0.1/run create mode 100644 packages/ruby/3.0.1/test.rb diff --git a/packages/ruby/3.0.1/build.sh b/packages/ruby/3.0.1/build.sh new file mode 100755 index 0000000..ab6b8a0 --- /dev/null +++ b/packages/ruby/3.0.1/build.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +PREFIX=$(realpath $(dirname $0)) + +mkdir -p build +cd build + +# Download and extract ruby +curl "https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.1.tar.gz" -o ruby.tar.gz +tar xzf ruby.tar.gz --strip-components=1 +rm ruby.tar.gz + +# Autoconf based +./configure --prefix "$PREFIX" +make -j$(nproc) +make install -j$(nproc) + +# Cleanup +cd .. +rm -rf build + diff --git a/packages/ruby/3.0.1/environment b/packages/ruby/3.0.1/environment new file mode 100644 index 0000000..118cf33 --- /dev/null +++ b/packages/ruby/3.0.1/environment @@ -0,0 +1,4 @@ +#!/bin/bash + +# Path to ruby binary +export PATH=$PWD/bin:$PATH diff --git a/packages/ruby/3.0.1/metadata.json b/packages/ruby/3.0.1/metadata.json new file mode 100644 index 0000000..283cf71 --- /dev/null +++ b/packages/ruby/3.0.1/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "ruby", + "version": "3.0.1", + "aliases": ["ruby3", "rb"] +} diff --git a/packages/ruby/3.0.1/run b/packages/ruby/3.0.1/run new file mode 100644 index 0000000..55cca9c --- /dev/null +++ b/packages/ruby/3.0.1/run @@ -0,0 +1,4 @@ +#!/bin/bash + +# Run ruby script with args +ruby "$@" diff --git a/packages/ruby/3.0.1/test.rb b/packages/ruby/3.0.1/test.rb new file mode 100644 index 0000000..eb08579 --- /dev/null +++ b/packages/ruby/3.0.1/test.rb @@ -0,0 +1 @@ +puts("OK")