Serenity Operating System
1#!/usr/bin/env -S bash ../.port_include.sh
2
3source version.sh
4
5export PATH="${SERENITY_SOURCE_DIR}/Toolchain/Local/ruby/bin:${PATH}"
6
7port=ruby
8version=${RUBY_VERSION}
9useconfigure="true"
10use_fresh_config_sub=true
11config_sub_paths=("tool/config.sub")
12files="${RUBY_ARCHIVE_URL} ${RUBY_ARCHIVE} ${RUBY_ARCHIVE_SHA256SUM}
13https://cache.ruby-lang.org/pub/misc/logo/ruby-logo-kit.zip ruby-logo-kit.zip 7f0a980e09874d35d80b958949dc2460e683957de3d2494a1499aea9d9989055"
14auth_type="sha256"
15launcher_name="Ruby IRB"
16launcher_category="Development"
17launcher_command="/usr/local/bin/ruby /usr/local/bin/irb --legacy"
18launcher_run_in_terminal="true"
19icon_file="../ruby-kit/ruby.png"
20
21configopts=(
22 "--disable-install-doc"
23)
24
25case "${SERENITY_ARCH}" in
26 x86_64)
27 configopts+=("--with-coroutine=amd64")
28 ;;
29 *)
30 echo "Error: Architecture ${SERENITY_ARCH} is not supported for this port"
31 exit 1
32esac
33
34export CFLAGS="-DNGROUPS_MAX=65536"
35
36# Note: The showproperty command is used when linting ports, we don't actually need ruby at this time.
37if [ "$1" != "showproperty" ]; then
38 if [ -x "$(command -v ruby)" ]; then
39 # Check if major and minor version of ruby are matching
40 if [ $(ruby --version | awk {'printf $2'} | awk -Fp {'print $1'}) != "$RUBY_VERSION" ]; then
41 echo "Error: ruby version does not match needed version to build ${RUBY_VERSION}" >&2
42 echo "Build this ruby version on your host using Toolchain/BuildRuby.sh or install it otherwise and try again." >&2
43 exit 1
44 fi
45 else
46 echo "Error: ruby is not installed but is required to build ${RUBY_VERSION}" >&2
47 echo "Build this ruby version on your host using Toolchain/BuildRuby.sh or install it otherwise and try again." >&2
48 exit 1
49 fi
50fi