117 lines
3.5 KiB
Bash
117 lines
3.5 KiB
Bash
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
|
|
|
|
pkgname=('ruby' 'ruby-docs')
|
|
pkgver=2.4.0
|
|
pkgrel=1
|
|
arch=('i686' 'x86_64')
|
|
url='https://www.ruby-lang.org/en/'
|
|
license=('BSD' 'custom')
|
|
makedepends=('openssl-devel' 'libffi-devel' 'doxygen' 'libcrypt-devel' 'gmp-devel' 'libyaml-devel' 'libgdbm-devel' 'libiconv-devel' 'libreadline-devel' 'zlib-devel')
|
|
options=('!emptydirs' '!makeflags' 'staticlibs')
|
|
source=("https://cache.ruby-lang.org/pub/ruby/${pkgver%.*}/ruby-${pkgver//_/-}.tar.bz2"
|
|
2.4.0-cygwin-configure.patch
|
|
2.4.0-cygwin-rubygems.patch
|
|
2.4.0-cygwin-compile.patch
|
|
2.4.0-pkgconfig-version.patch
|
|
'gemrc'
|
|
'ruby-2.4.0-msys2.patch')
|
|
sha256sums=('440bbbdc49d08d3650f340dccb35986d9399177ad69a204def56e5d3954600cf'
|
|
'058aa360e7d282c7db9b5086c0678713be42d7ed6a0cf87c3eff6054ced80c05'
|
|
'01a59cbfffa98eeca6b66f2f179474793dbb6ec32063d717a24e5ca03f28d767'
|
|
'5fffe4fa469721bfe271650dae142c5a0274c22705e4be01541371d74a5de23d'
|
|
'c4953431cacabb5b3ee2cfcfa66e35435e72701514bdbdaa06d91ba7e8a70cf4'
|
|
'4bb7eb2fe66e396ed16b589cdb656831407b39ad4e138d88536754c0448ac614'
|
|
'f5387f941f3b0fbe787159db396a7147fc628cd4f95da3cc1e456ed0952830a1')
|
|
|
|
|
|
# Helper macros to help make tasks easier #
|
|
apply_patch_with_msg() {
|
|
msg2 "Applying $1"
|
|
patch -Np1 -i "${srcdir}"/$1
|
|
}
|
|
|
|
apply_patch_with_msg_p2() {
|
|
msg2 "Applying $1"
|
|
patch -Np2 -i "${srcdir}"/$1
|
|
}
|
|
|
|
|
|
del_file_exists() {
|
|
for _fname in "$@"
|
|
do
|
|
if [ -f $_fname ]; then
|
|
rm -rf $_fname
|
|
fi
|
|
done
|
|
}
|
|
# =========================================== #
|
|
|
|
|
|
prepare() {
|
|
cd ${srcdir}/ruby-${pkgver//_/-}
|
|
apply_patch_with_msg_p2 2.4.0-cygwin-configure.patch
|
|
apply_patch_with_msg_p2 2.4.0-cygwin-rubygems.patch
|
|
apply_patch_with_msg_p2 2.4.0-cygwin-compile.patch
|
|
apply_patch_with_msg 2.4.0-pkgconfig-version.patch
|
|
apply_patch_with_msg ruby-2.4.0-msys2.patch
|
|
autoreconf -fi
|
|
}
|
|
|
|
build() {
|
|
mkdir -p ${srcdir}/build-${CHOST} && cd ${srcdir}/build-${CHOST}
|
|
|
|
CFLAGS+=" -fno-strict-aliasing "
|
|
CXXFLAGS+=" -fno-strict-aliasing "
|
|
../ruby-${pkgver//_/-}/configure \
|
|
--build=${CHOST} \
|
|
--prefix=/usr \
|
|
--exec_prefix=/usr \
|
|
--sysconfdir=/etc \
|
|
--localstatedir=/var \
|
|
--sharedstatedir=/var/lib \
|
|
--libexecdir=/usr/lib/ruby \
|
|
--enable-shared \
|
|
--disable-rpath \
|
|
--with-dbm-type=gdbm_compat \
|
|
LDSHARED="gcc -shared" \
|
|
DLDFLAGS="-Wl,--export-all-symbols"
|
|
make
|
|
}
|
|
|
|
check() {
|
|
cd ruby-${pkgver//_/-}
|
|
|
|
make test
|
|
}
|
|
|
|
package_ruby() {
|
|
pkgdesc='An object-oriented language for quick and easy programming'
|
|
depends=('gcc-libs' 'libopenssl' 'libffi' 'libcrypt' 'gmp' 'libyaml' 'libgdbm' 'libiconv' 'libreadline' 'zlib')
|
|
optdepends=(#'tk: for Ruby/TK'
|
|
'ruby-docs: Ruby documentation')
|
|
provides=('rubygems' 'rake')
|
|
conflicts=('rake')
|
|
backup=('etc/gemrc')
|
|
install='ruby.install'
|
|
|
|
cd ${srcdir}/build-${CHOST}
|
|
|
|
make DESTDIR="${pkgdir}" install-nodoc
|
|
|
|
install -D -m644 ${srcdir}/gemrc "${pkgdir}/etc/gemrc"
|
|
|
|
install -D -m644 ${srcdir}/ruby-${pkgver//_/-}/COPYING "${pkgdir}/usr/share/licenses/ruby/LICENSE"
|
|
install -D -m644 ${srcdir}/ruby-${pkgver//_/-}/BSDL "${pkgdir}/usr/share/licenses/ruby/BSDL"
|
|
}
|
|
|
|
package_ruby-docs() {
|
|
pkgdesc='Documentation files for ruby'
|
|
|
|
cd ${srcdir}/build-${CHOST}
|
|
|
|
make DESTDIR="${pkgdir}" install-doc install-capi
|
|
|
|
install -D -m644 ${srcdir}/ruby-${pkgver//_/-}/COPYING "${pkgdir}/usr/share/licenses/ruby-docs/LICENSE"
|
|
install -D -m644 ${srcdir}/ruby-${pkgver//_/-}/BSDL "${pkgdir}/usr/share/licenses/ruby-docs/BSDL"
|
|
}
|