mruby: update to 2.1.2
No longer needs bison because y.tab.c is shipped. Now builds with gcc also for i686*; clang host dependency removed.
This commit is contained in:
parent
eb4df88ac6
commit
440ab62378
|
@ -1,39 +1,31 @@
|
|||
# Template file for 'mruby'
|
||||
pkgname=mruby
|
||||
version=2.1.0
|
||||
revision=2
|
||||
hostmakedepends="bison clang ruby"
|
||||
version=2.1.2
|
||||
revision=1
|
||||
hostmakedepends="ruby"
|
||||
short_desc="Lightweight implementation of the Ruby language (Ruby 1.9)"
|
||||
maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
|
||||
license="MIT"
|
||||
homepage="https://mruby.org/"
|
||||
distfiles="https://github.com/mruby/mruby/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
|
||||
checksum=d6733742a07e553c52ab71df08b0604b3b571768bbc0c2729fbf0389d1bb5d13
|
||||
checksum=4dc0017e36d15e81dc85953afb2a643ba2571574748db0d8ede002cefbba053b
|
||||
lib32disabled=yes
|
||||
# I cannot get clang to link a PIE executable
|
||||
nopie=yes
|
||||
|
||||
# Note: we use clang to build for the host because with gcc the build fails
|
||||
# for i686 (native) and also when i686 is the host architecture for cross builds.
|
||||
LIBS="m"
|
||||
|
||||
do_configure() {
|
||||
vsed -i mrbgems/mruby-compiler/core/parse.y -e "s;%pure-parser;%define api.pure;"
|
||||
|
||||
if [ -z "$CROSS_BUILD" ]; then
|
||||
# Native build
|
||||
cat <<-EOF > xbps_config.rb
|
||||
MRuby::Build.new do |conf|
|
||||
toolchain :clang
|
||||
toolchain :gcc
|
||||
conf.gem "#{root}/mrbgems/mruby-bin-mruby"
|
||||
conf.gem "#{root}/mrbgems/mruby-bin-mrbc"
|
||||
conf.cc do |cc|
|
||||
cc.command = 'clang'
|
||||
cc.command = 'gcc'
|
||||
cc.flags = [ENV['CFLAGS'] || %w()]
|
||||
cc.include_paths = ["#{root}/include"]
|
||||
end
|
||||
conf.linker do |linker|
|
||||
linker.command = 'clang'
|
||||
linker.command = 'gcc'
|
||||
linker.flags = [ENV['LDFLAGS'] || %w()]
|
||||
linker.libraries = [ENV['LIBS'] || 'm']
|
||||
end
|
||||
|
@ -46,16 +38,16 @@ do_configure() {
|
|||
# Cross build
|
||||
cat <<-EOF > xbps_config.rb
|
||||
MRuby::Build.new do |conf|
|
||||
toolchain :clang
|
||||
toolchain :gcc
|
||||
conf.gem "#{root}/mrbgems/mruby-bin-mruby"
|
||||
conf.gem "#{root}/mrbgems/mruby-bin-mrbc"
|
||||
conf.cc do |cc|
|
||||
cc.command = 'clang'
|
||||
cc.command = 'gcc'
|
||||
cc.flags = [ENV['CFLAGS_host'] || %w()]
|
||||
cc.include_paths = ["#{root}/include"]
|
||||
end
|
||||
conf.linker do |linker|
|
||||
linker.command = 'clang'
|
||||
linker.command = 'gcc'
|
||||
linker.flags = [ENV['LDFLAGS_host'] || %w()]
|
||||
linker.libraries = [ENV['LIBS'] || 'm']
|
||||
end
|
||||
|
@ -91,30 +83,30 @@ do_configure() {
|
|||
}
|
||||
|
||||
do_build() {
|
||||
# Enable verbosity and/or trace
|
||||
# vsed -i minirake -e '/^$rake_failed/a $verbose = 1'
|
||||
# vsed -i minirake -e '/^$rake_failed/a $trace = 1'
|
||||
|
||||
# Set the number of parallel jobs from $makejobs
|
||||
vsed -i minirake -e "s;^\(\$rake_jobs =\).*;\1 ${makejobs/-j/};"
|
||||
|
||||
# clang does not understand -fstack-clash-protection
|
||||
CFLAGS="${CFLAGS/-fstack-clash-protection/}"
|
||||
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
CFLAGS_host="${CFLAGS_host/-fstack-clash-protection/}"
|
||||
LDFLAGS_host=""
|
||||
echo "CFLAGS_host : $CFLAGS_host"
|
||||
echo "LDFLAGS_host : $LDFLAGS_host"
|
||||
else
|
||||
LDFLAGS=""
|
||||
CFLAGS_host="$CFLAGS"
|
||||
LDFLAGS_host="$LDFLAGS"
|
||||
fi
|
||||
echo "CFLAGS : $CFLAGS"
|
||||
echo "LDFLAGS : $LDFLAGS"
|
||||
echo "LIBS : $LIBS"
|
||||
CFLAGS="$CFLAGS" CFLAGS_host="$CFLAGS_host" \
|
||||
LDFLAGS="$LDFLAGS" LDFLAGS_host="$LDFLAGS_host" \
|
||||
LIBS="$LIBS" MRUBY_CONFIG=xbps_config.rb VERBOS=1 \
|
||||
LIBS="m" MRUBY_CONFIG=xbps_config.rb \
|
||||
ruby minirake
|
||||
}
|
||||
|
||||
do_check() {
|
||||
CFLAGS="$CFLAGS" CFLAGS_host="$CFLAGS_host" \
|
||||
LDFLAGS="$LDFLAGS" LDFLAGS_host="$LDFLAGS_host" \
|
||||
LIBS="m" MRUBY_CONFIG=xbps_config.rb \
|
||||
ruby minirake test
|
||||
}
|
||||
|
||||
do_install() {
|
||||
local _build
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
|
|
Loading…
Reference in New Issue