mirror of
https://github.com/void-linux/void-packages.git
synced 2025-09-04 02:52:58 +02:00
New package: mruby2-2.1.2
This commit is contained in:
parent
e8558b788d
commit
aa54549540
1 changed files with 127 additions and 0 deletions
127
srcpkgs/mruby2/template
Normal file
127
srcpkgs/mruby2/template
Normal file
|
@ -0,0 +1,127 @@
|
||||||
|
# Template file for 'mruby2'
|
||||||
|
pkgname=mruby2
|
||||||
|
version=2.1.2
|
||||||
|
revision=1
|
||||||
|
hostmakedepends="ruby"
|
||||||
|
short_desc="Lightweight implementation of the Ruby language (Ruby 1.9)"
|
||||||
|
maintainer="Orphaned <orphan@voidlinux.org>"
|
||||||
|
license="MIT"
|
||||||
|
homepage="https://mruby.org/"
|
||||||
|
distfiles="https://github.com/mruby/mruby/archive/${version}.tar.gz>${pkgname}-${version}.tar.gz"
|
||||||
|
checksum=4dc0017e36d15e81dc85953afb2a643ba2571574748db0d8ede002cefbba053b
|
||||||
|
lib32disabled=yes
|
||||||
|
provides="mruby-${version}_${revision}"
|
||||||
|
conflicts="mruby>=0"
|
||||||
|
repository=bootstrap
|
||||||
|
|
||||||
|
do_configure() {
|
||||||
|
if [ -z "$CROSS_BUILD" ]; then
|
||||||
|
# Native build
|
||||||
|
cat <<-EOF > xbps_config.rb
|
||||||
|
MRuby::Build.new do |conf|
|
||||||
|
toolchain :gcc
|
||||||
|
conf.gem "#{root}/mrbgems/mruby-bin-mruby"
|
||||||
|
conf.gem "#{root}/mrbgems/mruby-bin-mrbc"
|
||||||
|
conf.cc do |cc|
|
||||||
|
cc.command = 'gcc'
|
||||||
|
cc.flags = [ENV['CFLAGS'] || %w()]
|
||||||
|
cc.include_paths = ["#{root}/include"]
|
||||||
|
end
|
||||||
|
conf.linker do |linker|
|
||||||
|
linker.command = 'gcc'
|
||||||
|
linker.flags = [ENV['LDFLAGS'] || %w()]
|
||||||
|
linker.libraries = [ENV['LIBS'] || 'm']
|
||||||
|
end
|
||||||
|
conf.archiver do |archiver|
|
||||||
|
archiver.command = 'ar'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
EOF
|
||||||
|
else
|
||||||
|
# Cross build
|
||||||
|
cat <<-EOF > xbps_config.rb
|
||||||
|
MRuby::Build.new do |conf|
|
||||||
|
toolchain :gcc
|
||||||
|
conf.gem "#{root}/mrbgems/mruby-bin-mruby"
|
||||||
|
conf.gem "#{root}/mrbgems/mruby-bin-mrbc"
|
||||||
|
conf.cc do |cc|
|
||||||
|
cc.command = 'gcc'
|
||||||
|
cc.flags = [ENV['CFLAGS_host'] || %w()]
|
||||||
|
cc.include_paths = ["#{root}/include"]
|
||||||
|
end
|
||||||
|
conf.linker do |linker|
|
||||||
|
linker.command = 'gcc'
|
||||||
|
linker.flags = [ENV['LDFLAGS_host'] || %w()]
|
||||||
|
linker.libraries = [ENV['LIBS'] || 'm']
|
||||||
|
end
|
||||||
|
conf.archiver do |archiver|
|
||||||
|
archiver.command = 'ar'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
MRuby::CrossBuild.new('${XBPS_CROSS_TRIPLET}') do |conf|
|
||||||
|
toolchain :gcc
|
||||||
|
conf.gem "#{root}/mrbgems/mruby-bin-mruby"
|
||||||
|
conf.gem "#{root}/mrbgems/mruby-bin-mrbc"
|
||||||
|
conf.cc do |cc|
|
||||||
|
cc.command = ENV['CC'] || '${XBPS_CROSS_TRIPLET}-gcc'
|
||||||
|
cc.flags = [ENV['CFLAGS'] || %w()]
|
||||||
|
cc.include_paths = ["#{root}/include"]
|
||||||
|
cc.defines = %w()
|
||||||
|
cc.option_include_path = '-I%s'
|
||||||
|
cc.option_define = '-D%s'
|
||||||
|
cc.compile_options = "%{flags} -o %{outfile} -c %{infile}"
|
||||||
|
end
|
||||||
|
conf.linker do |linker|
|
||||||
|
linker.command = ENV['CC'] || '${XBPS_CROSS_TRIPLET}-gcc'
|
||||||
|
linker.flags = [ENV['LDFLAGS'] || %w()]
|
||||||
|
linker.libraries = [ENV['LIBS'] || 'm']
|
||||||
|
linker.library_paths = '${XBPS_CROSS_BASE}/usr/lib'
|
||||||
|
end
|
||||||
|
conf.archiver do |archiver|
|
||||||
|
archiver.command = ENV['AR'] || '${XBPS_CROSS_TRIPLET}-ar'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
do_build() {
|
||||||
|
if [ "$CROSS_BUILD" ]; then
|
||||||
|
export LDFLAGS_host=""
|
||||||
|
echo "CFLAGS_host : $CFLAGS_host"
|
||||||
|
echo "LDFLAGS_host : $LDFLAGS_host"
|
||||||
|
else
|
||||||
|
export LDFLAGS=""
|
||||||
|
CFLAGS_host="$CFLAGS"
|
||||||
|
LDFLAGS_host="$LDFLAGS"
|
||||||
|
fi
|
||||||
|
echo "CFLAGS : $CFLAGS"
|
||||||
|
echo "LDFLAGS : $LDFLAGS"
|
||||||
|
CFLAGS="$CFLAGS" CFLAGS_host="$CFLAGS_host" \
|
||||||
|
LDFLAGS="$LDFLAGS" LDFLAGS_host="$LDFLAGS_host" \
|
||||||
|
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
|
||||||
|
_build="build/${XBPS_CROSS_TRIPLET}"
|
||||||
|
else
|
||||||
|
_build="build/host"
|
||||||
|
fi
|
||||||
|
vmkdir usr/bin
|
||||||
|
vcopy "${_build}/bin/*" usr/bin
|
||||||
|
vmkdir usr/lib
|
||||||
|
vcopy "${_build}/lib/*.a" usr/lib
|
||||||
|
vmkdir usr/include
|
||||||
|
vcopy "include/*" usr/include
|
||||||
|
vlicense LICENSE
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue