commit 157344ba8439a536985179ba4fc33e6f274fa70d
Author: Jan Palus <[email protected]>
Date:   Sat Sep 3 19:05:20 2022 +0200

    use dynamic linking for jemalloc

 redis.spec            | 12 +++++-------
 system-jemalloc.patch | 14 ++++++++++++++
 2 files changed, 19 insertions(+), 7 deletions(-)
---
diff --git a/redis.spec b/redis.spec
index 6a213c6..17c7b60 100644
--- a/redis.spec
+++ b/redis.spec
@@ -1,11 +1,11 @@
 # TODO
 # - Check for status of man pages 
http://code.google.com/p/redis/issues/detail?id=202
-# - use shared jemalloc?
 #
 # Conditional build:
 %bcond_without tests           # build without tests
 %bcond_without perftools       # google perftools
 %bcond_without systemd         # systemd support
+%bcond_without system_jemalloc # use embedded jemalloc
 
 %ifnarch %{ix86} %{x8664} ppc
 # available only on selected architectures
@@ -27,9 +27,10 @@ Patch0:              %{name}.conf.patch
 Patch1:                %{name}-tcl.patch
 Patch2:                
0001-1st-man-pageis-for-redis-cli-redis-benchmark-redis-c.patch
 Patch3:                arm-arch-check.patch
+Patch4:                system-jemalloc.patch
 URL:           http://www.redis.io/
 %{?with_perftools:BuildRequires:    gperftools-devel}
-BuildRequires: jemalloc-static
+BuildRequires: jemalloc-devel
 %ifarch %{arm}
 BuildRequires: libatomic-devel
 %endif
@@ -83,6 +84,7 @@ disk.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
 
 # Remove integration tests
 %{__sed} -i -e '/    integration\/replication/d' tests/test_helper.tcl
@@ -92,11 +94,7 @@ disk.
 port=$((21110 + ${RANDOM:-$$} % 1000))
 sed -i -e "s/set ::port 21111/set ::port $port/" tests/test_helper.tcl
 
-# use system jemalloc
-mv deps/jemalloc{,-local}
-install -d deps/jemalloc
-ln -s %{_libdir} deps/jemalloc/lib
-ln -s %{_includedir} deps/jemalloc/include
+%{__rm} -r deps/jemalloc
 
 %build
 %define specflags -std=c99 -pedantic
diff --git a/system-jemalloc.patch b/system-jemalloc.patch
new file mode 100644
index 0000000..5121c88
--- /dev/null
+++ b/system-jemalloc.patch
@@ -0,0 +1,14 @@
+--- redis-6.2.5/src/Makefile.orig      2021-07-21 20:06:49.000000000 +0200
++++ redis-6.2.5/src/Makefile   2022-09-03 18:49:53.269090855 +0200
+@@ -229,9 +227,8 @@
+ endif
+ 
+ ifeq ($(MALLOC),jemalloc)
+-      DEPENDENCY_TARGETS+= jemalloc
+-      FINAL_CFLAGS+= -DUSE_JEMALLOC -I../deps/jemalloc/include
+-      FINAL_LIBS := ../deps/jemalloc/lib/libjemalloc.a $(FINAL_LIBS)
++      FINAL_CFLAGS+= -DUSE_JEMALLOC $(shell $(PKG_CONFIG) --cflags jemalloc)
++      FINAL_LIBS := $(FINAL_LIBS) $(shell $(PKG_CONFIG) --libs jemalloc)
+ endif
+ 
+ ifeq ($(BUILD_TLS),yes)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/redis.git/commitdiff/d3c8224c535a54a3951166cdb0e91bf7beb2bda4

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to