Skip to content

Instantly share code, notes, and snippets.

@hanetzer
Created November 20, 2014 21:53
Show Gist options
  • Save hanetzer/52423fb0691de108b093 to your computer and use it in GitHub Desktop.
Save hanetzer/52423fb0691de108b093 to your computer and use it in GitHub Desktop.
mingw-w64-ruby
pkgname=mingw-w64-ruby
pkgver=2.1.5
pkgrel=1
pkgdesc="An object-oriented language for quick and easy programming (mingw-w64)"
arch=(any)
url="http://www.ruby-lang.org/en"
license=("BSD, custom")
makedepends=(mingw-w64-gcc mingw-w64-pkg-config ruby mingw-w64-configure)
depends=(mingw-w64-crt mingw-w64-libyaml mingw-w64-db mingw-w64-openssl mingw-w64-gdbm mingw-w64-tk mingw-w64-pdcurses mingw-w64-libffi)
options=(staticlibs !strip !buildflags)
source=("http://cache.ruby-lang.org/pub/ruby/2.1/ruby-${pkgver}.tar.gz"
"ruby_5681.patch")
md5sums=('df4c1b23f624a50513c7a78cb51a13dc'
'c64ab6ca70d151c23d0b420a2d9a0063')
_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
prepare() {
cd "${srcdir}/ruby-${pkgver}"
patch -Np1 -i "${srcdir}/ruby_5681.patch"
}
build() {
for _arch in ${_architectures}; do
CFLAGS="$(${_arch}-pkg-config --cflags libffi) -DHAVE_TYPE_NET_LUID"
unset LDFLAGS
if [ ${_arch} = "i686-w64-mingw32" ]; then
disabled_exts="readline,sdbm"
else
disabled_exts="fiddle,readline,sdbm"
fi
mkdir -p "${srcdir}/ruby-${pkgver}/build-${_arch}"
cd "${srcdir}/ruby-${pkgver}/build-${_arch}"
../configure \
--host=${_arch} \
--target=${_arch} \
--build="$CHOST" \
--prefix=/usr/${_arch} \
--enable-shared \
--enable-static \
--disable-install-doc \
--disable-install-rdoc \
--disable-install-capi \
--with-out-ext=${disabled_exts} \
--disable-ipv6 \
--with-static-linked-ext \
--with-tcl-dir=/usr/${_arch} \
--with-tk-dir=/usr/${_arch}
make
done
}
package() {
for _arch in ${_architectures}; do
cd "${srcdir}/ruby-${pkgver}/build-${_arch}"
make DESTDIR="$pkgdir" install
find "$pkgdir/usr/${_arch}" -name '*.a' -o -name '*.dll' -o -name '*.so' | xargs -rtl1 ${_arch}-strip -g
find "$pkgdir/usr/${_arch}" -name '*.dll' -o -name '*.so' | xargs -rtl1 ${_arch}-strip --strip-unneeded
find "$pkgdir/usr/${_arch}" -name '*.exe' -o -name '*.bat' | xargs -rtl1 rm
rm -r "$pkgdir/usr/${_arch}/share"
done
}
--- a/ext/socket/option.c
+++ b/ext/socket/option.c
@@ -623,7 +623,7 @@ inspect_timeval_as_interval(int level, int optname, VALUE data, VALUE ret)
* it is not distinguishable by the size.
*/
-#ifndef HAVE_INET_NTOP
+#if !defined(HAVE_INET_NTOP) && !defined(_WIN32)
static const char *
inet_ntop(int af, const void *addr, char *numaddr, size_t numaddr_len)
{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment