diff --git a/pkgs/by-name/ma/matrix-continuwuity/package.nix b/pkgs/by-name/ma/matrix-continuwuity/package.nix index a02af10a8a25..bccc24e48bd3 100644 --- a/pkgs/by-name/ma/matrix-continuwuity/package.nix +++ b/pkgs/by-name/ma/matrix-continuwuity/package.nix @@ -1,6 +1,6 @@ { lib, - rustPlatform, + rustPackages_1_88, fetchFromGitea, pkg-config, bzip2, @@ -13,35 +13,83 @@ enableBlurhashing ? true, # upstream continuwuity enables jemalloc by default, so we follow suit enableJemalloc ? true, - rust-jemalloc-sys, + rust-jemalloc-sys-unprefixed, enableLiburing ? stdenv.hostPlatform.isLinux, liburing, nixosTests, }: let - rust-jemalloc-sys' = rust-jemalloc-sys.override { - unprefixed = !stdenv.hostPlatform.isDarwin; - }; - rocksdb' = rocksdb.override { - inherit enableLiburing; - # rocksdb does not support prefixed jemalloc, which is required on darwin - enableJemalloc = enableJemalloc && !stdenv.hostPlatform.isDarwin; - jemalloc = rust-jemalloc-sys'; - }; + inherit (rustPackages_1_88) rustPlatform; + + rocksdb' = + (rocksdb.override { + inherit enableLiburing; + # rocksdb does not support prefixed jemalloc, which is required on darwin + enableJemalloc = enableJemalloc && !stdenv.hostPlatform.isDarwin; + jemalloc = rust-jemalloc-sys-unprefixed; + }).overrideAttrs + ( + final: old: { + version = "10.5.1"; + src = fetchFromGitea { + domain = "forgejo.ellis.link"; + owner = "continuwuation"; + repo = "rocksdb"; + rev = "10.5.fb"; + hash = "sha256-X4ApGLkHF9ceBtBg77dimEpu720I79ffLoyPa8JMHaU="; + }; + + patches = [ ]; + + cmakeFlags = + lib.subtractLists [ + # no real reason to have snappy or zlib, no one uses this + (lib.cmakeBool "WITH_SNAPPY" true) + (lib.cmakeBool "ZLIB" true) + (lib.cmakeBool "WITH_ZLIB" true) + # we dont need to use ldb or sst_dump (core_tools) + (lib.cmakeBool "WITH_CORE_TOOLS" true) + # we dont need to build rocksdb tests + (lib.cmakeBool "WITH_TESTS" true) + # we use rust-rocksdb via C interface and dont need C++ RTTI + (lib.cmakeBool "USE_RTTI" true) + # this doesn't exist in RocksDB + (lib.cmakeBool "FORCE_SSE43" true) + ] old.cmakeFlags + ++ [ + # no real reason to have snappy, no one uses this + (lib.cmakeBool "WITH_SNAPPY" false) + (lib.cmakeBool "ZLIB" false) + (lib.cmakeBool "WITH_ZLIB" false) + # we dont need to use ldb or sst_dump (core_tools) + (lib.cmakeBool "WITH_CORE_TOOLS" false) + # we dont need to build rocksdb tests + (lib.cmakeBool "WITH_TESTS" false) + # we use rust-rocksdb via C interface and dont need C++ RTTI + (lib.cmakeBool "USE_RTTI" false) + (lib.cmakeBool "WITH_TRACE_TOOLS" false) + ]; + outputs = [ "out" ]; + + # We aren't building tools, the original package uses this to make sure rocksdb + # tools work as expected. Hence we override this and make it empty. + preInstall = ""; + } + ); in rustPlatform.buildRustPackage (finalAttrs: { pname = "matrix-continuwuity"; - version = "0.5.0-rc.6"; + version = "0.5.0-rc.8"; src = fetchFromGitea { domain = "forgejo.ellis.link"; owner = "continuwuation"; repo = "continuwuity"; tag = "v${finalAttrs.version}"; - hash = "sha256-xK/jTURQzFJ1FkF1E9cItTxXAgXgTwAiA9/8aE51FvU="; + hash = "sha256-5XjEwEYzWANm2k0GKFuHV3no65ReWPbCq+xMUH13zuI="; }; - cargoHash = "sha256-+7k1dtrXdonFDXa2Z/qVo4n1hZRmMWEQKKlffki8+/k="; + cargoHash = "sha256-uMr1DLwiMwIKN5IeALwQfh2xmAGPyQtxvT/uM0gfPvA="; nativeBuildInputs = [ pkg-config @@ -52,7 +100,9 @@ rustPlatform.buildRustPackage (finalAttrs: { bzip2 zstd ] - ++ lib.optional enableJemalloc rust-jemalloc-sys' + ++ lib.optional enableJemalloc [ + rust-jemalloc-sys-unprefixed + ] ++ lib.optional enableLiburing liburing; env = { @@ -76,6 +126,7 @@ rustPlatform.buildRustPackage (finalAttrs: { "systemd" "url_preview" "zstd_compression" + "bindgen-runtime" ] ++ lib.optional enableBlurhashing "blurhashing" ++ lib.optional enableJemalloc [