Skip to content

Commit 694fb24

Browse files
authored
docs: update README with luarocks installation instructions (#61)
Now that the modules are published to LuaRocks, the README must be updated with new instructions.
1 parent 1864ce8 commit 694fb24

File tree

1 file changed

+46
-16
lines changed

1 file changed

+46
-16
lines changed

README.md

Lines changed: 46 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,54 @@ Boost is fetched as part of the build process._
4646
Getting started
4747
-----------
4848

49-
Refer to the [SDK documentation](https://docs.launchdarkly.com/sdk/server-side/lua#getting-started) for instructions on getting started with using the SDK.
50-
51-
To compile the LuaRock modules:
52-
1. Install [LuaRocks](https://github.com/luarocks/luarocks/wiki/Download)
53-
2. Build the [C++ Server-side SDK](https://github.com/launchdarkly/cpp-sdks) from source using CMake, or obtain pre-built artifacts from the [releases page](https://github.com/launchdarkly/cpp-sdks/releases?q=%22launchdarkly-cpp-server%22)
54-
3. Run `luarocks make` (replace the version number as necessary):
55-
```bash
56-
# Base SDK
57-
luarocks make launchdarkly-server-sdk-2.0.2-0.rockspec \
58-
LD_DIR=./path-to-installed-cpp-sdk
59-
60-
# SDK with Redis
61-
luarocks make launchdarkly-server-sdk-redis-2.0.2-0.rockspec \
62-
LDREDIS_DIR=./path-to-installed-cpp-sdk
63-
```
49+
Refer to the [SDK documentation](https://docs.launchdarkly.com/sdk/server-side/lua#getting-started) for instructions on
50+
getting started with using the SDK.
51+
52+
There are two paths to installing the SDK. In both cases, you must first install the native
53+
[LaunchDarkly C++ Server-side SDK](https://github.com/launchdarkly/cpp-sdks).
54+
55+
You may build the C++ SDK from source using [CMake](https://cmake.org/), or obtain pre-built artifacts from the
56+
[releases page](https://github.com/launchdarkly/cpp-sdks/releases?q=%22launchdarkly-cpp-server%22). Ensure you install
57+
the correct variant (with or without Redis support) as necessary.
6458

6559
Please note that the Lua SDK uses the C++ server-side SDK's C bindings, so if you're using prebuilt artifacts
66-
then only a C99 compiler is necessary.
60+
then only a C99 compiler is necessary. See the [Build Requirements](https://github.com/launchdarkly/cpp-sdks#build-requirements).
61+
62+
63+
Then, install the [LuaRocks](https://github.com/luarocks/luarocks/wiki/Download) package manager.
64+
65+
### Install via `luarocks install`
66+
67+
The [LuaRocks project](https://luarocks.org) maintains a registry of Lua modules. You may install the SDK from
68+
the registry using `luarocks install`.
69+
70+
**Install the base SDK only**
71+
```bash
72+
luarocks install launchdarkly-server-sdk \
73+
LD_DIR=./path-to-cpp-sdk-installation
74+
```
75+
76+
**Install the base SDK with Redis support**
77+
```bash
78+
luarocks install launchdarkly-server-sdk-redis \
79+
LDREDIS_DIR=./path-to-cpp-sdk-with-redis-support-installation
80+
```
81+
82+
### Install via `luarocks make`
83+
84+
If you don't want to install from LuaRocks, it's possible to compile the modules locally using `luarocks make`.
85+
86+
**Install the base SDK only**
87+
```bash
88+
luarocks make launchdarkly-server-sdk-2.0.2-0.rockspec \
89+
LD_DIR=./path-to-installed-cpp-sdk
90+
```
91+
**Install the base SDK with Redis support**
92+
```bash
93+
luarocks make launchdarkly-server-sdk-redis-2.0.2-0.rockspec \
94+
LDREDIS_DIR=./path-to-cpp-sdk-with-redis-support-installation
95+
```
96+
6797

6898
Learn more
6999
-----------

0 commit comments

Comments
 (0)