Files
BMLFS/build-scripts/ruby.build
2023-06-14 16:19:05 -05:00

89 lines
3.3 KiB
Bash

#! /bin/bash
# Ruby
# Source: https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.2.tar.xz
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# DEPS
# Required: libucontext
# Recommended: NONE
# Optional: Berkeley DB, Doxygen, Graphviz, libyaml, Tk, Valgrind, and DTrace
# NOTE: Fails to compile under clang
# If optimizing with GCC:
unset LDFLAGS
export CFLAGS="-march=native -O2 "
export CFLAGS+="-fno-lto -fstack-protector-strong -fzero-call-used-regs=used "
export CXXFLAGS=$CFLAGS
#autoconf -v &&
#export CFLAGS="$CFLAGS -fno-omit-frame-pointer -fno-strict-aliasing" &&
#export CPPFLAGS="$CPPFLAGS -fno-omit-frame-pointer -fno-strict-aliasing" &&
#export LIBS="-lucontext" &&
#export INSTALL=install &&
#export ac_cv_func_isnan=yes &&
#export ac_cv_func_isinf=yes &&
# Apply patches from Chimera Linux
patch -Np1 -i ../patches/ruby-chimera/musl-fix-get_main_stack.patch
patch -Np1 -i ../patches/ruby-chimera/rubygems-avoid-platform-specific-gems.patch
patch -Np1 -i ../patches/ruby-chimera/test_insns-lower-recursion-depth.patch
./configure --prefix=/usr \
--enable-shared \
--docdir=/usr/share/doc/ruby-3.2.2 \
--disable-rpath \
--enable-shared $BUILDTURPLE &&
read -p "Compile?" && make -j2 &&
sudo -S make DESTDIR=$BUILD install &&
#unset CFLAGS CPPFLAGS LIBS INSTALL ac_cv_func_isnan ac_cv_func_isinf &&
sudo -S rm -v ${BUILD}/usr/lib/ruby/3.2.0/rubygems/ssl_certs/*/*.pem &&
sudo -S rmdir -v ${BUILD}/usr/lib/ruby/3.2.0/rubygems/ssl_certs/* &&
sudo -S mkdir -pv /BMAN/install && \
sudo -S mkdir -pv /BMAN/usr/share && \
sudo -S mv $BUILD/usr/share/doc /BMAN/usr/share/ && \
sudo -S mv $BUILD/usr/share/man /BMAN/usr/share/ && \
cd $BUILD && sudo -S mkdir -v ${BUILD}/install &&
cat > /tmp/slack-desc << "EOF"
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
ruby: ruby (Interpreted object-oriented scripting language)
ruby:
ruby: Ruby is an interpreted scripting language for quick and easy
ruby: object-oriented programming. It has many features to process text
ruby: files and to do system management tasks (as in Perl). It is simple,
ruby: straight-forward, and extensible.
ruby:
ruby: Homepage: http://www.ruby-lang.org/
ruby:
ruby:
ruby:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/ruby-3.2.2-$PSUFFIX && \
cd /BMAN && \
cat > /tmp/slack-desc << "EOF"
ruby-doc: Manuals for ruby (Interpreted object-oriented scripting language)
ruby-doc:
ruby-doc: An interpreted scripting language for quick and easy
ruby-doc: object-oriented programming.
ruby-doc:
ruby-doc: http://www.ruby-lang.org/
ruby-doc:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/ruby-3.2.2-$NOPSUFFIX && \
sudo -S rm -rf ${BUILD}/* /BMAN/*