diff --git a/.travis.yml b/.travis.yml index 033ea69..02ec0fc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,74 +1,123 @@ -# Lua is not officially supported, but an erlang environment will do. -language: erlang +language: c env: global: - - PACKAGE=lyaml - - ROCKSPEC=$PACKAGE-git-1.rockspec - - LUAROCKS_CONFIG=build-aux/luarocks-config.lua - - LUAROCKS_BASE=luarocks-2.2.0 - - LUAROCKS="$LUA $HOME/bin/luarocks" + - COMPILE="libtool --mode=compile --tag=CC gcc" + - CFLAGS="-O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX" + - INSTALL="libtool --mode=install install -p" + - LINK="libtool --mode=link --tag=CC gcc" + - LIBS="-lm -Wl,-E -ldl -lreadline" + + - ROCKSPEC=lyaml-git-1.rockspec + + - prefix=/usr/local + - bindir=$prefix/bin + - incdir=$prefix/include + - libdir=$prefix/lib matrix: - - LUA=lua5.1 LUA_INCDIR=/usr/include/lua5.1 LUA_SUFFIX=5.1 - - LUA=lua5.2 LUA_INCDIR=/usr/include/lua5.2 LUA_SUFFIX=5.2 - - LUA=luajit-2.0.0-beta9 LUA_INCDIR=/usr/include/luajit-2.0 LUA_SUFFIX=5.1 + - LUA=lua5.3 + - LUA=lua5.2 + - LUA=lua5.1 + - LUA=luajit -# Tool setup. -install: + +before_install: # Put back the links for libyaml, which are missing on recent Travis VMs - test -f /usr/lib/libyaml.so || sudo find /usr/lib -name 'libyaml*' -exec ln -s {} /usr/lib \; - - sudo apt-get install help2man - - sudo apt-get install luajit - - sudo apt-get install libluajit-5.1-dev - - sudo apt-get install lua5.1 - - sudo apt-get install liblua5.1-dev - - sudo apt-get install lua5.2 - - sudo apt-get install liblua5.2-dev - - # Install a recent luarocks release locally for everything else. - - wget http://luarocks.org/releases/$LUAROCKS_BASE.tar.gz - - tar zxvpf $LUAROCKS_BASE.tar.gz - # LuaRocks configure --with-lua argument is just a prefix! - - ( cd $LUAROCKS_BASE; - ./configure - --prefix=$HOME --with-lua=/usr --lua-version=$LUA_SUFFIX - --lua-suffix=$LUA_SUFFIX --with-lua-include=$LUA_INCDIR; - make build; - make install; ) - -# Configure and build. -script: - # Initial bootstrap to build luarocks-config.lua, before we've - # installed our rocks. - - ./bootstrap --skip-rock-checks + + # Fetch Lua sources. + - cd $TRAVIS_BUILD_DIR + - 'if test lua5.3 = "$LUA"; then + curl http://www.lua.org/work/lua-5.3.0-rc1.tar.gz | tar xz; + cd lua-5.3.0; + fi' + - 'if test lua5.2 = "$LUA"; then + curl http://www.lua.org/ftp/lua-5.2.3.tar.gz | tar xz; + cd lua-5.2.3; + fi' + - 'if test lua5.1 = "$LUA"; then + curl http://www.lua.org/ftp/lua-5.1.5.tar.gz | tar xz; + cd lua-5.1.5; + fi' + + # Unpack, compile and install Lua. + - 'if test luajit = "$LUA"; then + curl http://luajit.org/download/LuaJIT-2.0.3.tar.gz | tar xz; + cd LuaJIT-2.0.3; + make && sudo make install; + for header in lua.h luaconf.h lualib.h lauxlib.h luajit.h lua.hpp; do + if test -f /usr/local/include/luajit-2.0/$header; then + sudo ln -s /usr/local/include/luajit-2.0/$header /usr/local/include/$header; + fi; + done; + else + for src in src/*.c; do + test src/lua.c = "$src" || test src/luac.c = "$src" || eval $COMPILE $CFLAGS -c $src; + done; + eval $LINK -o lib$LUA.la -version-info 0:0:0 -rpath $libdir *.lo; + sudo mkdir -p $libdir; + eval sudo $INSTALL lib$LUA.la $libdir/lib$LUA.la; + + eval $COMPILE $CFLAGS -c src/lua.c; + eval $LINK -static -o $LUA lua.lo lib$LUA.la $LIBS; + sudo mkdir -p $bindir; + eval sudo $INSTALL $LUA $bindir/$LUA; + + sudo mkdir -p $incdir; + for header in lua.h luaconf.h lualib.h lauxlib.h lua.hpp; do + if test -f src/$header; then + eval sudo $INSTALL src/$header $incdir/$header; + fi; + done; + fi' + + # Fetch LuaRocks. + - cd $TRAVIS_BUILD_DIR + - 'git clone https://github.com/keplerproject/luarocks.git luarocks-2.2.0' + - cd luarocks-2.2.0 + - git checkout v2.2.0 + + # Compile and install luarocks. + - if test luajit = "$LUA"; then + ./configure --lua-suffix=jit; + else + ./configure; + fi + - 'make build && sudo make install' + + # Tidy up file droppings. + - cd $TRAVIS_BUILD_DIR + - rm -rf lua-5.3.0 lua-5.2.3 lua-5.1.5 luarocks-2.2.0 + + +install: + - sudo luarocks install specl; + + # Initial bootstrap to generate Makefile for rockspecs. + - ./bootstrap - ./configure LUA="$LUA" - - make $LUAROCKS_CONFIG - LUA="$LUA" LUA_INCDIR="$LUA_INCDIR" V=1 - || cat $LUAROCKS_CONFIG config.log - - # Set Lua and Shell paths up for local luarocks tree. - # this package depends on will be installed. - - eval `$LUAROCKS path` - - export PATH=`pwd`/luarocks/bin:$PATH - - # Install extra rocks into $LUAROCKS_CONFIG rocks tree. - - $LUAROCKS install specl; - - # Make git rockspec for this lyaml - - make rockspecs LUAROCKS="$LUAROCKS" V=1 - || { $LUAROCKS path; cat $ROCKSPEC; } - - # The git rockspec will rerun bootstrap, and check any rock versions - # in bootstrap.conf:buildreq this time. - - $LUAROCKS make $ROCKSPEC LUA="$LUA" - - # Run self-tests in the `luarocks make` build tree. - - LUA_PATH=`pwd`'/lib/?.lua;'"${LUA_PATH-;}" - LUA_CPATH=`pwd`'/ext/?.so;'"${LUA_CPATH-;}" - LUA_INIT= LUA_INIT_5_2= - make check V=1 + - make rockspecs V=1 + || cat $ROCKSPEC + + # Rerun bootstrap automatically from git rockspec. + - sudo luarocks make $ROCKSPEC LUA="$LUA" + + +script: + - make check V=1 + + +# Run sanity checks on CI server, ignoring buggy automakes. +after_success: + - '{ _assign="="; + if grep local-checks-to-skip build-aux/sanity-cfg.mk >/dev/null; then + _assign="+="; + fi; + printf "local-checks-to-skip %s sc_vulnerable_makefile_CVE-2012-3386\n" "$_assign"; + } >> build-aux/sanity-cfg.mk' + - 'make syntax-check || :' notifications: slack: aspirinc:JyWeNrIdS0J5nf2Pn2BS1cih diff --git a/ChangeLog b/ChangeLog index d9b2b36..de66162 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,59 @@ +2014-12-17 Gary V. Vaughan + + Release version 5.1.0 + * NEWS: Record release date. + + configury: remove references to lua52compat.h. + * local.mk (EXTRA_DIST): Remove ext/yaml/luacompat.h. + + slingshot: sync with upstream, for release fixes. + * slingshot: Sync with upstream. + + slingshot: sync with upstream, for release fixes. + * slingshot: Sync with upstream. + + maint: bump release revision to 5.1.0. + * configure.ac (AC_INIT): Bump release revision to 5.1.0. + * NEWS: Update. + + slingshot: sync with upstream, for travis fixes. + * slingshot: Sync with upstream. + * .travis.yml: Regenerate. + + slingshot: sync with upstream, for luajit fixes. + * slingshot: Sync with upstream. + * .travis.yml: Regenerate. + + slingshot: sync with upstream, for travis.yml bugfixes. + * slingshot: Sync with upstream. + * .travis.yml: Regenerate. + + slingshot: sync with upstream, for Lua 5.3 support. + * slingshot: Sync with upstream. + * bootstrap: Update to latest slingshot bootstrap. + * .travis.yml: Regenerate. + + maint: preliminary Lua 5.3.0 compatibility. + * slingshot: Sync with upstream for Lua 5.3 compatibility. + * configure.ac (AX_PROG_LUA): Accept Lua 5.3 interpreters. + * ext/yaml/lua52compat.h: Remove. + * ext/yaml/lyaml.h (lua_objlen, lua_strlen, luaL_openlib) + (luaL_register): Lua 5.2 and 5.3 compatibility definitions. + * .travis.yml: Regenerate. + +2014-12-16 Gary V. Vaughan + + configury: adopt semantic versioning. + * configure.ac (AC_INIT): Bump version to 6.0.0. + +2014-09-26 Gary V. Vaughan + + maint: post-release administrivia. + * configure.ac (AC_INIT): Bump release version to 6. + * NEWS: Add header line for next release. + * .prev-version: Record previous version. + * ./local.mk (old_NEWS_hash): Auto-update. + 2014-09-25 Gary V. Vaughan Release version 5 diff --git a/Makefile.in b/Makefile.in index ae28ba9..b0e7d5b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -500,9 +500,9 @@ SPECL_ENV = LUA='$(LUA)' abs_top_builddir='$(abs_top_builddir)' \ ACLOCAL_AMFLAGS = -I m4 AM_CPPFLAGS = $(LUA_INCLUDE) EXTRA_DIST = $(srcdir)/specs/spec_helper.lua $(NOTHING_ELSE) \ - $(specl_SPECS) $(NOTHING_ELSE) ext/yaml/lua52compat.h \ - ext/yaml/lyaml.h $(NOTHING_ELSE) $(mkrockspecs) \ - $(package_rockspec) $(rockspec_conf) $(NOTHING_ELSE) + $(specl_SPECS) $(NOTHING_ELSE) ext/yaml/lyaml.h \ + $(NOTHING_ELSE) $(mkrockspecs) $(package_rockspec) \ + $(rockspec_conf) $(NOTHING_ELSE) EXTRA_LTLIBRARIES = CLEANFILES = DISTCLEANFILES = $(luarocks_config) $(NOTHING_ELSE) @@ -524,7 +524,7 @@ LUA_ENV = \ LUA_PATH="$(lyaml_path);$(LUA_PATH)" \ $(NOTHING_ELSE) -old_NEWS_hash = dab71a2961efb85ecb38d5a1c8b1c07c +old_NEWS_hash = 703831a9204e7435c5058c25ec8a969c update_copyright_env = \ UPDATE_COPYRIGHT_HOLDER='(Gary V. Vaughan|Andrew Danforth)' \ UPDATE_COPYRIGHT_USE_INTERVALS=1 \ diff --git a/NEWS b/NEWS index ef7318d..b90b953 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,12 @@ lyaml NEWS - User visible changes +* Noteworthy changes in release 5.1.0 (2014-12-17) [stable] + +** New Features: + + - Lua 5.3.0 compatibility. + + * Noteworthy changes in release 5 (2014-09-25) [beta] ** Build: diff --git a/bootstrap b/bootstrap index 575ce48..e09b8f4 100755 --- a/bootstrap +++ b/bootstrap @@ -842,8 +842,8 @@ slingshot_require_slingshot_submodule () trap - 1 2 13 15 # Make sure we've checked out the correct revision of slingshot. - func_show_eval "$GIT submodule init" \ - && func_show_eval "$GIT submodule update" \ + func_show_eval "$GIT submodule init -- $slingshot_path" \ + && func_show_eval "$GIT submodule update -- $slingshot_path" \ || func_fatal_error "Unable to update slingshot submodule." fi fi @@ -2424,7 +2424,7 @@ test -z "$progpath" && . `echo "$0" |${SED-sed} 's|[^/]*$||'`/funclib.sh test extract-trace = "$progname" && . `echo "$0" |${SED-sed} 's|[^/]*$||'`/options-parser # Set a version string. -scriptversion=2014-01-04.01; # UTC +scriptversion=2014-12-03.16; # UTC # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -2569,6 +2569,68 @@ func_autoconf_configure () } +# func_tool_version_output CMD [FATAL-ERROR-MSG] +# ---------------------------------------------- +# Attempt to run 'CMD --version', discarding errors. The output can be +# ignored by redirecting stdout, and this function used simply to test +# whether the command exists and exits normally when passed a +# '--version' argument. +# When FATAL-ERROR-MSG is given, then this function will display the +# message and exit if running 'CMD --version' returns a non-zero exit +# status. +func_tool_version_output () +{ + $debug_cmd + + _G_cmd=$1 + _G_fatal_error_msg=$2 + + # Some tools, like 'git2cl' produce thousands of lines of output + # unless stdin is /dev/null - in that case we want to return + # successfully without saving all of that output. Other tools, + # such as 'help2man' exit with a non-zero status when stdin comes + # from /dev/null, so we re-execute without /dev/null if that + # happens. This means that occasionally, the output from both calls + # ends up in the result, but the alternative would be to discard the + # output from one call, and hope the other produces something useful. + { $_G_cmd --version /dev/null + _G_status=$? + + test 0 -ne "$_G_status" && test -n "$_G_fatal_error_msg" \ + && func_fatal_error "$_G_fatal_error_msg" + + (exit $_G_status) +} + + +# func_tool_version_number CMD [FATAL-ERROR-MSG] +# ---------------------------------------------- +# Pass arguments to func_tool_version_output, but set +# $func_tool_version_number_result to the last dot delimited digit string +# on the first line of output. +func_tool_version_number () +{ + $debug_cmd + + _G_verout=`func_tool_version_output "$@" |sed 1q` + _G_status=$? + + # A version number starts with a digit following a space on the first + # line of output from `--version`. + if test -n "$_G_verout"; then + _G_vernum=`expr "$_G_verout" : '.* \([0-9][^ ]*\)'` + fi + + if test -n "$_G_vernum"; then + printf '%s\n' "$_G_vernum" + else + printf '%s\n' "$_G_verout" + fi + + (exit $_G_status) +} + + # func_find_tool ENVVAR NAMES... # ------------------------------ # Search for a required program. Use the value of ENVVAR, if set, @@ -2586,16 +2648,44 @@ func_find_tool () if test -n "$_G_find_tool_res"; then _G_find_tool_error_prefix="\$$find_tool_envvar: " else + _G_find_tool_res= + _G_bestver= for _G_prog do - if func_tool_version_output $_G_prog >/dev/null; then - _G_find_tool_res=$_G_prog - break - fi + _G_find_tool_save_IFS=$IFS + IFS=: + for _G_dir in $PATH; do + IFS=$_G_find_tool_save_IFS + _G_progpath=$_G_dir/$_G_prog + test -r "$_G_progpath" && { + _G_curver=`func_tool_version_number $_G_progpath` + case $_G_bestver,$_G_curver in + ,) + # first non--version responsive prog sticks! + test -n "$_G_progpath" || _G_find_tool_res=$_G_progpath + ;; + ,*) + # first --version responsive prog beats non--version responsive! + _G_find_tool_res=$_G_progpath + _G_bestver=$_G_curver + ;; + *,*) + # another --version responsive prog must be newer to beat previous one! + test "x$_G_curver" = "x$_G_bestver" \ + || func_lt_ver "$_G_curver" "$_G_bestver" \ + || { + _G_find_tool_res=$_G_progpath + _G_bestver=$_G_curver + } + ;; + esac + } + done + IFS=$_G_find_tool_save_IFS done fi if test -n "$_G_find_tool_res"; then - func_tool_version_output >/dev/null $_G_find_tool_res "\ + func_tool_version_number >/dev/null $_G_find_tool_res "\ ${_G_find_tool_error_prefix}Cannot run '$_G_find_tool_res --version'" # Make sure the result is exported to the environment for children @@ -2610,39 +2700,6 @@ One of these is required: } -# func_tool_version_output CMD [FATAL-ERROR-MSG] -# ---------------------------------------------- -# Attempt to run 'CMD --version', discarding errors. The output can be -# ignored by redirecting stdout, and this function used simply to test -# whether the command exists and exits normally when passed a -# '--version' argument. -# When FATAL-ERROR-MSG is given, then this function will display the -# message and exit if running 'CMD --version' returns a non-zero exit -# status. -func_tool_version_output () -{ - $debug_cmd - - _G_cmd=$1 - _G_fatal_error_msg=$2 - - # Some tools, like 'git2cl' produce thousands of lines of output - # unless stdin is /dev/null - in that case we want to return - # successfully without saving all of that output. Other tools, - # such as 'help2man' exit with a non-zero status when stdin comes - # from /dev/null, so we re-execute without /dev/null if that - # happens. This means that occasionally, the output from both calls - # ends up in the result, but the alternative would be to discard the - # output from one call, and hope the other produces something useful. - { $_G_cmd --version /dev/null - _G_status=$? - - test 0 -ne "$_G_status" && test -n "$_G_fatal_error_msg" \ - && func_fatal_error "$_G_fatal_error_msg" - - (exit $_G_status) -} - ## -------------------- ## ## Resource management. ## @@ -2908,7 +2965,7 @@ test extract-trace = "$progname" && func_main "$@" # End: # Set a version string for *this* script. -scriptversion=2014-01-04.01; # UTC +scriptversion=2014-11-04.13; # UTC ## ------------------- ## @@ -4054,7 +4111,7 @@ func_require_buildreq_patch () # The ugly find invocation is necessary to exit with non-zero # status for old find binaries that don't support -exec fully. if test ! -d "$local_gl_dir" \ - || find "$local_gl_dir" -name *.diff -exec false {} \; ; then : + || find "$local_gl_dir" -name "*.diff" -exec false {} \; ; then : else func_append buildreq 'patch - http://www.gnu.org/s/patch ' @@ -4206,7 +4263,7 @@ func_require_git () $opt_skip_git && GIT=true test true = "$GIT" || { - if test -f .git; then + if test -d .git/.; then ($GIT --version) >/dev/null 2>&1 || GIT=true fi } @@ -4424,8 +4481,8 @@ func_require_gnulib_submodule () fi # Make sure we've checked out the correct revision of gnulib. - func_show_eval "$GIT submodule init" \ - && func_show_eval "$GIT submodule update" \ + func_show_eval "$GIT submodule init -- $gnulib_path" \ + && func_show_eval "$GIT submodule update -- $gnulib_path" \ || func_fatal_error "Unable to update gnulib submodule." fi @@ -4529,6 +4586,9 @@ func_require_libtoolize () func_find_tool LIBTOOLIZE libtoolize glibtoolize } + test -n "$LIBTOOLIZE" || func_fatal_error "\ +Please install GNU Libtool, or 'export LIBTOOLIZE=/path/to/libtoolize'." + func_verbose "export LIBTOOLIZE='$LIBTOOLIZE'" # Make sure the search result is visible to subshells @@ -4766,6 +4826,9 @@ func_require_patch () func_find_tool PATCH gpatch patch } + test -n "$PATCH" || func_fatal_error "\ +Please install GNU Patch, or 'export PATCH=/path/to/gnu/patch'." + func_verbose "export PATCH='$PATCH'" # Make sure the search result is visible to subshells @@ -5257,7 +5320,7 @@ func_check_tool () ;; *) save_IFS=$IFS - IFS=: + IFS=${PATH_SEPARATOR-:} for _G_check_tool_path in $PATH; do IFS=$save_IFS if test -x "$_G_check_tool_path/$1"; then @@ -5403,6 +5466,9 @@ func_update_po_files () # Find sha1sum, named gsha1sum on MacPorts, and shasum on MacOS 10.6+. func_find_tool SHA1SUM sha1sum gsha1sum shasum sha1 + test -n "$SHA1SUM" || func_fatal_error "\ +Please install GNU Coreutils, or 'export SHA1SUM=/path/to/sha1sum'." + _G_langs=`cd $_G_ref_po_dir && echo *.po|$SED 's|\.po||g'` test '*' = "$_G_langs" && _G_langs=x for _G_po in $_G_langs; do diff --git a/build-aux/mkrockspecs b/build-aux/mkrockspecs index 01ffc59..99e4c2e 100755 --- a/build-aux/mkrockspecs +++ b/build-aux/mkrockspecs @@ -29,11 +29,12 @@ SH=--[[ # -*- mode: lua; -*- ## ==================================================================== -_lua_version_re='"Lua 5."[12]*' -_lua_binaries='lua lua5.2 lua52 lua5.1 lua51' +_lua_version_re='"Lua 5."[123]*' +_lua_binaries='lua lua5.3 lua53 lua5.2 lua52 lua5.1 lua51' export LUA_INIT export LUA_INIT_5_2 +export LUA_INIT_5_3 export LUA_PATH export LUA_CPATH @@ -86,6 +87,7 @@ test -n "$LUA" || { LUA_INIT= LUA_INIT_5_2= +LUA_INIT_5_3= # Reexecute using the interpreter suppiled in LUA, or found above. exec "$LUA" "$0" "$@" @@ -155,7 +157,7 @@ Report bugs to http://github.com/gvvaughan/slingshot/issues.]]) end prog["--version"] = function () - print [[mkrockspecs (slingshot) 8 + print [[mkrockspecs (slingshot) 9.0.0 Written by Gary V. Vaughan , 2013 Copyright (C) 2013, Gary V. Vaughan @@ -359,7 +361,7 @@ default.build = default.build or { "LUA='$(LUA)' LUA_INCLUDE='-I$(LUA_INCDIR)' " .. configure_flags .. "--prefix='$(PREFIX)' --libdir='$(LIBDIR)' --datadir='$(LUADIR)' " .. "--datarootdir='$(PREFIX)' && make clean all", - install_command = "make install luadir='$(LUADIR)'", + install_command = "make install luadir='$(LUADIR)' luaexecdir='$(LIBDIR)'", copy_directories = {}, } diff --git a/configure b/configure index 5b692f5..0a22db3 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for lyaml 5. +# Generated by GNU Autoconf 2.69 for lyaml 5.1.0. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='lyaml' PACKAGE_TARNAME='lyaml' -PACKAGE_VERSION='5' -PACKAGE_STRING='lyaml 5' +PACKAGE_VERSION='5.1.0' +PACKAGE_STRING='lyaml 5.1.0' PACKAGE_BUGREPORT='http://github.com/gvvaughan/lyaml/issues' PACKAGE_URL='' @@ -1327,7 +1327,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures lyaml 5 to adapt to many kinds of systems. +\`configure' configures lyaml 5.1.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1397,7 +1397,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of lyaml 5:";; + short | recursive ) echo "Configuration of lyaml 5.1.0:";; esac cat <<\_ACEOF @@ -1504,7 +1504,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -lyaml configure 5 +lyaml configure 5.1.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1873,7 +1873,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by lyaml $as_me 5, which was +It was created by lyaml $as_me 5.1.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2252,9 +2252,9 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. -$as_echo "## ------------------- ## -## Configuring lyaml 5 ## -## ------------------- ##" +$as_echo "## ----------------------- ## +## Configuring lyaml 5.1.0 ## +## ----------------------- ##" echo am__api_version='1.14' @@ -2743,7 +2743,7 @@ fi # Define the identity of the package. PACKAGE='lyaml' - VERSION='5' + VERSION='5.1.0' cat >>confdefs.h <<_ACEOF @@ -12461,7 +12461,7 @@ $as_echo "no" >&6; } fi - _ax_check_text="whether $LUA version >= 5.1, < 5.3" + _ax_check_text="whether $LUA version >= 5.1, < 5.4" { $as_echo "$as_me:${as_lineno-$LINENO}: checking $_ax_check_text" >&5 $as_echo_n "checking $_ax_check_text... " >&6; } @@ -12469,7 +12469,7 @@ $as_echo_n "checking $_ax_check_text... " >&6; } function norm (v) i,j=v:match "(%d+)%.(%d+)" if i then return 100 * i + j end end - v, toobig=norm (_VERSION), norm "5.3" or math.huge + v, toobig=norm (_VERSION), norm "5.4" or math.huge os.exit ((v >= norm ("5.1") and v < toobig) and 0 or 1)'; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -12482,7 +12482,7 @@ fi ax_display_LUA=$LUA else - _ax_check_text="for a Lua interpreter with version >= 5.1, < 5.3" + _ax_check_text="for a Lua interpreter with version >= 5.1, < 5.4" { $as_echo "$as_me:${as_lineno-$LINENO}: checking $_ax_check_text" >&5 $as_echo_n "checking $_ax_check_text... " >&6; } if ${ax_cv_pathless_LUA+:} false; then : @@ -12502,7 +12502,7 @@ fi function norm (v) i,j=v:match "(%d+)%.(%d+)" if i then return 100 * i + j end end - v, toobig=norm (_VERSION), norm "5.3" or math.huge + v, toobig=norm (_VERSION), norm "5.4" or math.huge os.exit ((v >= norm ("5.1") and v < toobig) and 0 or 1)'; then : break fi @@ -13039,7 +13039,7 @@ SPECL_MIN=8 *" $_ss_rock;"*) ;; # ignore duplicates *) test "x$PACKAGE_NAME" != "x$_ss_rock" \ - && EXTRA_ROCKS="$EXTRA_ROCKS"' $LUAROCKS install '"$_ss_rock;" + && EXTRA_ROCKS="$EXTRA_ROCKS"' sudo luarocks install '"$_ss_rock;" ;; esac done @@ -13589,7 +13589,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by lyaml $as_me 5, which was +This file was extended by lyaml $as_me 5.1.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -13655,7 +13655,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -lyaml config.status 5 +lyaml config.status 5.1.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index b7885e5..43c1ae4 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ dnl THE SOFTWARE. AC_PREREQ([2.68]) dnl Initialise autoconf and automake -AC_INIT([lyaml], [5], [http://github.com/gvvaughan/lyaml/issues]) +AC_INIT([lyaml], [5.1.0], [http://github.com/gvvaughan/lyaml/issues]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) @@ -49,7 +49,7 @@ AC_SUBST(LIBTOOL_DEPS) dnl Check for programs AC_PROG_CC AC_PATH_PROG([SPECL], [specl], [:]) -AX_PROG_LUA(5.1, 5.3) +AX_PROG_LUA(5.1, 5.4) AX_LUA_HEADERS dnl Check for header files diff --git a/ext/yaml/lua52compat.h b/ext/yaml/lua52compat.h deleted file mode 100644 index 126e0f8..0000000 --- a/ext/yaml/lua52compat.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Lua 5.2 compatibility - * (c) Reuben Thomas (maintainer) 2010-2012 - * This file is in the public domain. - * - * Include this file after Lua headers -*/ - -#if LUA_VERSION_NUM == 502 -static int luaL_typerror(lua_State *L, int narg, const char *tname) -{ - const char *msg = lua_pushfstring(L, "%s expected, got %s", - tname, luaL_typename(L, narg)); - return luaL_argerror(L, narg, msg); -} -#define lua_objlen lua_rawlen -#define lua_strlen lua_rawlen -#define luaL_getn luaL_len -#define luaL_openlib(L,n,l,nup) luaL_setfuncs((L),(l),(nup)) -#define luaL_register(L,n,l) (luaL_newlib(L,l)) -#endif diff --git a/ext/yaml/lyaml.h b/ext/yaml/lyaml.h index 17b61aa..0a1f676 100644 --- a/ext/yaml/lyaml.h +++ b/ext/yaml/lyaml.h @@ -32,8 +32,13 @@ #include #include "lyaml.h" -#include "lua52compat.h" +#if LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503 +# define lua_objlen lua_rawlen +# define lua_strlen lua_rawlen +# define luaL_openlib(L,n,l,nup) luaL_setfuncs((L),(l),(nup)) +# define luaL_register(L,n,l) (luaL_newlib(L,l)) +#endif #ifndef STREQ #define STREQ !strcmp diff --git a/local.mk b/local.mk index a4bbbb0..426cde6 100644 --- a/local.mk +++ b/local.mk @@ -39,7 +39,7 @@ LUA_ENV = \ ## Bootstrap. ## ## ---------- ## -old_NEWS_hash = dab71a2961efb85ecb38d5a1c8b1c07c +old_NEWS_hash = 703831a9204e7435c5058c25ec8a969c update_copyright_env = \ UPDATE_COPYRIGHT_HOLDER='(Gary V. Vaughan|Andrew Danforth)' \ @@ -66,7 +66,6 @@ ext_yaml_yaml_la_LDFLAGS = -module -avoid-version ext_yaml_yaml_la_CPPFLAGS = $(LUA_INCLUDE) $(YAML_INCLUDE) EXTRA_DIST += \ - ext/yaml/lua52compat.h \ ext/yaml/lyaml.h \ $(NOTHING_ELSE) diff --git a/lyaml-5-1.rockspec b/lyaml-5.1.0-1.rockspec similarity index 75% rename from lyaml-5-1.rockspec rename to lyaml-5.1.0-1.rockspec index f21aec4..8b984d5 100644 --- a/lyaml-5-1.rockspec +++ b/lyaml-5.1.0-1.rockspec @@ -1,5 +1,5 @@ package = "lyaml" -version = "5-1" +version = "5.1.0-1" description = { detailed = "Read and write YAML format files with Lua.", homepage = "http://github.com/gvvaughan/lyaml", @@ -7,8 +7,8 @@ description = { summary = "libYAML binding for Lua", } source = { - dir = "lyaml-release-v5", - url = "http://github.com/gvvaughan/lyaml/archive/release-v5.zip", + dir = "lyaml-release-v5.1.0", + url = "http://github.com/gvvaughan/lyaml/archive/release-v5.1.0.zip", } dependencies = { "lua >= 5.1", @@ -21,6 +21,6 @@ external_dependencies = { build = { build_command = "./configure LUA='$(LUA)' LUA_INCLUDE='-I$(LUA_INCDIR)' CPPFLAGS='-I$(YAML_INCDIR)' LDFLAGS='-L$(YAML_LIBDIR)' --prefix='$(PREFIX)' --libdir='$(LIBDIR)' --datadir='$(LUADIR)' --datarootdir='$(PREFIX)' && make clean all", copy_directories = {}, - install_command = "make install luadir='$(LUADIR)'", + install_command = "make install luadir='$(LUADIR)' luaexecdir='$(LIBDIR)'", type = "command", } diff --git a/m4/slingshot.m4 b/m4/slingshot.m4 index 2e4b8aa..7f2051a 100644 --- a/m4/slingshot.m4 +++ b/m4/slingshot.m4 @@ -27,7 +27,7 @@ AC_DEFUN([SS_CONFIG_TRAVIS], [ *" $_ss_rock;"*) ;; # ignore duplicates *) test "x$PACKAGE_NAME" != "x$_ss_rock" \ - && EXTRA_ROCKS="$EXTRA_ROCKS"' $LUAROCKS install '"$_ss_rock;" + && EXTRA_ROCKS="$EXTRA_ROCKS"' sudo luarocks install '"$_ss_rock;" ;; esac done diff --git a/travis.yml.in b/travis.yml.in index 6de9db9..51cc152 100644 --- a/travis.yml.in +++ b/travis.yml.in @@ -1,71 +1,120 @@ -# Lua is not officially supported, but an erlang environment will do. -language: erlang +language: c env: global: - - PACKAGE=@PACKAGE@ - - ROCKSPEC=$PACKAGE-git-1.rockspec - - LUAROCKS_CONFIG=build-aux/luarocks-config.lua - - LUAROCKS_BASE=luarocks-2.2.0 - - LUAROCKS="$LUA $HOME/bin/luarocks" + - COMPILE="libtool --mode=compile --tag=CC gcc" + - CFLAGS="-O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX" + - INSTALL="libtool --mode=install install -p" + - LINK="libtool --mode=link --tag=CC gcc" + - LIBS="-lm -Wl,-E -ldl -lreadline" + + - ROCKSPEC=@PACKAGE@-git-1.rockspec + + - prefix=/usr/local + - bindir=$prefix/bin + - incdir=$prefix/include + - libdir=$prefix/lib matrix: - - LUA=lua5.1 LUA_INCDIR=/usr/include/lua5.1 LUA_SUFFIX=5.1 - - LUA=lua5.2 LUA_INCDIR=/usr/include/lua5.2 LUA_SUFFIX=5.2 - - LUA=luajit-2.0.0-beta9 LUA_INCDIR=/usr/include/luajit-2.0 LUA_SUFFIX=5.1 + - LUA=lua5.3 + - LUA=lua5.2 + - LUA=lua5.1 + - LUA=luajit -# Tool setup. -install: + +before_install: # Put back the links for libyaml, which are missing on recent Travis VMs - test -f /usr/lib/libyaml.so || sudo find /usr/lib -name 'libyaml*' -exec ln -s {} /usr/lib \; - - sudo apt-get install help2man - - sudo apt-get install luajit - - sudo apt-get install libluajit-5.1-dev - - sudo apt-get install lua5.1 - - sudo apt-get install liblua5.1-dev - - sudo apt-get install lua5.2 - - sudo apt-get install liblua5.2-dev - - # Install a recent luarocks release locally for everything else. - - wget http://luarocks.org/releases/$LUAROCKS_BASE.tar.gz - - tar zxvpf $LUAROCKS_BASE.tar.gz - # LuaRocks configure --with-lua argument is just a prefix! - - ( cd $LUAROCKS_BASE; - ./configure - --prefix=$HOME --with-lua=/usr --lua-version=$LUA_SUFFIX - --lua-suffix=$LUA_SUFFIX --with-lua-include=$LUA_INCDIR; - make build; - make install; ) - -# Configure and build. -script: - # Initial bootstrap to build luarocks-config.lua, before we've - # installed our rocks. - - ./bootstrap --skip-rock-checks - - ./configure LUA="$LUA" - - make $LUAROCKS_CONFIG - LUA="$LUA" LUA_INCDIR="$LUA_INCDIR" V=1 - || cat $LUAROCKS_CONFIG config.log - # Set Lua and Shell paths up for local luarocks tree. - # this package depends on will be installed. - - eval `$LUAROCKS path` - - export PATH=`pwd`/luarocks/bin:$PATH + # Fetch Lua sources. + - cd $TRAVIS_BUILD_DIR + - 'if test lua5.3 = "$LUA"; then + curl http://www.lua.org/work/lua-5.3.0-rc1.tar.gz | tar xz; + cd lua-5.3.0; + fi' + - 'if test lua5.2 = "$LUA"; then + curl http://www.lua.org/ftp/lua-5.2.3.tar.gz | tar xz; + cd lua-5.2.3; + fi' + - 'if test lua5.1 = "$LUA"; then + curl http://www.lua.org/ftp/lua-5.1.5.tar.gz | tar xz; + cd lua-5.1.5; + fi' + + # Unpack, compile and install Lua. + - 'if test luajit = "$LUA"; then + curl http://luajit.org/download/LuaJIT-2.0.3.tar.gz | tar xz; + cd LuaJIT-2.0.3; + make && sudo make install; + for header in lua.h luaconf.h lualib.h lauxlib.h luajit.h lua.hpp; do + if test -f /usr/local/include/luajit-2.0/$header; then + sudo ln -s /usr/local/include/luajit-2.0/$header /usr/local/include/$header; + fi; + done; + else + for src in src/*.c; do + test src/lua.c = "$src" || test src/luac.c = "$src" || eval $COMPILE $CFLAGS -c $src; + done; + eval $LINK -o lib$LUA.la -version-info 0:0:0 -rpath $libdir *.lo; + sudo mkdir -p $libdir; + eval sudo $INSTALL lib$LUA.la $libdir/lib$LUA.la; + + eval $COMPILE $CFLAGS -c src/lua.c; + eval $LINK -static -o $LUA lua.lo lib$LUA.la $LIBS; + sudo mkdir -p $bindir; + eval sudo $INSTALL $LUA $bindir/$LUA; + + sudo mkdir -p $incdir; + for header in lua.h luaconf.h lualib.h lauxlib.h lua.hpp; do + if test -f src/$header; then + eval sudo $INSTALL src/$header $incdir/$header; + fi; + done; + fi' - # Install extra rocks into $LUAROCKS_CONFIG rocks tree. + # Fetch LuaRocks. + - cd $TRAVIS_BUILD_DIR + - 'git clone https://github.com/keplerproject/luarocks.git luarocks-2.2.0' + - cd luarocks-2.2.0 + - git checkout v2.2.0 + + # Compile and install luarocks. + - if test luajit = "$LUA"; then + ./configure --lua-suffix=jit; + else + ./configure; + fi + - 'make build && sudo make install' + + # Tidy up file droppings. + - cd $TRAVIS_BUILD_DIR + - rm -rf lua-5.3.0 lua-5.2.3 lua-5.1.5 luarocks-2.2.0 + + +install: @EXTRA_ROCKS@ - # Make git rockspec for this @PACKAGE@ - - make rockspecs LUAROCKS="$LUAROCKS" V=1 - || { $LUAROCKS path; cat $ROCKSPEC; } + # Initial bootstrap to generate Makefile for rockspecs. + - ./bootstrap + - ./configure LUA="$LUA" + - make rockspecs V=1 + || cat $ROCKSPEC + + # Rerun bootstrap automatically from git rockspec. + - sudo luarocks make $ROCKSPEC LUA="$LUA" + + +script: + - make check V=1 - # The git rockspec will rerun bootstrap, and check any rock versions - # in bootstrap.conf:buildreq this time. - - $LUAROCKS make $ROCKSPEC LUA="$LUA" - # Run self-tests in the `luarocks make` build tree. - - LUA_PATH=`pwd`'/lib/?.lua;'"${LUA_PATH-;}" - LUA_CPATH=`pwd`'/ext/?.so;'"${LUA_CPATH-;}" - LUA_INIT= LUA_INIT_5_2= - make check V=1 +# Run sanity checks on CI server, ignoring buggy automakes. +after_success: + - '{ _assign="="; + if grep local-checks-to-skip build-aux/sanity-cfg.mk >/dev/null; then + _assign="+="; + fi; + printf "local-checks-to-skip %s sc_vulnerable_makefile_CVE-2012-3386\n" "$_assign"; + } >> build-aux/sanity-cfg.mk' + - 'make syntax-check || :'