-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathPKGBUILD
85 lines (71 loc) · 2.4 KB
/
PKGBUILD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
_realname=ruby
pkgbase=mingw-w64-ruby-head
pkgname="${MINGW_PACKAGE_PREFIX}-ruby-head"
pkgver=r20191105
pkgver() {
echo r`date +%Y%m%d`
}
pkgrel=1
pkgdesc="An object-oriented language for quick and easy programming (mingw-w64)"
arch=('any')
url="https://www.ruby-lang.org/en"
license=("BSD, custom")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "${MINGW_PACKAGE_PREFIX}-pkg-config")
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
"${MINGW_PACKAGE_PREFIX}-gdbm>=1.17"
"${MINGW_PACKAGE_PREFIX}-gmp"
"${MINGW_PACKAGE_PREFIX}-libffi"
"${MINGW_PACKAGE_PREFIX}-libyaml"
"${MINGW_PACKAGE_PREFIX}-openssl>=1.1.1"
"${MINGW_PACKAGE_PREFIX}-zlib")
options=('staticlibs' 'strip')
source=("https://cache.ruby-lang.org/pub/ruby/snapshot.tar.xz"
ruby.ico
rubyw.ico)
noextract=("snapshot.tar.xz")
# To update SHA256 hashs run: ridk exec sh -c "updpkgsums PKGBUILD"
# and set first entry to 'SKIP'
sha256sums=('SKIP'
'6c80ba2ca49840e387a08b7fedc6e7acd298ac2ec853155209efb2af20397b22'
'c30fb04ac0e88ba634daaa811a81ea5a75027646617b895acd14df9518a4a55a')
prepare() {
bsdtar -xf snapshot.tar.xz || true
cd ${srcdir}/snapshot
autoreconf -fi
}
build() {
CPPFLAGS+=" -DFD_SETSIZE=2048"
CFLAGS="-O3 -fno-fast-math -fstack-protector-strong"
LDFLAGS="-pipe -s -fstack-protector-strong"
[[ -d "${srcdir}/build-${MINGW_CHOST}" ]] && rm -rf "${srcdir}/build-${MINGW_CHOST}"
mkdir -p "${srcdir}/build-${MINGW_CHOST}" && cd "${srcdir}/build-${MINGW_CHOST}"
cp ${srcdir}/*.ico .
../snapshot/configure \
--prefix=${MINGW_PREFIX} \
--build=${MINGW_CHOST} \
--host=${MINGW_CHOST} \
--target=${MINGW_CHOST} \
--with-out-ext=readline,pty,syslog
make showflags main
echo "Generate HTML documentation"
# Make rdoc outputs so many lines -> print dots only
make html 2>&1 | ./miniruby -ne "STDERR.print '.'"
}
check() {
cd "${srcdir}/build-${MINGW_CHOST}"
echo $PATH
make -l "TESTOPTS=-q" btest test-basic
# TODO: Full tests fail currently
# make -l "TESTOPTS=-q" test-all || true
}
package() {
cd "${srcdir}/build-${MINGW_CHOST}"
make -f GNUMakefile DESTDIR="${pkgdir}" install-nodoc
for script in {erb,gem,irb,rdoc,ri}; do
install ${srcdir}/snapshot/bin/${script} \
${pkgdir}${MINGW_PREFIX}/bin/
done
mkdir -p ${pkgdir}${MINGW_PREFIX}/share/doc/ruby/
cp -r .ext/html \
${pkgdir}${MINGW_PREFIX}/share/doc/ruby/
}