28 pname = "dragonflydb";
31 src = fetchFromGitHub {
35 hash = "sha256-P6WMW/n+VezWDXGagT4B+ZYyCp8oufDV6MTrpKpLZcs=";
36 fetchSubmodules = true;
39 # Needed exactly 5.4.4 for patch to work
41 url = "https://github.com/lua/lua/archive/refs/tags/v5.4.4.tar.gz";
42 hash = "sha256-L/ibvqIqfIuRDWsAb1ukVZ7c9GiiVTfO35mI7ZD2tFA=";
45 # Needed exactly 20211102.0 for patch to work
46 abseil-cpp_202111 = fetchFromGitHub {
50 sha256 = "sha256-sSXT6D4JSrk3dA7kVaxfKkzOMBpqXQb0WbMYWG+nGwk=";
54 inherit pname version src;
57 mkdir -p ./build/{third_party,_deps}
58 ln -s ${double-conversion.src} ./build/third_party/dconv
59 ln -s ${mimalloc.src} ./build/third_party/mimalloc
60 ln -s ${rapidjson.src} ./build/third_party/rapidjson
61 ln -s ${gbenchmark.src} ./build/_deps/benchmark-src
62 ln -s ${gtest.src} ./build/_deps/gtest-src
63 cp -R --no-preserve=mode,ownership ${gperftools.src} ./build/third_party/gperf
64 cp -R --no-preserve=mode,ownership ${liburing.src} ./build/third_party/uring
65 cp -R --no-preserve=mode,ownership ${xxHash.src} ./build/third_party/xxhash
66 cp -R --no-preserve=mode,ownership ${abseil-cpp_202111} ./build/_deps/abseil_cpp-src
67 cp -R --no-preserve=mode,ownership ${glog.src} ./build/_deps/glog-src
68 chmod u+x ./build/third_party/uring/configure
69 cp ./build/third_party/xxhash/cli/xxhsum.{1,c} ./build/third_party/xxhash
70 patch -p1 -d ./build/_deps/glog-src < ${./glog.patch}
72 s@REPLACEJEMALLOCURL@file://${jemalloc.src}@
73 s@REPLACELUAURL@file://${lua}@
74 ' ${./fixes.patch} | patch -p1
93 "-DCMAKE_AR=${gcc-unwrapped}/bin/gcc-ar"
94 "-DCMAKE_RANLIB=${gcc-unwrapped}/bin/gcc-ranlib"
97 ninjaFlags = [ "dragonfly" ];
100 dontUseNinjaInstall = true;
105 cp ./dragonfly $out/bin
110 description = "A modern replacement for Redis and Memcached";
111 homepage = "https://dragonflydb.io/";
112 license = licenses.bsl11;
113 platforms = platforms.linux;
114 maintainers = with maintainers; [ yureien ];