From df9b5b808a335f30fbf1bd6450ede4b01d9e8e29 Mon Sep 17 00:00:00 2001 From: oddlama Date: Tue, 18 Feb 2025 23:13:08 +0100 Subject: [PATCH] influxdb3: init at 0-unstable-2025-02-17 --- pkgs/by-name/in/influxdb3/package.nix | 85 +++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 pkgs/by-name/in/influxdb3/package.nix diff --git a/pkgs/by-name/in/influxdb3/package.nix b/pkgs/by-name/in/influxdb3/package.nix new file mode 100644 index 00000000000000..4a75148dcb68df --- /dev/null +++ b/pkgs/by-name/in/influxdb3/package.nix @@ -0,0 +1,85 @@ +{ + lib, + rustPlatform, + fetchFromGitHub, + protobuf, + python3, + rust-jemalloc-sys-unprefixed, + rustc, + makeWrapper, + nix-update-script, +}: +rustPlatform.buildRustPackage { + pname = "influxdb3"; + version = "0-unstable-2025-02-17"; + src = fetchFromGitHub { + owner = "influxdata"; + repo = "influxdb"; + rev = "8daccb7ee8f82ffae99b25236af9645fd60e448b"; + hash = "sha256-tHnLD5W3KQ1cILRHNmXAi4lvQQSBVUPxYCXmXLMLwIs="; + }; + + useFetchCargoVendor = true; + cargoHash = "sha256-KnmaIbK/2tRXjCpOLHcadIX8Od7lVDOwZ+FgE+yFE+Q="; + + nativeBuildInputs = [ + makeWrapper + protobuf + rustc.llvmPackages.lld + ]; + + buildInputs = [ + rust-jemalloc-sys-unprefixed + python3 + ]; + + env = { + GIT_HASH = "000000000000000000000000000000000000000000000000000"; + GIT_HASH_SHORT = "0000000"; + PYO3_PYTHON = lib.getExe python3; + }; + + postPatch = '' + # We provide GIT_HASH and GIT_HASH_SHORT ourselves + rm influxdb3_process/build.rs + ''; + + buildNoDefaultFeatures = true; + buildFeatures = [ + "aws" + "gcp" + "azure" + "jemalloc_replacing_malloc" + "system-py" + ]; + + postInstall = '' + wrapProgram $out/bin/influxdb3 \ + --set PYTHONHOME ${python3} \ + --suffix LD_LIBRARY_PATH : ${ + lib.makeLibraryPath [ + rust-jemalloc-sys-unprefixed + python3 + ] + } + ''; + + # Tests require running instance + doCheck = false; + + passthru.updateScript = nix-update-script { + # Switch to "--version-regex" "v(3.*)" once the first real release tag is added + extraArgs = [ "--version=branch" ]; + }; + + meta = { + description = "Scalable datastore for metrics, events, and real-time analytics"; + homepage = "https://github.com/influxdata/influxdb"; + license = with lib.licenses; [ + asl20 + mit + ]; + maintainers = with lib.maintainers; [ oddlama ]; + mainProgram = "influxdb3"; + }; +}