summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2025-08-06 15:32:49 +0200
committerRemi Collet <remi@php.net>2025-08-06 15:32:49 +0200
commit0f8fbb33ca003f55c76c90c059c951ae1eb49cca (patch)
tree8071518c7bf0915e5b8e8b53c8e869eaa245b68f
parentbb4d9fa6a29ae710046274703bb59a3ed5c7b24b (diff)
improve patch for offlilne build and submit upstream:HEADmaster
https://github.com/valkey-io/valkey-json/pull/73
-rw-r--r--valkey-json-offline.patch36
-rw-r--r--valkey-json.spec10
2 files changed, 29 insertions, 17 deletions
diff --git a/valkey-json-offline.patch b/valkey-json-offline.patch
index e4933bd..7327d0d 100644
--- a/valkey-json-offline.patch
+++ b/valkey-json-offline.patch
@@ -1,18 +1,21 @@
-diff -up ./CMakeLists.txt.old ./CMakeLists.txt
---- ./CMakeLists.txt.old 2025-08-06 09:38:41.575001413 +0200
-+++ ./CMakeLists.txt 2025-08-06 10:49:15.720138781 +0200
-@@ -69,6 +69,10 @@ else()
+diff -up ./CMakeLists.txt.offline ./CMakeLists.txt
+--- ./CMakeLists.txt.offline 2025-06-19 23:11:29.000000000 +0200
++++ ./CMakeLists.txt 2025-08-06 15:07:48.607390466 +0200
+@@ -69,6 +69,13 @@ else()
endif()
endif()
-+if(BUILD_RELEASE)
++if(VALKEY_INCLUDE_DIR)
++ if(ENABLE_UNIT_TESTS OR ENABLE_INTEGRATION_TESTS)
++ message(FATAL_ERROR "Incompatible option VALKEY_INCLUDE_DIR with ENABLE_UNIT_TESTS or ENABLE_INTEGRATION_TESTS")
++ endif()
+ file(MAKE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/include")
-+ file(COPY_FILE "/usr/include/valkeymodule.h" "${CMAKE_CURRENT_SOURCE_DIR}/src/include/valkeymodule.h")
++ file(COPY_FILE "${VALKEY_INCLUDE_DIR}/valkeymodule.h" "${CMAKE_CURRENT_SOURCE_DIR}/src/include/valkeymodule.h")
+else()
ExternalProject_Add(
valkey
GIT_REPOSITORY https://github.com/valkey-io/valkey.git
-@@ -94,6 +98,7 @@ ExternalProject_Add_Step(
+@@ -94,6 +101,7 @@ ExternalProject_Add_Step(
COMMAND ${CMAKE_COMMAND} -E copy ${VALKEY_DOWNLOAD_DIR}/src/valkey/src/valkeymodule.h ${VALKEY_INCLUDE_DIR}/valkeymodule.h
ALWAYS 1
)
@@ -20,14 +23,14 @@ diff -up ./CMakeLists.txt.old ./CMakeLists.txt
# Integration tests require the valkey-test-framework which is only needed when
# building Valkey from source.
-@@ -171,11 +176,18 @@ message("CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}
+@@ -171,11 +179,18 @@ message("CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}
message("CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
# Fetch RapidJSON
-+if(BUILD_RELEASE)
++if(RAPIDJSON_SOURCE_DIR)
+FetchContent_Declare(
+ rapidjson
-+ SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/rapidjson-ebd87cb468fb4cb060b37e579718c4a4125416c1"
++ SOURCE_DIR "${RAPIDJSON_SOURCE_DIR}"
+)
+else()
FetchContent_Declare(
@@ -39,11 +42,14 @@ diff -up ./CMakeLists.txt.old ./CMakeLists.txt
# Disable RapidJSON tests and examples
set(RAPIDJSON_BUILD_TESTS OFF CACHE BOOL "Build rapidjson tests" FORCE)
-diff -up ./src/CMakeLists.txt.old ./src/CMakeLists.txt
---- ./src/CMakeLists.txt.old 2025-08-06 09:46:37.672820317 +0200
-+++ ./src/CMakeLists.txt 2025-08-06 09:46:46.976759840 +0200
-@@ -39,4 +39,3 @@ target_sources(${OBJECT_TARGET}
+diff -up ./src/CMakeLists.txt.offline ./src/CMakeLists.txt
+--- ./src/CMakeLists.txt.offline 2025-06-19 23:11:29.000000000 +0200
++++ ./src/CMakeLists.txt 2025-08-06 15:09:25.030234068 +0200
+@@ -39,4 +39,7 @@ target_sources(${OBJECT_TARGET}
)
add_library(${JSON_MODULE_LIB} SHARED $<TARGET_OBJECTS:${OBJECT_TARGET}>)
--add_dependencies(${OBJECT_TARGET} valkey)
++
++if(ENABLE_UNIT_TESTS OR ENABLE_INTEGRATION_TESTS)
+ add_dependencies(${OBJECT_TARGET} valkey)
++endif()
diff --git a/valkey-json.spec b/valkey-json.spec
index c8aa269..6f6d486 100644
--- a/valkey-json.spec
+++ b/valkey-json.spec
@@ -24,7 +24,7 @@
Name: valkey-json
Version: 1.0.1
%forgemeta
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: JSON as native data type
# this module is BSD-3-Clause
# RapidJSON is MIT
@@ -69,7 +69,7 @@ See https://rapidjson.org/
%prep
%setup -q -n %{gh_proj}-%{version} -a1
-%patch -P0 -p1
+%patch -P0 -p1 -b .offline
: Configuration file
cat << EOF | tee %{cfgname}
@@ -83,6 +83,8 @@ cp -p src/rapidjson/license.txt LICENSE.rapidjson
%build
%cmake \
-DVALKEY_VERSION=8.1 \
+ -DVALKEY_INCLUDE_DIR=%_includedir \
+ -DRAPIDJSON_SOURCE_DIR=$PWD/rapidjson-%{rapidjson_commit} \
-DBUILD_RELEASE:BOOL=ON \
-DENABLE_UNIT_TESTS:BOOL=OFF \
-DENABLE_INTEGRATION_TESTS:BOOL=OFF
@@ -107,5 +109,9 @@ install -Dpm640 %{cfgname} %{buildroot}%{valkey_modules_cfg}/%{cfgna
%changelog
+* Wed Aug 6 2025 Remi Collet <remi@remirepo.net> - 1.0.1-2
+- improve patch for offlilne build and submit upstream:
+ https://github.com/valkey-io/valkey-json/pull/73
+
* Wed Aug 6 2025 Remi Collet <remi@remirepo.net> - 1.0.1-1
- initial package