diff options
| author | Romain GARBAGE <romain.garbage@inria.fr> | 2026-01-16 09:12:00 +0100 |
|---|---|---|
| committer | Romain GARBAGE <romain.garbage@inria.fr> | 2026-01-19 10:00:37 +0100 |
| commit | 1f5c5b2bb6737b44f0e7d9a6b49f202643d12937 (patch) | |
| tree | 34b3d4cedb1e7a80be063ee62b7d6879d1d5d3db | |
| parent | d0e0be536d95f26115b7e12f5ff72fdb2030730c (diff) | |
databases: Add redox.
* guix-science/packages/databases.scm: New file.
(redox): New variable.
* patches/redox-generate-pkg-config-file.patch: New file.
* patches/redox-install-pkg-config-file.patch: New file.
| -rw-r--r-- | guix-science/packages/databases.scm | 51 | ||||
| -rw-r--r-- | patches/redox-generate-pkg-config-file.patch | 41 | ||||
| -rw-r--r-- | patches/redox-install-pkg-config-file.patch | 42 |
3 files changed, 134 insertions, 0 deletions
diff --git a/guix-science/packages/databases.scm b/guix-science/packages/databases.scm new file mode 100644 index 0000000..41d4191 --- /dev/null +++ b/guix-science/packages/databases.scm | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | ;;; SPDX-License-Identifier: GPL-3.0-or-later | ||
| 2 | |||
| 3 | (define-module (guix-science packages databases) | ||
| 4 | #:use-module ((guix licenses) | ||
| 5 | #:prefix license:) | ||
| 6 | #:use-module (guix gexp) | ||
| 7 | #:use-module (guix utils) | ||
| 8 | #:use-module (guix packages) | ||
| 9 | #:use-module (guix git-download) | ||
| 10 | #:use-module (guix build-system cmake) | ||
| 11 | #:use-module (gnu packages) | ||
| 12 | #:use-module (gnu packages databases) | ||
| 13 | #:use-module (gnu packages libevent)) | ||
| 14 | |||
| 15 | (define-public redox | ||
| 16 | ;; No tagged releases, latest commit as of 2026-01-16, version | ||
| 17 | ;; number according to HISTORY.md. | ||
| 18 | (let ((version "0.3") | ||
| 19 | (commit "b5b9fa31a6fba3f7ce872e623958cb27b7686039") | ||
| 20 | (revision "1")) | ||
| 21 | (package | ||
| 22 | (name "redox") | ||
| 23 | (version (git-version version revision commit)) | ||
| 24 | (home-page "https://github.com/hmartino/redox.git") | ||
| 25 | (source | ||
| 26 | (origin | ||
| 27 | (method git-fetch) | ||
| 28 | (uri (git-reference | ||
| 29 | (url home-page) | ||
| 30 | (commit commit))) | ||
| 31 | (file-name (git-file-name name version)) | ||
| 32 | (sha256 | ||
| 33 | (base32 "00a0l8yg5m27q5s1f331dwm1dri1c5giblk5afhpxa6p8ir4397n")) | ||
| 34 | (patches | ||
| 35 | (search-patches "patches/redox-install-pkg-config-file.patch" | ||
| 36 | "patches/redox-generate-pkg-config-file.patch")))) | ||
| 37 | (build-system cmake-build-system) | ||
| 38 | (arguments | ||
| 39 | ;; Tests require a connection to a redis database. | ||
| 40 | (list #:tests? #f)) | ||
| 41 | ;; redox exposes libev.h | ||
| 42 | (propagated-inputs (list libev)) | ||
| 43 | (inputs (list hiredis)) | ||
| 44 | (synopsis "Modern, asynchronous, and fast C++11 client for Redis") | ||
| 45 | (description | ||
| 46 | "Redox is a C++ interface to the Redis key-value store that makes it | ||
| 47 | easy to write applications that are both elegant and high-performance. | ||
| 48 | Communication should be a means to an end, not something we spend a | ||
| 49 | lot of time worrying about. Redox takes care of the details so you can | ||
| 50 | move on to the interesting part of your project.") | ||
| 51 | (license license:asl2.0)))) | ||
diff --git a/patches/redox-generate-pkg-config-file.patch b/patches/redox-generate-pkg-config-file.patch new file mode 100644 index 0000000..efd488b --- /dev/null +++ b/patches/redox-generate-pkg-config-file.patch | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | From e7904da79d5360ba22fbab64b96be167b6dda5f6 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Millian Poquet <millian.poquet@inria.fr> | ||
| 3 | Date: Fri, 7 Dec 2018 00:33:43 +0100 | ||
| 4 | Subject: [PATCH] fix generated pkg-config file | ||
| 5 | |||
| 6 | --- | ||
| 7 | CMakeLists.txt | 4 +++- | ||
| 8 | cmake/redox.pc.in | 4 ++-- | ||
| 9 | 2 files changed, 5 insertions(+), 3 deletions(-) | ||
| 10 | |||
| 11 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| 12 | index 54dfa35..3f0fa52 100644 | ||
| 13 | --- a/CMakeLists.txt | ||
| 14 | +++ b/CMakeLists.txt | ||
| 15 | @@ -1,4 +1,4 @@ | ||
| 16 | -cmake_minimum_required(VERSION 2.8.4) | ||
| 17 | +cmake_minimum_required(VERSION 3.0.2) | ||
| 18 | project(redox) | ||
| 19 | |||
| 20 | set(REDOX_VERSION_MAJOR 0) | ||
| 21 | @@ -194,6 +194,8 @@ if (lib) | ||
| 22 | # Install the dynamic library to /usr/lib[64] | ||
| 23 | install(TARGETS redox DESTINATION lib${LIB_SUFFIX}) | ||
| 24 | # Generate the redox.pc pkg-config file in /usr/lib[64]/pkgconfig | ||
| 25 | + get_filename_component(HIREDIS_LIBRARY_DIRECTORY ${HIREDIS_LIBRARIES} DIRECTORY) | ||
| 26 | + get_filename_component(LIBEV_LIBRARY_DIRECTORY ${LIBEV_LIBRARIES} DIRECTORY) | ||
| 27 | configure_file("${CMAKE_HOME_DIRECTORY}/cmake/redox.pc.in" "${PROJECT_BINARY_DIR}/redox.pc" @ONLY) | ||
| 28 | install(FILES "${PROJECT_BINARY_DIR}/redox.pc" DESTINATION lib${LIB_SUFFIX}/pkgconfig/) | ||
| 29 | endif() | ||
| 30 | diff --git a/cmake/redox.pc.in b/cmake/redox.pc.in | ||
| 31 | index a480d1f..1574542 100644 | ||
| 32 | --- a/cmake/redox.pc.in | ||
| 33 | +++ b/cmake/redox.pc.in | ||
| 34 | @@ -7,5 +7,5 @@ Name: redox | ||
| 35 | Description: Modern, asynchronous, and wicked fast C++11 client for Redis | ||
| 36 | Version: @REDOX_VERSION_STRING@ | ||
| 37 | |||
| 38 | -Libs: -L${libdir} -lredox @HIREDIS_LIBRARIES@ @LIBEV_LIBRARIES@ @CMAKE_THREAD_LIBS_INIT@ | ||
| 39 | -Cflags: -I${includedir} | ||
| 40 | +Libs: -L${libdir} -lredox -L@HIREDIS_LIBRARY_DIRECTORY@ -lhiredis -L@LIBEV_LIBRARY_DIRECTORY@ -lev @CMAKE_THREAD_LIBS_INIT@ | ||
| 41 | +Cflags: -I${includedir} -I@HIREDIS_INCLUDE_DIRS@ | ||
diff --git a/patches/redox-install-pkg-config-file.patch b/patches/redox-install-pkg-config-file.patch new file mode 100644 index 0000000..a1390b3 --- /dev/null +++ b/patches/redox-install-pkg-config-file.patch | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | From 6728a7582bbd5f0ef37f8893cc0103f82c9fdc05 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Millian Poquet <millian.poquet@inria.fr> | ||
| 3 | Date: Thu, 6 Dec 2018 20:01:15 +0100 | ||
| 4 | Subject: [PATCH] install a pkg-config redox.pc file | ||
| 5 | |||
| 6 | --- | ||
| 7 | CMakeLists.txt | 3 +++ | ||
| 8 | cmake/redox.pc.in | 11 +++++++++++ | ||
| 9 | 2 files changed, 14 insertions(+) | ||
| 10 | create mode 100644 cmake/redox.pc.in | ||
| 11 | |||
| 12 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| 13 | index 11887ad..54dfa35 100644 | ||
| 14 | --- a/CMakeLists.txt | ||
| 15 | +++ b/CMakeLists.txt | ||
| 16 | @@ -193,6 +193,9 @@ endif() | ||
| 17 | if (lib) | ||
| 18 | # Install the dynamic library to /usr/lib[64] | ||
| 19 | install(TARGETS redox DESTINATION lib${LIB_SUFFIX}) | ||
| 20 | + # Generate the redox.pc pkg-config file in /usr/lib[64]/pkgconfig | ||
| 21 | + configure_file("${CMAKE_HOME_DIRECTORY}/cmake/redox.pc.in" "${PROJECT_BINARY_DIR}/redox.pc" @ONLY) | ||
| 22 | + install(FILES "${PROJECT_BINARY_DIR}/redox.pc" DESTINATION lib${LIB_SUFFIX}/pkgconfig/) | ||
| 23 | endif() | ||
| 24 | |||
| 25 | if (static_lib) | ||
| 26 | diff --git a/cmake/redox.pc.in b/cmake/redox.pc.in | ||
| 27 | new file mode 100644 | ||
| 28 | index 0000000..a480d1f | ||
| 29 | --- /dev/null | ||
| 30 | +++ b/cmake/redox.pc.in | ||
| 31 | @@ -0,0 +1,11 @@ | ||
| 32 | +prefix=@CMAKE_INSTALL_PREFIX@ | ||
| 33 | +exec_prefix=${prefix} | ||
| 34 | +libdir=${prefix}/lib@LIB_SUFFIX@ | ||
| 35 | +includedir=${prefix}/include | ||
| 36 | + | ||
| 37 | +Name: redox | ||
| 38 | +Description: Modern, asynchronous, and wicked fast C++11 client for Redis | ||
| 39 | +Version: @REDOX_VERSION_STRING@ | ||
| 40 | + | ||
| 41 | +Libs: -L${libdir} -lredox @HIREDIS_LIBRARIES@ @LIBEV_LIBRARIES@ @CMAKE_THREAD_LIBS_INIT@ | ||
| 42 | +Cflags: -I${includedir} | ||
