From e96e0a60e8fb4fc73a08f102e7536fee97ca43d6 Mon Sep 17 00:00:00 2001 From: ptrcnull <git@ptrcnull.me> Date: Wed, 7 Jun 2023 13:09:28 +0000 Subject: [PATCH] community/lua-turbo: always dlopen libssl.so.3 removes a weird sed hack in favour of amending the existing patch, which did the exact same thing, but had 'libssl.so.1.1' needed to make this work by default at all --- community/lua-turbo/APKBUILD | 17 +++++---------- community/lua-turbo/openssl-1.1.patch | 30 +++++++++++++++++++++++++-- 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/community/lua-turbo/APKBUILD b/community/lua-turbo/APKBUILD index e63e9d033983..e716eb23bfaa 100644 --- a/community/lua-turbo/APKBUILD +++ b/community/lua-turbo/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org> pkgname=lua-turbo pkgver=2.1.3 -pkgrel=9 +pkgrel=10 pkgdesc="framework built for LuaJIT 2 and Linux" url="https://github.com/kernelsauce/turbo" # ppc64le, riscv64 blocked by luajit @@ -26,15 +26,6 @@ source="$pkgname-$pkgver.tar.gz::https://github.com/kernelsauce/turbo/archive/v$ builddir="$srcdir/turbo-$pkgver" -prepare() { - default_prepare - # we need to fix the loading of libssl. - local _soname=$(scanelf --nobanner --soname /usr/lib/libssl.so | awk '{print $2}') - sed -i -e \ - "/ffi.load/s|\"ssl\")$|\"/usr/lib/$_soname\")|" \ - turbo/hash.lua turbo/crypto_linux.lua -} - build() { export LUAJIT_VERSION="$(pkgconf luajit --variable=version)" [ -z "$LUAJIT_VERSION" ] && die "LUAJIT_VERSION cannot be empty" @@ -54,9 +45,11 @@ package() { -o -name turbovisor -delete -o -name JSON.lua -delete } -sha512sums="c553478f3985d2b462a81a6a9555b911d50dab8fe790aa4185fc1fbc2b4af7e85418dc874d91a85fa38d57f2057acefb7d91996ae250a9a794d0d61055f95326 lua-turbo-2.1.3.tar.gz +sha512sums=" +c553478f3985d2b462a81a6a9555b911d50dab8fe790aa4185fc1fbc2b4af7e85418dc874d91a85fa38d57f2057acefb7d91996ae250a9a794d0d61055f95326 lua-turbo-2.1.3.tar.gz 2e91d5dda33b4bf09667fd23c80a471e93605125a820c440c2b1b022b8bce6ab065493473b153f1fa1863e9655f6413dbe42dc983260da4ed8bee3b2e3743ec2 lua-turbo.initd 3d2816738a2ee615bb6523b6b0aff12a51062e56ade5dbaa4b1b63afda8dce0a532c099b8a03fe67d589058ac8a7d49434a68fb28d93b167a56c56acc7596fdb lua-turbo.confd b3579e2a90dd0a50701f06f07de88e2398145c12df41c07c87a22e78bd159280b7e445b51c3a37f8314695abdcdc6f2045433a84d5c84be795d1bcbbbd6c8f97 0001-use-cjson-instead-of-JSON.lua.patch 724e78556296e58f4df8e089f782dba7d4387a26e6ab80f5585b65c35b97c460edf3fe2e6b33bc817fdb5eb5923fd0ae39054060c238dbd41a185b52a70b3949 default-luasocket.patch -6cc7c511f66f5d28b0a0799b22e6545dc2dce975539a446eff56ea0016f28116f6c777536b3d1a9e9c076e6db7b4ed75d7caa8a201efdd467b857a7342a6c2c0 openssl-1.1.patch" +d2e77962cf6098fe07ee3be92c2012ea0e59cbdd5d4f96f58f667474918c065a5bbeba44aab458878e86a228463ce57c396181952976899c7744a65993095426 openssl-1.1.patch +" diff --git a/community/lua-turbo/openssl-1.1.patch b/community/lua-turbo/openssl-1.1.patch index 1b33ea8bcd7b..5d58cc6fbb7f 100644 --- a/community/lua-turbo/openssl-1.1.patch +++ b/community/lua-turbo/openssl-1.1.patch @@ -1,3 +1,16 @@ +diff --git a/spec/hash_spec.lua b/spec/hash_spec.lua +index 9deab39..cc392b9 100644 +--- a/spec/hash_spec.lua ++++ b/spec/hash_spec.lua +@@ -15,7 +15,7 @@ + -- limitations under the License. + + local ffi = require "ffi" +-if pcall(ffi.load, "ssl") then ++if pcall(ffi.load, "/usr/lib/libssl.so.3") then + _G.TURBO_SSL = true + local turbo = require "turbo" + diff --git a/turbo/cdef.lua b/turbo/cdef.lua index 62895de..62830e7 100755 --- a/turbo/cdef.lua @@ -52,7 +65,7 @@ index 62895de..62830e7 100755 int SSL_set_fd(SSL *s, int fd); int SSL_accept(SSL *ssl); diff --git a/turbo/crypto_linux.lua b/turbo/crypto_linux.lua -index 1473022..54c07a9 100644 +index 1473022..b3ac229 100644 --- a/turbo/crypto_linux.lua +++ b/turbo/crypto_linux.lua @@ -23,7 +23,7 @@ require "turbo.cdef" @@ -60,7 +73,7 @@ index 1473022..54c07a9 100644 local crypto = {} -- crypto namespace -local lssl = ffi.load(os.getenv("TURBO_LIBSSL") or "ssl") -+local lssl = ffi.load(os.getenv("TURBO_LIBSSL") or "/usr/lib/libssl.so.1.1") ++local lssl = ffi.load(os.getenv("TURBO_LIBSSL") or "/usr/lib/libssl.so.3") local libtffi = util.load_libtffi() local EWOULDBLOCK, EINPROGRESS, ECONNRESET = @@ -144,3 +157,16 @@ index 1473022..54c07a9 100644 end return true end +diff --git a/turbo/hash.lua b/turbo/hash.lua +index fdbd63b..c2b0493 100644 +--- a/turbo/hash.lua ++++ b/turbo/hash.lua +@@ -31,7 +31,7 @@ local ffi = require "ffi" + local buffer = require "turbo.structs.buffer" + require "turbo.cdef" + +-local lssl = ffi.load(os.getenv("TURBO_LIBSSL") or "ssl") ++local lssl = ffi.load(os.getenv("TURBO_LIBSSL") or "/usr/lib/libssl.so.3") + + -- Buffers + local hexstr = buffer() -- GitLab