aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Harrison <adamdharrison@gmail.com>2022-12-04 16:50:53 -0500
committerAdam Harrison <adamdharrison@gmail.com>2022-12-04 16:50:53 -0500
commit99fff188e86e8f45b56fefe301f7ceba365bd6ad (patch)
tree80d7284fc02173a166f0cbaf128bfa02950b753a
parent50ceefd226c785bd7226e66ed42c7ea499fb0480 (diff)
downloadlite-xl-plugin-manager-99fff188e86e8f45b56fefe301f7ceba365bd6ad.tar.gz
lite-xl-plugin-manager-99fff188e86e8f45b56fefe301f7ceba365bd6ad.zip
Moved things over to LPM_STATIC, rather than LPM_LIVE.
-rw-r--r--.github/workflows/build.yml4
-rw-r--r--README.md8
-rwxr-xr-xbuild.sh2
-rw-r--r--src/lpm.c4
4 files changed, 9 insertions, 9 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index c1ae21c..809802b 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -14,7 +14,7 @@ jobs:
run: git submodule update --init --depth=1
- name: Build Linux
run: |
- SSL_CONFIGURE="no-tests" ./build.sh -DLPM_VERSION='"'$VERSION-x86_64-linux-`git rev-parse --short HEAD`'"' && tar -czvf lpm-$VERSION-x86_64-linux.tar.gz lpm
+ SSL_CONFIGURE="no-tests" ./build.sh -DLPM_STATIC -DLPM_VERSION='"'$VERSION-x86_64-linux-`git rev-parse --short HEAD`'"' && tar -czvf lpm-$VERSION-x86_64-linux.tar.gz lpm
cp lpm lpm.x86_64-linux
cp lpm /tmp/lpm
- name: Package Debian/Ubuntu
@@ -26,7 +26,7 @@ jobs:
dpkg-deb --build --root-owner-group $NAME
- name: Build Windows
run: |
- sudo apt-get install mingw-w64 && ./build.sh clean && CC=x86_64-w64-mingw32-gcc AR=x86_64-w64-mingw32-gcc-ar WINDRES=x86_64-w64-mingw32-windres CMAKE_DEFAULT_FLAGS="-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=NEVER -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_INCLUDE_PATH=/usr/share/mingw-w64/include" LZMA_CONFIGURE="--host=x86_64-w64-mingw32" GIT2_CONFIGURE="-DDLLTOOL=x86_64-w64-mingw32-dlltool" ./build.sh -DLPM_VERSION='"'$VERSION-x86_64-windows-`git rev-parse --short HEAD`'"' && zip -r lpm-$VERSION-x86_64-windows.zip lpm.exe
+ sudo apt-get install mingw-w64 && ./build.sh clean && CC=x86_64-w64-mingw32-gcc AR=x86_64-w64-mingw32-gcc-ar WINDRES=x86_64-w64-mingw32-windres CMAKE_DEFAULT_FLAGS="-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=NEVER -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_INCLUDE_PATH=/usr/share/mingw-w64/include" LZMA_CONFIGURE="--host=x86_64-w64-mingw32" GIT2_CONFIGURE="-DDLLTOOL=x86_64-w64-mingw32-dlltool" ./build.sh -DLPM_STATIC -DLPM_VERSION='"'$VERSION-x86_64-windows-`git rev-parse --short HEAD`'"' && zip -r lpm-$VERSION-x86_64-windows.zip lpm.exe
cp lpm.exe lpm.x86_64-windows.exe
- name: Run Tests
run: |
diff --git a/README.md b/README.md
index 380fa5c..61e45fa 100644
--- a/README.md
+++ b/README.md
@@ -34,13 +34,13 @@ If you want to build it quickly, and have the right modules installed, you can
do:
```
-./build.sh -DLPM_LIVE=1 -lgit2 -lzip -llua -lm -lmbedtls -lmbedx509 -lmbedcrypto -lz
+./build.sh -lgit2 -lzip -llua -lm -lmbedtls -lmbedx509 -lmbedcrypto -lz
```
OR
```
-gcc -DLPM_LIVE=1 src/lpm.c lib/microtar/src/microtar.c -Ilib/microtar/src -lz -lgit2 \
+gcc src/lpm.c lib/microtar/src/microtar.c -Ilib/microtar/src -lz -lgit2 \
-lzip -llua -lm -lmbedtls -lmbedx509 -lmbedcrypto -o lpm
```
@@ -87,7 +87,7 @@ lpm --help
### Linux
```
-./build.sh -DLPM_VERSION='"'0.1-x86_64-linux-`git rev-parse --short HEAD`'"'
+./build.sh -DLPM_STATIC -DLPM_VERSION='"'0.1-x86_64-linux-`git rev-parse --short HEAD`'"'
```
### Linux to Windows
@@ -95,7 +95,7 @@ lpm --help
```
CC=x86_64-w64-mingw32-gcc AR=x86_64-w64-mingw32-gcc-ar WINDRES=x86_64-w64-mingw32-windres CMAKE_DEFAULT_FLAGS="-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER\
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=NEVER -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_INCLUDE_PATH=/usr/share/mingw-w64/include"\
- GIT2_CONFIGURE="-DDLLTOOL=x86_64-w64-mingw32-dlltool" ./build.sh -DLPM_VERSION='"'$VERSION-x86_64-windows-`git rev-parse --short HEAD`'"'
+ GIT2_CONFIGURE="-DDLLTOOL=x86_64-w64-mingw32-dlltool" ./build.sh -DLPM_STATIC -DLPM_VERSION='"'$VERSION-x86_64-windows-`git rev-parse --short HEAD`'"'
```
## Tests
diff --git a/build.sh b/build.sh
index 3e070c0..2c7b497 100755
--- a/build.sh
+++ b/build.sh
@@ -36,7 +36,7 @@ fi
[[ "$@" != *"-llua"* ]] && CFLAGS="$CFLAGS -Ilib/lua -DMAKE_LIB=1" && SRCS="$SRCS lib/lua/onelua.c"
# Build the pre-packaged lua file into the executbale.
-if [[ "$@" != *"-DLPM_LIVE" ]]; then
+if [[ "$@" == *"-DLPM_STATIC"* ]]; then
[[ ! -e "lua.exe" ]] && gcc -Ilib/lua -o lua.exe lib/lua/onelua.c -lm
./lua.exe -e 'io.open("src/lpm.luac", "wb"):write(string.dump(assert(loadfile("src/lpm.lua"))))'
xxd -i src/lpm.luac > src/lpm.lua.c
diff --git a/src/lpm.c b/src/lpm.c
index b19b11d..076f5ef 100644
--- a/src/lpm.c
+++ b/src/lpm.c
@@ -831,7 +831,7 @@ static const luaL_Reg system_lib[] = {
#endif
-#ifndef LPM_LIVE
+#ifdef LPM_STATIC
extern const char src_lpm_luac[];
extern unsigned int src_lpm_luac_len;
#endif
@@ -861,7 +861,7 @@ int main(int argc, char* argv[]) {
lua_setglobal(L, "PLATFORM");
lua_pushliteral(L, LITE_ARCH_TUPLE);
lua_setglobal(L, "ARCH");
- #ifdef LPM_LIVE
+ #ifndef LPM_STATIC
if (luaL_loadfile(L, "src/lpm.lua") || lua_pcall(L, 0, 1, 0)) {
#else
if (luaL_loadbuffer(L, src_lpm_luac, src_lpm_luac_len, "lpm.lua") || lua_pcall(L, 0, 1, 0)) {