aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.github/workflows/build.yml4
-rw-r--r--docs/installation.html70
-rw-r--r--makefile2
-rw-r--r--src/makefile27
4 files changed, 45 insertions, 58 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index c079a49..229fcbf 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -25,8 +25,10 @@ jobs:
25 uses: luarocks/gh-actions-lua@v10 25 uses: luarocks/gh-actions-lua@v10
26 with: 26 with:
27 luaVersion: ${{ matrix.luaVersion }} 27 luaVersion: ${{ matrix.luaVersion }}
28 buildCache: false
28 - name: Setup ‘luarocks’ 29 - name: Setup ‘luarocks’
29 uses: luarocks/gh-actions-luarocks@v5 30 # master branch until tagged release has luajit & msvcrt fixes
31 uses: luarocks/gh-actions-luarocks@master
30 - name: Make and install 32 - name: Make and install
31 run: | 33 run: |
32 luarocks make -- luasocket-scm-3.rockspec 34 luarocks make -- luasocket-scm-3.rockspec
diff --git a/docs/installation.html b/docs/installation.html
index 25c0bba..b56f50f 100644
--- a/docs/installation.html
+++ b/docs/installation.html
@@ -37,70 +37,30 @@ Installation">
37 37
38<!-- installation ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 38<!-- installation ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
39 39
40<h2>Installation</h2> 40<h2>Installation via luarocks</h2>
41
42<p> Here we describe the standard distribution. If the
43standard doesn't meet your needs, we refer you to the Lua
44discussion list, where any question about the package scheme
45will likely already have been answered. </p>
46
47<h3>Directory structure</h3>
48
49<p> On Unix systems, the standard distribution uses two base
50directories, one for system dependent files, and another for system
51independent files. Let's call these directories <tt>&lt;CDIR&gt;</tt>
52and <tt>&lt;LDIR&gt;</tt>, respectively.
53For example, in my laptp, Lua&nbsp;5.1 is configured to
54use '<tt>/usr/local/lib/lua/5.1</tt>' for
55<tt>&lt;CDIR&gt;</tt> and '<tt>/usr/local/share/lua/5.1</tt>' for
56<tt>&lt;LDIR&gt;</tt>. On Windows, <tt>&lt;CDIR&gt;</tt>
57usually points to the directory where the Lua executable is
58found, and <tt>&lt;LDIR&gt;</tt> points to a
59<tt>lua/</tt> directory inside <tt>&lt;CDIR&gt;</tt>. (These
60settings can be overridden by environment variables
61<tt>LUA_PATH</tt> and <tt>LUA_CPATH</tt>. See the Lua
62documentation for details.) Here is the standard LuaSocket
63distribution directory structure:</p>
64 41
65<pre class=example>
66&lt;LDIR&gt;/ltn12.lua
67&lt;LDIR&gt;/socket.lua
68&lt;CDIR&gt;/socket/core.dll
69&lt;LDIR&gt;/socket/http.lua
70&lt;LDIR&gt;/socket/tp.lua
71&lt;LDIR&gt;/socket/ftp.lua
72&lt;LDIR&gt;/socket/smtp.lua
73&lt;LDIR&gt;/socket/url.lua
74&lt;LDIR&gt;/mime.lua
75&lt;CDIR&gt;/mime/core.dll
76</pre>
77 42
78<p> Naturally, on Unix systems, <tt>core.dll</tt>
79would be replaced by <tt>core.so</tt>.
80</p>
81 43
82<h3>Using LuaSocket</h3> 44<p>LuaSocket can be easily installed using <a href="https://luarocks.org/" target="_blank">LuaRocks</a>, the Lua package manager.</p>
83 45
84<p> With the above setup, and an interpreter with shared library support, 46<h3>Installing via LuaRocks</h3>
85it should be easy to use LuaSocket. Just fire the interpreter and use the
86<tt>require</tt> function to gain access to whatever module you need:</p>
87 47
48<p>Run the following command in your terminal:</p>
88<pre class=example> 49<pre class=example>
89Lua 5.2.2 Copyright (C) 1994-2013 Lua.org, PUC-Rio 50luarocks install luasocket
90&gt; socket = require("socket")
91&gt; print(socket._VERSION)
92--&gt; LuaSocket 3.1.0
93</pre> 51</pre>
94 52
95<p> Each module loads their dependencies automatically, so you only need to 53<h3>Verification</h3>
96load the modules you directly depend upon: </p> 54 <p>To verify that LuaSocket is installed correctly, open Lua and run:</p>
55 <pre class=example><code>
56 local socket = require("socket")
57 print(socket._VERSION)
58 </code></pre>
97 59
98<pre class=example> 60<p>If you see output like <strong>LuaSocket 3.0</strong>, the installation was successful.</p>
99Lua 5.2.2 Copyright (C) 1994-2013 Lua.org, PUC-Rio 61
100&gt; http = require("socket.http") 62<h3>More Information</h3>
101&gt; print(http.request("http://www.impa.br/~diego/software/luasocket")) 63<p>For more details, visit the <a href="https://github.com/lunarmodules/luasocket" target="_blank">LuaSocket GitHub repository</a>.</p>
102--&gt; homepage gets dumped to terminal
103</pre>
104 64
105<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 65<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
106 66
diff --git a/makefile b/makefile
index 63d9985..227ad70 100644
--- a/makefile
+++ b/makefile
@@ -10,7 +10,7 @@
10# print print the build settings 10# print print the build settings
11 11
12PLAT?= linux 12PLAT?= linux
13PLATS= macosx linux win32 win64 mingw freebsd solaris 13PLATS= macosx linux win32 win64 mingw freebsd solaris ucrt64
14 14
15all: $(PLAT) 15all: $(PLAT)
16 16
diff --git a/src/makefile b/src/makefile
index 25b293c..868f98c 100644
--- a/src/makefile
+++ b/src/makefile
@@ -74,6 +74,13 @@ LUAPREFIX_mingw?=/usr
74CDIR_mingw?=lua/$(LUAV) 74CDIR_mingw?=lua/$(LUAV)
75LDIR_mingw?=lua/$(LUAV)/lua 75LDIR_mingw?=lua/$(LUAV)/lua
76 76
77# where lua headers are found for ucrt64 builds
78# LUAINC_ucrt64:
79LUAINC_ucrt64?=/ucrt64/include
80LUALIB_ucrt64?=/ucrt64/bin/lua$(subst .,,$(LUAV)).dll
81LUAPREFIX_ucrt64?=/ucrt64
82CDIR_ucrt64?=lib/lua/$(LUAV)
83LDIR_ucrt64?=share/lua/$(LUAV)
77 84
78# LUAINC_win32: 85# LUAINC_win32:
79# LUALIB_win32: 86# LUALIB_win32:
@@ -153,7 +160,7 @@ print:
153#------ 160#------
154# Supported platforms 161# Supported platforms
155# 162#
156PLATS= macosx linux win32 win64 mingw solaris 163PLATS= macosx linux win32 win64 mingw solaris ucrt64
157 164
158#------ 165#------
159# Compiler and linker settings 166# Compiler and linker settings
@@ -219,6 +226,21 @@ LDFLAGS_mingw= $(LUALIB) -shared -Wl,-s -lws2_32 -o
219LD_mingw=gcc 226LD_mingw=gcc
220SOCKET_mingw=wsocket.o 227SOCKET_mingw=wsocket.o
221 228
229#------
230# Compiler and linker settings
231# for ucrt64
232SO_ucrt64=dll
233O_ucrt64=o
234CC_ucrt64=gcc
235DEF_ucrt64= -DLUASOCKET_$(DEBUG) \
236 -DWINVER=0x0501
237CFLAGS_ucrt64= -I$(LUAINC) $(DEF) -Wall -O2 -fno-common
238# \
239 -fvisibility=hidden
240LDFLAGS_ucrt64= $(LUALIB) -shared -Wl,-s -lws2_32 -o
241LD_ucrt64=gcc
242SOCKET_ucrt64=wsocket.o
243
222 244
223#------ 245#------
224# Compiler and linker settings 246# Compiler and linker settings
@@ -384,6 +406,9 @@ linux:
384mingw: 406mingw:
385 $(MAKE) all PLAT=mingw 407 $(MAKE) all PLAT=mingw
386 408
409ucrt64:
410 $(MAKE) all PLAT=ucrt64
411
387solaris: 412solaris:
388 $(MAKE) all-unix PLAT=solaris 413 $(MAKE) all-unix PLAT=solaris
389 414