Skip to content

Commit

Permalink
Add lua-zip
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-creel committed Aug 23, 2024
2 parents e9fe72f + 2761dc6 commit a9feca0
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 17 deletions.
26 changes: 9 additions & 17 deletions build-openresty.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -69,28 +69,20 @@ git apply --verbose 0001-fix-link-with-vcpkg-static-openssl.patch
..\..\luarocks.bat make "CRYPTO_DIR=$vcpkg" "OPENSSL_DIR=$vcpkg"
cd ..\..


# zipwriter depends on struct, bit32, lua-zlib, luaossl
.\luarocks.bat install lua-zlib 1.2-2 "ZLIB_DIR=$vcpkg\lib" "ZLIB_INCDIR=$vcpkg\include"
.\luarocks.bat install bit32 5.3.5.1-1
.\luarocks.bat install struct 1.4-1
.\luarocks.bat install aesfileencrypt 0.1.3-1
.\luarocks.bat install zipwriter 0.1.5-1


.\luarocks.bat install fly-bgcrypto-sha 0.0.1-1
.\luarocks.bat install fly-bgcrypto-pbkdf2 0.0.1-1
.\luarocks.bat install lua-easy-crypto 1.0.0-1 # uses luossl to easily encrypt/decrypt files. not installing because need exactly luaossl 20171028-0


# .\luarocks.bat unpack zipwriter 0.1.5-1
# cd zipwriter-0.1.5-1
# cp "$patches\zipwriter\*" .\
# git init .
# git apply --verbose 0001-replace-luacrypto-with-luaossl.patch
# cd zipwriter
# ..\..\luarocks.bat make
# cd ..\..

.\luarocks.bat unpack lua-zip 0.2-0
cd lua-zip-0.2-0
cp "$patches\lua-zip\*" .\
git init .
git apply --verbose 0001-fix-deps.patch
cd lua-zip
..\..\luarocks.bat make "lua-zip-0.2-0.rockspec" "ZIP_DIR=$vcpkg"
cd ..\..

.\luarocks.bat unpack phpass 1.0-1
cd phpass-1.0-1
Expand Down
2 changes: 2 additions & 0 deletions build-vcpkg.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ if (!(Test-Path vcpkg.exe)) {
}

Invoke-VcpkgBuild "zlib"
Invoke-VcpkgBuild "libzip[core,default-aes,openssl,wincrypto]"
Invoke-VcpkgBuild "sqlite3"
Invoke-VcpkgBuild "boost-circular-buffer"
Invoke-VcpkgBuild "boost-random"
Expand All @@ -34,6 +35,7 @@ Invoke-VcpkgBuild "curl"
Invoke-VcpkgBuild "cryptlex"
Invoke-VcpkgBuild "gtest"


# export created libraries and set version
.\vcpkg.exe export --x-all-installed --raw --vcpkg-root .
Move-Item -Path .\vcpkg-export-* -Destination .\vcpkg
Expand Down
48 changes: 48 additions & 0 deletions openresty/patches/lua-zip/0001-fix-deps.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
From c7013f3287524591b61c3743f0396d89348e8f49 Mon Sep 17 00:00:00 2001
From: thomas-creel <[email protected]>
Date: Thu, 22 Aug 2024 22:41:22 -0400
Subject: [PATCH] fix-deps

---
lua-zip/lua-zip-0.2-0.rockspec | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/lua-zip/lua-zip-0.2-0.rockspec b/lua-zip/lua-zip-0.2-0.rockspec
index 0f45def..875b713 100644
--- a/lua-zip/lua-zip-0.2-0.rockspec
+++ b/lua-zip/lua-zip-0.2-0.rockspec
@@ -33,11 +33,30 @@ build = {
"$(ZIP_LIBDIR)"
},
libraries = {
- "zip"
+ "zip",
+ "zlib"
},
sources = {
"lua_zip.c"
}
}
+ },
+ platforms = {
+ windows = {
+ modules = {
+ ["brimworks.zip"] = {
+ libraries = {
+ "zip",
+ "zlib",
+ "advapi32",
+ "kernel32",
+ "user32"
+ },
+ defines = {
+ "ZIP_STATIC"
+ }
+ }
+ }
+ }
}
}
--
2.44.0.windows.1

0 comments on commit a9feca0

Please sign in to comment.