Commit e43801e8 authored by Sophie Brun's avatar Sophie Brun

Merge tag 'upstream/33.4.0'

Upstream version 33.4.0
parents ae62e465 ab401e7f
# Lua is not officially supported, but an erlang environment will do.
language: erlang
language: python
sudo: false
addons:
apt:
packages:
- help2man
env:
global:
- PACKAGE=luaposix
- ROCKSPEC=$PACKAGE-git-1.rockspec
- LUAROCKS_CONFIG=build-aux/luarocks-config.lua
- LUAROCKS_BASE=luarocks-2.0.13
- LUAROCKS="$LUA $HOME/bin/luarocks"
- GENDOC=luarocks/bin/ldoc
- SPECL=bin/specl
- _inst=$TRAVIS_BUILD_DIR/_inst
- luadir=$_inst/share/lua
- luaexecdir=$_inst/lib/lua
matrix:
- LUA=lua5.1 LUA_INCDIR=/usr/include/lua5.1
- LUA=lua5.2 LUA_INCDIR=/usr/include/lua5.2
- LUA=luajit-2.0.0-beta9 LUA_INCDIR=/usr/include/luajit-2.0
- VLUA="lua=5.3"
- VLUA="lua=5.2"
- VLUA="lua=5.1"
- VLUA="luajit=2.1"
- VLUA="luajit=2.0"
before_install:
- pip install hererocks
- hererocks here -r^ --$VLUA
- export PATH=$PWD/here/bin:$PATH
# Tool setup.
install:
- 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
# Luadoc and Ldoc work best on Travis with Lua 5.1.
- sudo apt-get install luarocks
- sudo luarocks install ldoc
- mkdir -p luarocks/bin
- sed 's|^exec "[^"]*"|exec lua5.1|' `which ldoc` > $GENDOC
- chmod a+rx $GENDOC
# Install a recent luarocks release locally for everything else.
- wget http://luarocks.org/releases/$LUAROCKS_BASE.tar.gz
- tar zxvpf $LUAROCKS_BASE.tar.gz
- cd $LUAROCKS_BASE
- ./configure
--prefix=$HOME --lua-version=5.1 --lua-suffix=5.1
--with-lua-include="/usr/include/lua5.1"
- make all install
- cd ..
# Configure and build.
# Use Lua 5.3 compatible rocks, where available.
- 'for rock in ansicolors ldoc specl""; do
if test -z "$rock"; then break; fi;
if luarocks list | grep "^$rock$" >/dev/null; then continue; fi;
luarocks install --server=http://rocks.moonscript.org/manifests/gvvaughan $rock;
done'
# Fudge timestamps on release branches.
- 'if test -f configure; then
test -f aclocal.m4 && touch aclocal.m4;
sleep 1; touch Makefile.in;
sleep 1; test -f config.h.in && touch config.h.in;
sleep 1; touch configure;
fi'
# Build from rockspec, forcing uninstall of older luarocks installed
# above when testing the git rockspec, both for enforcing backwards
# compatibility by default, and for ease of maintenance.
- if test -f 'luaposix-33.4.0-1.rockspec'; then
luarocks make 'luaposix-33.4.0-1.rockspec';
else
luarocks make --force 'luaposix-git-1.rockspec';
fi
script:
- ./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.
- eval `$LUAROCKS path`
- export PATH=`pwd`/luarocks/bin:$PATH
- $LUAROCKS install lyaml; $LUAROCKS install specl;
- make rockspecs LUAROCKS="$LUAROCKS" V=1
|| { $LUAROCKS path; cat $ROCKSPEC; }
# LuaRocks make will fail if dependencies are missing.
- $LUAROCKS make $ROCKSPEC LUA="$LUA"
# Use bin/specl if we built it, or else the specl rock we just installed.
- test -f "$SPECL" || SPECL=luarocks/bin/specl;
make check SPECL="$SPECL" V=1
# Reconfigure for in-tree test install.
- test -f configure || ./bootstrap --verbose
- LUA=`pwd`/here/bin/lua
LUA_INCLUDE=-I`pwd`/here/include
./configure --prefix="$_inst" --disable-silent-rules
# Verify luarocks installation.
- make installcheck || make installcheck V=1
# Verify local build.
- make
- make check || make check V=1
# Verify configured installation.
- make install prefix="$_inst" luadir="$luadir" luaexecdir="$luaexecdir"
- LUA_PATH="$luadir/?.lua;$luadir/?/init.lua;;"
LUA_CPATH="$luaexecdir/?.so;;"
make installcheck 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 || : this will usually fail on the release branch'
notifications:
slack: aspirinc:JyWeNrIdS0J5nf2Pn2BS1cih
......@@ -10,9 +10,4 @@ An earlier version of luaposix (up to 5.1.11)
Based on original by Claudio Terra for Lua 3.x, with contributions
by Roberto Ierusalimschy.
lcurses release 7
Copyright Tiago Dionizio <tiago.dionizio@gmail.com> 2004-2007
Copyright Reuben Thomas <rrt@sc3d.org> 2009-2011
John Belmonte <jvb@prairienet.org> wrote the example program tree.lua.
Copyright (C) 2006-2013 luaposix authors
Copyright (C) 2006-2016 luaposix authors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
This source diff could not be displayed because it is too large. You can view the blob instead.
## maintainer rules.
# Maintainer rules.
#
# Copyright (C) 2013-2016 Gary V. Vaughan
# Written by Gary V. Vaughan, 2013
#
# 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
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
ME = GNUmakefile
......@@ -7,9 +23,12 @@ dont-forget-to-bootstrap = $(wildcard Makefile.in)
ifeq ($(dont-forget-to-bootstrap),)
## Don't redo any pedantic rock version checks, incase they derail
## a subdirectory bootstrap of slingshot.
%::
@echo '$(ME): rebootstrap'
@test -f Makefile.in || ./bootstrap
@test -f Makefile.in || ./bootstrap --skip-rock-checks
@test -f Makefile || ./configure
$(MAKE) $@
......@@ -22,6 +41,30 @@ include build-aux/sanity.mk
# Run sanity checks as part of distcheck.
distcheck: $(local-check)
## ------------------------- ##
## Copyright Notice Updates. ##
## ------------------------- ##
# If you want to set UPDATE_COPYRIGHT_* environment variables,
# for the build-aux/update-copyright script: set the assignments
# in this variable in local.mk.
update_copyright_env ?=
# Run this rule once per year (usually early in January)
# to update all FSF copyright year lists in your project.
# If you have an additional project-specific rule,
# add it in local.mk along with a line 'update-copyright: prereq'.
# By default, exclude all variants of COPYING; you can also
# add exemptions (such as ChangeLog..* for rotated change logs)
# in the file .x-update-copyright.
.PHONY: update-copyright
update-copyright:
$(AM_V_GEN)grep -l -w Copyright \
$$(export VC_LIST_EXCEPT_DEFAULT=COPYING && $(VC_LIST_EXCEPT)) \
| $(update_copyright_env) xargs $(srcdir)/build-aux/$@
## ------ ##
## Specl. ##
## ------ ##
......@@ -29,7 +72,8 @@ distcheck: $(local-check)
# Use 'make check V=1' for verbose output, or set SPECL_OPTS to
# pass alternative options to specl command.
SPECL_OPTS ?= $(specl_verbose_$(V))
SPECL_OPTS ?=
SPECL_OPTS += $(specl_verbose_$(V))
specl_verbose_ = $(specl_verbose_$(AM_DEFAULT_VERBOSITY))
specl_verbose_0 =
specl_verbose_1 = --verbose --formatter=report
......
......@@ -12,8 +12,8 @@ without warranty of any kind.
Basic Installation
==================
Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package. The following
Briefly, the shell command `./configure && make && make install'
should configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package. Some packages provide this
`INSTALL' file but do not implement all of the features documented
......
# Non-recursive Make rules.
#
# Copyright (C) 2013 Gary V. Vaughan
# Copyright (C) 2013-2016 Gary V. Vaughan
# Written by Gary V. Vaughan, 2013
#
# This program is free software; you can redistribute it and/or modify it
......@@ -24,6 +24,10 @@
LUA_PATH ?= ;
LUA_CPATH ?= ;
SPECL_ENV =
CHECK_ENV =
INSTALLCHECK_ENV =
## ---------- ##
## Bootstrap. ##
......@@ -49,8 +53,12 @@ bin_SCRIPTS =
check_local =
dist_bin_SCRIPTS =
dist_lua_DATA =
install_exec_hooks =
doc_DATA =
installcheck_local =
install_exec_hooks = remove-luaexec-lafiles
uninstall_hooks = uninstall-luaexec-modules
lib_LTLIBRARIES =
luaexec_LTLIBRARIES =
man_MANS =
save_release_files =
......@@ -69,4 +77,33 @@ check-local: $(check_local)
## Installation. ##
## ------------- ##
installcheck-local: $(installcheck_local)
install-exec-hook: $(install_exec_hooks)
# Neither Lua itself, nor LuaRocks can use .la files, and LuaRocks
# actually moves such files aside anyway, so we just remove them from
# the installation directory.
remove-luaexec-lafiles:
@for la in $(luaexec_LTLIBRARIES); do \
f=`echo "$$la" |sed 's|^.*/||'`; \
echo rm -f $(DESTDIR)$(luaexecdir)/$$f; \
rm -f $(DESTDIR)$(luaexecdir)/$$f; \
done
## --------------- ##
## Uninstallation. ##
## --------------- ##
uninstall-hook: $(uninstall_hooks)
# We removed the .la files from luaexecdir, so the standard uninstall,
# with libtool --mode=uninstall, can't find everything anymore.
uninstall-luaexec-modules:
@for la in $(luaexec_LTLIBRARIES); do \
base=`echo "$$la" \
|sed 's|^.*/\(.*\)\.la|\1|'`; \
echo rm -f $(DESTDIR)$(luaexecdir)/$$base.so; \
rm -f $(DESTDIR)$(luaexecdir)/$$base.so; \
done
This diff is collapsed.
This diff is collapsed.
luaposix
========
By the [luaposix project][GitHub]
By the [luaposix project][github]
[![License](http://img.shields.io/:license-mit-blue.svg)](http://mit-license.org)
[![travis-ci status](https://secure.travis-ci.org/luaposix/luaposix.png?branche=master)](http://travis-ci.org/luaposix/luaposix/builds)
[![Stories in Ready](https://badge.waffle.io/luaposix/luaposix.png?label=ready&title=Ready)](https://waffle.io/luaposix/luaposix)
luaposix is a POSIX binding, including curses, for [Lua] 5.1 and 5.2;
like most libraries it simply binds to C APIs on the underlying
system, so it won't work on non-POSIX systems. However, it does try
to detect the level of POSIX conformance of the underlying system and
bind only available APIs.
This is a POSIX binding for LuaJIT, [Lua][] 5.1, 5.2 and 5.3; like most
libraries it simply binds to C APIs on the underlying system, so it
won't work on non-POSIX systems. However, it does try to detect the
level of POSIX conformance of the underlying system and bind only
available APIs.
luaposix is released under the MIT license, like Lua (see [COPYING];
it's basically the same as the BSD license). There is no warranty.
luaposix is released under the [MIT license][mit] (the same license as
Lua itsef). There is no warranty.
[github]: https://github.com/luaposix/luaposix "Github repository"
[lua]: http://www.lua.org/ "The Lua Project"
[mit]: http://mit-license.org "MIT license"
Please report bugs and make suggestions by opening an issue on the
github tracker.
Installation
------------
The simplest way to install luaposix is with [LuaRocks]. To install the
The simplest and best way to install luaposix is with [LuaRocks][]. To
install the
latest release (recommended):
```bash
luarocks install luaposix
```
To install current git master (for testing, before submitting a bug
report for example):
```bash
luarocks install http://raw.github.com/luaposix/luaposix/release/luaposix-git-1.rockspec
```
The best way to install without [LuaRocks][], is to download a github
[release tarball][releases] and follow the instructions in the included
[INSTALL][] fill. Even if you are repackaging or redistributing
[luaposix][github], this is by far the most straight forward place to
begin.
Note that you'll be responsible for providing dependencies if you choose
not to let [LuaRocks][] handle them for you, though you can find a list
of the minimal dependencies in the [rockspec.conf][] file.
It is also possible to perform a complete bootstrap of the
[master][github] development branch, although this branch is unstable,
and sometimes breaks subtly, or does not build at all, or provides
experimental new APIs that end up being removed prior to the next
official release. Unfortunately, we don't have time to provide support
for taking this most difficult and dangerous option. It is presumed that
you already know enough to be aware of what you are getting yourself
into - however, there are full logs of complete bootstrap builds in
[Travis][] after every commit, that you can examine if you get stuck.
Also, the bootstrap script tries very hard to tell you why it is unhappy
and, sometimes, even how to fix things before trying again.
[install]: http://raw.githubusercontent.com/luaposix/luaposix/release/INSTALL
[luarocks]: http://www.luarocks.org "Lua package manager"
[releases]: http://github.com/luaposix/luaposix/releases
[rockspec.conf]: http://github.com/luaposix/luaposix/blob/release/rockspec.conf
[travis]: http://travis-ci.org/luaposix/luaposix/builds
To install current git master (for testing):
luarocks install https://raw.github.com/luaposix/luaposix/release/luaposix-git-1.rockspec
Use
---
With Lua 5.1, luaposix requires the bitop library from http://bitop.luajit.org/
(On Lua 5.2 it will work whether bitop is installed or not.)
The library is split into submodules according to the POSIX header file
API declarations, which you can require individually:
To install without LuaRocks, check out the sources from the
[repository][GitHub] and run the following commands:
```lua
local unistd = require "posix.unistd"
```
cd luaposix
./bootstrap
./configure --prefix=INSTALLATION-ROOT-DIRECTORY
make all check install
The authoritative online POSIX reference is published at
[SUSv3][].
Dependencies are listed in the dependencies entry of the file
`rockspec.conf`. You will also need Autoconf and Automake.
[susv3]: http://www.opengroup.org/onlinepubs/007904875/toc.htm
See [INSTALL] for `configure` instructions and `configure --help`
for details of available command-line switches.
Use
---
Documentation
-------------
The library is split into two modules. The basic POSIX APIs are in
`posix` and the curses APIs in `curses`.
The latest release of this library is [documented in LDoc][github.io].
Pre-built HTML files are included in the release, and contain links to
the appropriate [SUSv3][] manual pages.
HTML documentation can be generated with [LDoc] by running `make doc`
or viewed online at <http://luaposix.github.com/luaposix/>.
[github.io]: http://luaposix.github.io/luaposix
The authoritative online POSIX reference is at
<http://www.opengroup.org/onlinepubs/007904875/toc.htm>.
Example code
------------
See the example program `tree.lua`, along with the tests in
`tests-*.lua`.
See the example program `tree.lua`, along with the many small
examples in the generated documentation and BDD `specs/*_spec.yaml`.
For a complete application, see the [GNU Zile][].
For a complete application, see the lua branch of [GNU Zile].
[GNU Zile]: http://git.savannah.gnu.org/cgit/zile.git/log/?h=lua "A cut-down Emacs clone"
Bugs reports & patches
----------------------
Bug reports and patches are most welcome. Please use the github issue
tracker (see URL at top). There is no strict coding style, but please
bear in mind the following points when writing new code:
Bugs reports and code contributions
-----------------------------------
These libraries are maintained by their users.
Please make bug reports and suggestions as [GitHub issues][issues].
Pull requests are especially appreciated.
But first, please check that you issue has not already been reported by
someone else, and that it is not already fixed by [master][github] in
preparation for the next release (See Installation section above for how
to temporarily install master with [LuaRocks][]).
There is no strict coding style, but please bear in mind the following
points when proposing changes:
0. Follow existing code. There are a lot of useful patterns and
avoided traps there.
1. 8-character indentation using TABs. Not my favourite either, but
better than reformatting the code and losing much of the ability to
follow the version control history.
1. 8-character indentation using TABs in C sources; 2-character
indentation using SPACEs in Lua sources.
2. No non-POSIX APIs; no platform-specific code. When wrapping APIs
introduced in POSIX 2001 or later, add an appropriate #if. If your
......@@ -89,11 +136,4 @@ bear in mind the following points when writing new code:
POSIX APIs in the simplest way possible. If necessary, more
convenient wrappers can be added in Lua (posix.lua).
[Lua]: http://www.lua.org/
[GitHub]: https://github.com/luaposix/luaposix
[LuaRocks]: http://www.luarocksporg "Lua package manager"
[LDoc]: https://github.com/stevedonovan/LDoc "Lua documentation generator"
[COPYING]: https://raw.github.com/luaposix/luaposix/release/COPYING
[INSTALL]: https://raw.github.com/luaposix/luaposix/release/INSTALL
[GNU Zile]: http://git.savannah.gnu.org/cgit/zile.git/log/?h=lua "A cut-down Emacs clone"
[issues]: http://github.com/luaposix/luaposix/issues
This diff is collapsed.
This diff is collapsed.
# bootstrap.conf (luaposix) version 2013-06-27
# bootstrap.conf (luaposix) version 2016-02-24
# Written by Gary V. Vaughan, 2010
# Copyright (C) 2013 Free Software Foundation, Inc.
# Copyright (C) 2010-2016 Gary V. Vaughan
# This file is part of luaposix.
# See README for license.
......@@ -10,6 +10,16 @@
## Configuration. ##
## -------------- ##
# List of programs, minimum versions, and download urls required to
# bootstrap, maintain and release this project.
buildreq='
git - http://git-scm.com
help2man 1.29 http://www.gnu.org/s/help2man
ldoc 1.4.2 http://rocks.moonscript.org/manifests/steved/ldoc-1.4.2-1.rockspec
specl 14.1.0 http://rocks.moonscript.org/manifests/gvvaughan/specl-14.1.0-1.rockspec
'
# List of slingshot files to link into stdlib tree before autotooling.
slingshot_files='
.autom4te.cfg
......@@ -22,53 +32,23 @@ slingshot_files='
build-aux/rockspecs.mk
build-aux/sanity.mk
build-aux/specl.mk
m4/ax_compare_version.m4
build-aux/update-copyright
m4/ax_lua.m4
m4/slingshot.m4
m4/manywarnings.m4
m4/warnings.m4
travis.yml.in
'
# Additional gnulib-tool options to use.
gnulib_tool_options='
--no-changelog
--avoid=dummy
# Prequisite rocks that need to be installed for travis builds to work.
travis_extra_rocks='
ansicolors
ldoc
specl
'
# gnulib modules used by this package.
gnulib_modules='
warnings
manywarnings
'
# Extra gnulib files that are not in modules, which override files of
# the same name installed by other bootstrap tools.
gnulib_non_module_files='
doc/INSTALL
build-aux/config.guess
build-aux/config.sub
build-aux/install-sh
'
# We don't actually use any gnulib C code, but that's no reason to
# let the defaults nuke our lib directory!
source_base=unused
# The not-synced with gnulib warning is bogus until upstream adopts
# the saner bootstrap script.
require_bootstrap_uptodate=:
## -------------------------------- ##
## Source Slingshot customisations. ##
## -------------------------------- ##
# Integrate the Slingshot submodule bootstrap.
# Make sure that bootstrap.slingshot is sourced from the current
# directory if we were invoked with "sh bootstrap".
case $0 in
*/*) . "$0.slingshot" ;;
*) . ./"$0.slingshot" ;;
esac
# No need to do any gnulib-tooling here.
gnulib_tool=true
require_dotgitmodules=:
## --------------- ##
......@@ -80,67 +60,10 @@ esac
func_add_hook func_gnulib_tool func_ensure_changelog
# luaposix_ignore_gnulib_ignore
# ----------------------------
# gnulib-tool updates m4/.gitignore and lib/.gitignore, and keeping
# generated files under version control does not make sense. Since
# lib is entirely ignored, we only need to prepopulate the m4 ignore
# files with generated files not tracked by gnulib-tool.
luaposix_ignore_gnulib_ignore ()
{
$debug_cmd
$require_macro_dir
if test -f "$macro_dir/.gitignore" ; then
:
else
func_verbose "creating initial \`$macro_dir/.gitignore'"
cat > $macro_dir/.gitignore <<\EOF
# files created by bootstrap, but that gnulib doesn't track
*~
/.gitignore
/gnulib-cache.m4
/gnulib-comp.m4
/libtool.m4
/ltoptions.m4
/ltsugar.m4
/ltversion.m4
/lt~obsolete.m4
EOF
fi
}
func_add_hook func_prep luaposix_ignore_gnulib_ignore
# luaposix_remove_empty_lib
# -------------------------
# No need to maintain the always empty lib subdir.
luaposix_remove_empty_lib ()
{
$debug_cmd
rm -rf $source_base
}
func_add_hook func_gnulib_tool luaposix_remove_empty_lib
# luaposix_force_readme
# ---------------------
# Automake (without --foreign requires that README exists).
luaposix_force_readme ()
{
$debug_cmd
$LN_S README.md README 2>/dev/null
}
func_add_hook func_gnulib_tool luaposix_force_readme
# Local variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "# bootstrap.conf (luaposix) version "
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "$"
......
# bootstrap.slingshot (Slingshot) version 2013-05-06
#
# Copyright (C) 2013 Gary V. Vaughan
# Written by Gary V. Vaughan, 2013
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# 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 the Free Software Foundation; either version 3 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Libtool; see the file COPYING. If not, a copy
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
# or obtained by writing to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# For your project to work with subproject slingshot out of the box, you'll
# need to commit this file to your project's repository and source it from
# bootstrap.conf.
#
# case $0 in
# */*) . "$0.slingshot" ;;
# *) . ./"$0.slingshot" ;;
# esac
## -------------- ##
## Configuration. ##
## -------------- ##