Hi,

> redis: Please use system lua to avoid embedded code copy

WIP patch attached. The problem is the embedded code copies of the lua-
struct and lua-cmsgpack libraries.


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      la...@debian.org / chris-lamb.co.uk
       `-
From eb205c10dca4a5bf4f52746f43fe5d135059e8f7 Mon Sep 17 00:00:00 2001
From: Chris Lamb <la...@debian.org>
Date: Sun, 22 Jul 2018 20:10:42 +0800
Subject: [PATCH] Use the system version of Lua to avoid embedded code copy.
 (Closes: #901669)

---
 debian/control                                |  2 +
 .../0010-Use-system-Lua-Closes-901669.patch   | 40 +++++++++++++++++++
 debian/patches/series                         |  1 +
 3 files changed, 43 insertions(+)
 create mode 100644 debian/patches/debian-packaging/0010-Use-system-Lua-Closes-901669.patch

diff --git a/debian/control b/debian/control
index 8415f4e6..c9b4528b 100644
--- a/debian/control
+++ b/debian/control
@@ -6,6 +6,8 @@ Build-Depends:
  debhelper (>= 11~),
  dpkg-dev (>= 1.17.14),
  libjemalloc-dev [linux-any],
+ liblua5.1-dev,
+ lua-cjson-dev,
  procps <!nocheck>,
  tcl <!nocheck>,
 Standards-Version: 4.1.5
diff --git a/debian/patches/debian-packaging/0010-Use-system-Lua-Closes-901669.patch b/debian/patches/debian-packaging/0010-Use-system-Lua-Closes-901669.patch
new file mode 100644
index 00000000..68feb0a0
--- /dev/null
+++ b/debian/patches/debian-packaging/0010-Use-system-Lua-Closes-901669.patch
@@ -0,0 +1,40 @@
+From: Chris Lamb <la...@debian.org>
+Date: Sun, 22 Jul 2018 20:09:48 +0800
+Subject: Use system Lua (Closes: #901669)
+
+---
+ src/Makefile | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/src/Makefile b/src/Makefile
+index c10186457652..cad5bda9e38c 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -16,7 +16,7 @@ release_hdr := $(shell sh -c './mkreleasehdr.sh')
+ uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+ uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')
+ OPTIMIZATION?=-O2
+-DEPENDENCY_TARGETS=hiredis linenoise lua
++DEPENDENCY_TARGETS=hiredis linenoise
+ NODEPS:=clean distclean
+ 
+ # Default settings
+@@ -107,7 +107,7 @@ endif
+ endif
+ endif
+ # Include paths to dependencies
+-FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src
++FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I/usr/include/lua5.1 -I/usr/include/lua5.1 -I../deps/lua/src
+ 
+ ifeq ($(MALLOC),tcmalloc)
+ 	FINAL_CFLAGS+= -DUSE_TCMALLOC
+@@ -195,7 +195,8 @@ endif
+ 
+ # redis-server
+ $(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ)
+-	$(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a $(FINAL_LIBS)
++	$(MAKE) -C ../deps/lua/src/ linux
++	$(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a -llua5.1 -llua5.1-cjson $(FINAL_LIBS)
+ 
+ # redis-sentinel
+ $(REDIS_SENTINEL_NAME): $(REDIS_SERVER_NAME)
diff --git a/debian/patches/series b/debian/patches/series
index 50b64e65..4e9b161f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,3 +7,4 @@ debian-packaging/0006-Drop-tests-with-timing-issues.patch
 debian-packaging/0007-Set-Debian-configuration-defaults.patch
 0009-Drop-memory-efficiency-tests-on-advice-from-upstream.patch
 0010-Use-get_current_dir_name-over-PATHMAX-etc.patch
+debian-packaging/0010-Use-system-Lua-Closes-901669.patch
-- 
2.18.0

Reply via email to