From 4d2b52ef6dc14efc60d4dada81f50733c7416713 Mon Sep 17 00:00:00 2001 From: Steve Roques Date: Wed, 11 Mar 2026 19:41:33 +0100 Subject: [PATCH] turingdb: init at 1.22 --- pkgs/by-name/tu/turingdb/package.nix | 114 +++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 pkgs/by-name/tu/turingdb/package.nix diff --git a/pkgs/by-name/tu/turingdb/package.nix b/pkgs/by-name/tu/turingdb/package.nix new file mode 100644 index 000000000000..58e7ef67b7b4 --- /dev/null +++ b/pkgs/by-name/tu/turingdb/package.nix @@ -0,0 +1,114 @@ +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + pkg-config, + gitMinimal, + bison, + flex, + inih, + minio-cpp, + curl, + curlpp, + nlohmann_json, + openssl, + openblas, + pugixml, + faiss, + zlib, + llvmPackages_20, + versionCheckHook, +}: + +let + turingstdenv = if stdenv.isDarwin then llvmPackages_20.stdenv else stdenv; +in +turingstdenv.mkDerivation (finalAttrs: { + pname = "turingdb"; + version = "1.22"; + + src = fetchFromGitHub { + owner = "turing-db"; + repo = "turingdb"; + tag = "v${finalAttrs.version}"; + hash = "sha256-gG3KzEC90nLbIisBt4xnHXtz6LesqJxaviIkTrcTMG0="; + + fetchSubmodules = true; + + leaveDotGit = true; + postFetch = '' + git -C $out log -1 --format=%ct > $out/HEAD_COMMIT_TIMESTAMP + rm -rf $out/.git + ''; + }; + + postPatch = '' + substituteInPlace storage/dump/DumpConfig.h \ + --replace-fail HEAD_COMMIT_TIMESTAMP "$(cat $src/HEAD_COMMIT_TIMESTAMP)" + ''; + + strictDeps = true; + + nativeBuildInputs = [ + bison + cmake + flex + gitMinimal + pkg-config + ]; + + buildInputs = [ + curl + curlpp + faiss + inih + minio-cpp + nlohmann_json + openblas + openssl + pugixml + zlib + ] + ++ lib.optionals turingstdenv.isDarwin [ llvmPackages_20.openmp ] + ++ lib.optionals stdenv.isLinux [ stdenv.cc.cc.lib ]; + + cmakeFlags = [ + (lib.cmakeBool "NIX_BUILD" true) + (lib.cmakeFeature "CMAKE_BUILD_TYPE" "Release") + (lib.cmakeFeature "CMAKE_CXX_FLAGS" "-fopenmp") + (lib.cmakeFeature "CMAKE_EXE_LINKER_FLAGS" "-lgomp") + (lib.cmakeFeature "FLEX_INCLUDE_DIR" "${lib.getDev flex}/include") + ] + ++ lib.optionals stdenv.isDarwin [ + (lib.cmakeFeature "OpenMP_CXX_FLAGS" "-fopenmp") + (lib.cmakeFeature "OpenMP_CXX_LIB_NAMES" "omp") + (lib.cmakeFeature "OpenMP_omp_LIBRARY" "${lib.getLib llvmPackages_20.openmp}/lib/libomp.dylib") + ]; + + nativeInstallCheckInputs = [ versionCheckHook ]; + # Upstream tests require running a TuringDB server and performing + # network operations, which are incompatible with the Nix build sandbox. + doCheck = false; + + meta = { + description = "High performance in-memory column-oriented graph database engine"; + longDescription = '' + TuringDB is a high-performance in-memory column-oriented graph + database engine designed for analytical and read-intensive workloads. + ''; + homepage = "https://turingdb.ai"; + changelog = "https://github.com/turing-db/turingdb/releases/tag/v${finalAttrs.version}"; + license = lib.licenses.bsl11; + platforms = [ + "x86_64-linux" + "aarch64-darwin" + ]; + mainProgram = "turingdb"; + maintainers = with lib.maintainers; [ + cyrusknopf + drupol + roquess + ]; + }; +})