SHA256
10
0
forked from pool/lua-luaposix

Accepting request 515964 from home:eeich:branches:devel:languages:lua

- Updating to version 3.4:
  * Incompatible Changes  Incompatible Changes
    posix.syslog constants LOG_AUTHPRIV, LOG_FTP and LOG_SYSLOG are no longer 
    documented, and only defined when supported by the host C library. They are
    not part of the POSIX API, and prevented compilation of luaposix on AIX and
    Solaris.
    getopt.getopt was a binding to the GNU getopt_long extension, which is not 
    a POSIX API, and prevents luaposix from compiling on hosts that do not 
    provide the extended API. Instead we now correctly bind POSIX getopt(3) in 
    posix.unistd.
  * New Features
    Replaced all Autotools and supporting Slingshot code with new Lua- based 
    build-aux/luke and lukefile describing how to compile and install 
    everything. Building with LuaRocks now leverages this too.
    New posix.sys.socket.getsockopt and posix.sys.socket.getpeername bindings.
    New posix.sys.msg.msgctl binding, and posix.sys.msg.IPC_RMID, 
    posix.sys.msg.IPC_SET and posix.sys.msg.IPC_STAT constants to use with it.
    New posix.unistd.ftruncate and posix.unistd.truncate bindings.
    posix.fcntl.fcntl now accepts undocumented posix.fcntl.O_TMPFILE value 
    where supported by the host C library.
  * Bugs Fixed
    posix.unistd.ttyname now returns an error message in addition to nil when 
    it fails.
  * maint-sync-luke-with-upstream.patch:
    Backported from upstream to make this build and install with the 'luke'
    version included.

- Fix provides/obsoletes for the old package name.

OBS-URL: https://build.opensuse.org/request/show/515964
OBS-URL: https://build.opensuse.org/package/show/devel:languages:lua/lua-luaposix?expand=0&rev=16
This commit is contained in:
2017-08-10 16:18:22 +00:00
committed by Git OBS Bridge
parent 14f2aeff4f
commit e0e1243520
5 changed files with 197 additions and 36 deletions

View File

@@ -1,3 +1,38 @@
-------------------------------------------------------------------
Thu Aug 10 16:00:15 UTC 2017 - eich@suse.com
- Updating to version 3.4:
* Incompatible Changes Incompatible Changes
posix.syslog constants LOG_AUTHPRIV, LOG_FTP and LOG_SYSLOG are no longer
documented, and only defined when supported by the host C library. They are
not part of the POSIX API, and prevented compilation of luaposix on AIX and
Solaris.
getopt.getopt was a binding to the GNU getopt_long extension, which is not
a POSIX API, and prevents luaposix from compiling on hosts that do not
provide the extended API. Instead we now correctly bind POSIX getopt(3) in
posix.unistd.
* New Features
Replaced all Autotools and supporting Slingshot code with new Lua- based
build-aux/luke and lukefile describing how to compile and install
everything. Building with LuaRocks now leverages this too.
New posix.sys.socket.getsockopt and posix.sys.socket.getpeername bindings.
New posix.sys.msg.msgctl binding, and posix.sys.msg.IPC_RMID,
posix.sys.msg.IPC_SET and posix.sys.msg.IPC_STAT constants to use with it.
New posix.unistd.ftruncate and posix.unistd.truncate bindings.
posix.fcntl.fcntl now accepts undocumented posix.fcntl.O_TMPFILE value
where supported by the host C library.
* Bugs Fixed
posix.unistd.ttyname now returns an error message in addition to nil when
it fails.
* maint-sync-luke-with-upstream.patch:
Backported from upstream to make this build and install with the 'luke'
version included.
-------------------------------------------------------------------
Thu Aug 10 15:20:46 UTC 2017 - eich@suse.com
- Fix provides/obsoletes for the old package name.
-------------------------------------------------------------------
Thu Jul 13 18:40:56 UTC 2017 - tchvatal@suse.com

View File

@@ -17,21 +17,24 @@
%define flavor @BUILD_FLAVOR@
%define mod_name luaposix
Version: 33.3.1
Version: 34.0
Release: 0
Summary: POSIX library for Lua
License: MIT
Group: Development/Libraries/Other
Url: https://github.com/luaposix/luaposix
Source0: https://github.com/luaposix/luaposix/archive/release-v%{version}.tar.gz#/%{mod_name}-%{version}.tar.gz
Source0: https://github.com/luaposix/luaposix/archive/v%{version}.tar.gz#/%{mod_name}-%{version}.tar.gz
Patch: maint-sync-luke-with-upstream.patch
BuildRequires: %{flavor}-devel
BuildRequires: ncurses-devel
BuildRequires: perl
Requires: %{flavor}
%if "%{flavor}" == "lua53"
Provides: lua-%{_name} = %{version}
Obsoletes: lua-%{_name} < %{version}
Provides: lua-%{mod_name} = %{version}
Obsoletes: lua-%{mod_name} < %{version}
%endif
%if "%{flavor}" == ""
Name: lua-%{mod_name}
@@ -50,44 +53,25 @@ Group: Documentation/HTML
BuildArch: noarch
%description -n %{mod_name}-doc
This package contains the documentation for %{_flavor}-luaposix.
This package contains the documentation for %{flavor}-luaposix.
%prep
%setup -q -n luaposix-release-v%{version}
%setup -q -n luaposix-%{version}
%patch -p1
%build
%configure \
--disable-silent-rules \
--libexecdir=%{lua_archdir} \
--libdir=%{lua_archdir} \
--datadir=%{lua_noarchdir} \
--docdir=%{_docdir}/%{mod_name}
make %{?_smp_mflags}
build-aux/luke PREFIX=%{_prefix} all
%install
%make_install
rm -f %{buildroot}%{lua_archdir}/*.la
%check
make %{?_smp_mflags} check
build-aux/luke PREFIX=%{buildroot}%{_prefix} INST_LIBDIR=%{buildroot}%{lua_archdir} \
INST_LUADIR=%{buildroot}%{lua_noarchdir} install
%files
%doc README ChangeLog NEWS
%dir %{lua_noarchdir}/posix
%{lua_archdir}/*.so
%{lua_noarchdir}/*.lua
%{lua_noarchdir}/posix/*.lua
%doc README.md NEWS.md LICENSE AUTHORS
%{lua_archdir}/posix
%{lua_noarchdir}/posix
%files -n %{mod_name}-doc
%dir %{_docdir}/%{mod_name}
%dir %{_docdir}/%{mod_name}/examples
%dir %{_docdir}/%{mod_name}/modules
%dir %{_docdir}/%{mod_name}/classes
%doc %{_docdir}/%{mod_name}/classes/posix.curses.*.html
%doc %{_docdir}/%{mod_name}/examples/*.lua.html
%doc %{_docdir}/%{mod_name}/modules/posix.*.html
%doc %{_docdir}/%{mod_name}/modules/posix.html
%doc %{_docdir}/%{mod_name}/index.html
%doc %{_docdir}/%{mod_name}/ldoc.css
%doc doc/*
%changelog

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:49e1eda64d0c03d0f2977fc1e04ce8c620dc3bb9a5c54c342904751d21b1b3cf
size 692452

3
luaposix-34.0.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ebe638078b9a72f73f0b9b8ae959032e5590d2d6b303e59154be1fb073563f71
size 172330

View File

@@ -0,0 +1,142 @@
From: Gary V. Vaughan <gary@gnu.org>
Date: Sun May 14 21:10:22 2017 -0700
Subject: maint: sync luke with upstream
Patch-mainline: Upstream
Git-repo: https://github.com/luaposix/luaposix
Git-commit: b13a9e68103ca2c868f63cdb00c7c18bdd9c11c7
References:
Closes #278.
* build-aux/luke: fixes for greedy option '=', and concat nil value
error, among others.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
Signed-off-by: Egbert Eich <eich@suse.de>
---
build-aux/luke | 47 ++++++++++++++++++++---------------------------
1 file changed, 20 insertions(+), 27 deletions(-)
diff --git a/build-aux/luke b/build-aux/luke
index fc9f258..4c7a702 100755
--- a/build-aux/luke
+++ b/build-aux/luke
@@ -44,12 +44,12 @@ stderr:write('luke: error: '..msg..'\n')stderr:write("luke: try '"..arg[0].." --
local function display(...)return stdout:write(concat{...})end
local function dump(...)return stderr:write(' DEBUG: "'..concat(map(list(...),str))..'"\n')end
local function interpolate_to_substitute(s)return(gsub(s,'%$([%w_]+)','@%1@'))end
-return{parse_arguments=function(args)local clidefs,fname,targets,install={},'lukefile',{},{}local verbose,write,debug=nop,display,nop
-map(args,function(opt)case(opt,{['--debug']=function()debug=dump
+return{parse_arguments=function(args)local clidefs,fname,targets,install={},'lukefile',{},{}local verbose,write,log=nop,display,nop
+map(args,function(opt)case(opt,{['--debug']=function()log=dump
end,['--file=(.+)']=function(optarg)fname=optarg
end,['--quiet']=function()write=nop
end,['--verbose']=function()verbose=display
-end,['--help']=help,['--version']=version,['(.+)=(.+)']=function(name,value)clidefs[name]=value
+end,['--help']=help,['--version']=version,['([^=]+)=(.+)']=function(name,value)clidefs[name]=value
end,function(opt)if match(opt,'^-')~=nil then
opterr(format("unrecognized option '%s'",opt))end
append(targets,opt)end,})end)local luke,err=loadluke(fname)if luke==nil then
@@ -69,7 +69,7 @@ luke.modules=build
if isempty(luke.modules)then
luke.external_dependencies=nil
end
-luke.substitute=merge(luke.substitute or{},{package=interpolate_to_substitute(luke.package),version=interpolate_to_substitute(luke.version),})luke.variables=merge(luke.variables or{},collect_variables(luke),{LUA_DIR='/usr',LUA_BINDIR='$LUA_DIR/bin',LUA_INCDIR='$LUA_DIR/include/lua$LUAVERSION',LUA_LIBDIR='$LUA_DIR/lib',objdir=platforms[1],package=luke.package,version=luke.version,})return{clidefs=clidefs,install=install,debug=debug,luke=luke,verbose=verbose,write=write,}end,}
+luke.substitute=merge(luke.substitute or{},{package=interpolate_to_substitute(luke.package),version=interpolate_to_substitute(luke.version),})luke.variables=merge(luke.variables or{},collect_variables(luke),{LUA_DIR='/usr',LUA_BINDIR='$LUA_DIR/bin',LUA_INCDIR='$LUA_DIR/include/lua$LUAVERSION',LUA_LIBDIR='$LUA_DIR/lib',objdir=platforms[1],package=luke.package,version=luke.version,})return{clidefs=clidefs,install=install,log=log,luke=luke,verbose=verbose,write=write,}end,}
end
package.preload['luke.compile']=function()
local _ENV=require'std.normalize'{'luke._base','luke.environment','std.functional','type.context-manager',SHELLMETACHARS='[%s%$"]',}local function spawn(env,...)local command=interpolate(env,concat({...},' '))return with(TmpFile(),TmpFile(),function(out,err)local pipe=concat{command,' >',out.filename,' 2>',err.filename,'; printf $?'}return int(slurp(Pipe(pipe))),slurp(File(err.filename)),slurp(File(out.filename))end)end
@@ -102,7 +102,11 @@ return status
end)end,libdirs=libdirs,run_command=run,spawn=spawn,}
end
package.preload['luke.configure']=function()
-local _ENV=require'std.normalize'{'luke._base','luke.compile','luke.environment','std.functional','type.context-manager','type.dict',CCPROGS={'cc','gcc','clang'},}local function checking(L,...)L.verbose('checking ',concat({...},' '),'... ')end
+local _ENV=require'std.normalize'{'luke._base','luke.compile','luke.environment','std.functional','type.context-manager','type.dict',CCPROGS={'cc','gcc','clang'},}local function logspawn(L,env,...)local status,err=spawn(env,...)if status~=0 and err~=''then
+L.log(err)end
+return status
+end
+local function checking(L,...)L.verbose('checking ',concat({...},' '),'... ')end
local function found_library(L,x)if x==nil or x==''then
L.verbose'none required'else
L.verbose(x)end
@@ -110,19 +114,16 @@ L.verbose'\n'return x
end
local function found_prog(L,x)L.verbose(x and'yes\n'or'no\n')return x
end
-local function found_result(L,x)L.verbose(x==1 and'yes\n'or'no\n')return x
+local function found_result(L,x)L.verbose(x==0 and'yes\n'or'no\n')return x~=0 and 0 or 1
end
local function bindirs(...)return map(flatten(...),function(v)return v..':'end)end
-local function compile_command(L,env,config,filename)local command=flatten('$CC','-c','$CFLAGS',incdirs(config.incdir),'$CPPFLAGS',filename)L.debug(interpolate(env,concat(command,' ')))return unpack(command)end
-local function link_command(L,env,config,a_out,source,lib)local command=flatten('$CC','$CFLAGS',incdirs(config.incdir),'$CPPFLAGS','-o',a_out,source,libdirs(config.libdir),'$LDFLAGS','$libs',CONFIGENV.libs,lib)L.debug(interpolate(env,concat(command,' ')))return unpack(command)end
+local function compile_command(L,env,config,filename)local command=flatten('$CC','-c','$CFLAGS',incdirs(config.incdir),'$CPPFLAGS',filename)L.log(interpolate(env,concat(command,' ')))return unpack(command)end
+local function link_command(L,env,config,a_out,source,lib)local command=flatten('$CC','$CFLAGS',incdirs(config.incdir),'$CPPFLAGS','-o',a_out,source,libdirs(config.libdir),'$LDFLAGS','$libs',CONFIGENV.libs,lib)L.log(interpolate(env,concat(command,' ')))return unpack(command)end
local function check_executable_in_path(L,env,config,prog)local PATH=concat(bindirs(config.bindir))..getenv('PATH')local found=dropuntil(gmatch(PATH,'[^:]+'),function(path)local progpath=path..'/'..prog
return with(File(progpath,'r'),function(h)return isfile(h.context)and progpath or nil
-end)end)L.debug('found '..found)return found~=nil
+end)end)L.log(found and'found '..found or prog..' not found')return found~=nil
end
-local function check_header_compile(L,env,config,header,extra_hdrs)return with(CTest(),function(conftest)conftest:write(format('%s\n#include "%s"\n',extra_hdrs,header))local status,err=spawn(env,compile_command(L,env,config,conftest.filename))if status~=0 and err~=''then
-L.debug(err)end
-return 0==status and 1 or 0
-end)end
+local function check_header_compile(L,env,config,header,extra_hdrs)return with(CTest(),function(conftest)conftest:write(format('%s\n#include "%s"\n',extra_hdrs,header))return logspawn(L,env,compile_command(L,env,config,conftest.filename))end)end
local function try_link(L,env,config,lib,symbol)return with(CTest(),TmpFile(),function(conftest,a_out)conftest:write(format([[
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
@@ -131,10 +132,7 @@ char %s ();
int main () {
return %s ();
}
-]],symbol,symbol))local status,err=spawn(env,link_command(L,env,config,a_out.filename,conftest.filename,lib))if status~=0 and err~=''then
-L.debug(err)end
-return status
-end)end
+]],symbol,symbol))return logspawn(L,env,link_command(L,env,config,a_out.filename,conftest.filename,lib))end)end
local function check_func_decl(L,env,config,fname,extra_hdrs)return with(CTest(),function(conftest)conftest:write(format([[
%s
int
@@ -145,10 +143,7 @@ main()
#endif
return 0;
}
-]],extra_hdrs,fname,fname))local status,err=spawn(env,compile_command(L,env,config,conftest.filename))if status~=0 and err~=''then
-L.debug(err)end
-return 0==status and 1 or 0
-end)end
+]],extra_hdrs,fname,fname))return logspawn(L,env,compile_command(L,env,config,conftest.filename))end)end
local function check_func_link(L,env,config,fname)return with(CTest(),TmpFile(),function(conftest,a_out)conftest:write(format([[
/* Define to an innocous variant, in case <limits.h> declares it.
For example, HP-UX 11i <limits,h> declares gettimeofday. */
@@ -182,10 +177,7 @@ choke me
int main () {
return %s ();
}
-]],fname,fname,fname,fname,fname,fname,fname))local status,err=spawn(env,link_command(L,env,config,a_out.filename,conftest.filename))if status~=0 and err~=''then
-L.debug(err)end
-return 0==status and 1 or 0
-end)end
+]],fname,fname,fname,fname,fname,fname,fname))return logspawn(L,env,link_command(L,env,config,a_out.filename,conftest.filename))end)end
local function add_external_deps(env,config,prefix)if prefix~=nil then
for k,v in next,{bindir='$%s_BINDIR',incdir='$%s_INCDIR',libdir='$%s_LIBDIR'}do
local envvar=interpolate(env,format(v,prefix))if envvar~=''then
@@ -194,10 +186,11 @@ end
end
end
end
+local function format_includes(includes)return map(includes or{},function(include)return format('#include "%s"',include)end)end
local configure=setmetatable(OrderedDict({checkprog=function(L,env,config)return dropuntil(config.progs,function(prog)checking(L,'for',prog)if found_prog(L,check_executable_in_path(L,env,config,prog))then
return prog
end
-end)or fatal('cannot find '..config.checkprog)end},{checkheader=function(L,env,config)checking(L,'for',config.checkheader)local extra_hdrs=map(config.includes or{},function(include)return format('#include "%s"',include)end)return found_result(L,check_header_compile(L,env,config,config.checkheader,concat(extra_hdrs,'\n')))end},{checkdecl=function(L,env,config)checking(L,'whether',config.checkdecl,'is declared')local extra_hdrs=map(config.includes or{},function(include)return format('#include "%s"',include)end)return found_result(L,check_func_decl(L,env,config,config.checkdecl,concat(extra_hdrs,'\n')))end},{checksymbol=function(L,env,config)checking(L,'for library containing',config.checksymbol)local libraries,symbol=config.libraries,config.checksymbol
+end)or fatal('cannot find '..config.checkprog)end},{checkheader=function(L,env,config)checking(L,'for',config.checkheader)local extra_hdrs=concat(format_includes(config.includes),'\n')return found_result(L,check_header_compile(L,env,config,config.checkheader,extra_hdrs))end},{checkdecl=function(L,env,config)checking(L,'whether',config.checkdecl,'is declared')local extra_hdrs=concat(format_includes(config.includes),'\n')return found_result(L,check_func_decl(L,env,config,config.checkdecl,extra_hdrs))end},{checksymbol=function(L,env,config)checking(L,'for library containing',config.checksymbol)local libraries,symbol=config.libraries,config.checksymbol
local trylibs=reduce(libraries,{''},function(r,lib)append(r,'-l'..lib)end)local lib=dropuntil(trylibs,function(lib)if try_link(L,env,config,lib,symbol)==0 then
if lib~=''then
if CONFIGENV.libs~=''then
@@ -208,7 +201,7 @@ end
return found_library(L,lib)end
end)or call(function()L.verbose'\n'fatal("required symbol '%s' not found in any of libc, lib%s",symbol,concat(libraries,', lib'))end)return{library=gsub(lib,'^-l','')}end},{checkfunc=function(L,env,config)checking(L,'for',config.checkfunc)return found_result(L,check_func_link(L,env,config,config.checkfunc))end}),{__call=function(self,L,env,config,prefix)return case(type(config),{['number']=function()return str(config)end,['string']=function()return config
end,['table']=function()return dropuntil(self,function(fname)if config[fname]~=nil then
-add_external_deps(env,config,prefix)return apply(self[fname],{L,env,config})end
+add_external_deps(env,config,prefix)return apply(self[fname],list(L,env,config))end
end)or fatal("unable to configure with keys '%s'",concat(keys(config),"', '"))end,function(type)fatal("unsupported configure type '%s'",type)end,})end,})return{config_compiler=function(L,env)local CC=env.CC
if CC==nil then
CC=configure(L,env,{checkprog='C compiler',progs=CCPROGS})env=makeenv(env,{CC=CC})end