2022-11-21 17:40:18 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pkg-config
|
|
|
|
, openssl
|
2023-10-09 19:29:22 +00:00
|
|
|
, rocksdb
|
2022-11-21 17:40:18 +00:00
|
|
|
, testers
|
|
|
|
, surrealdb
|
|
|
|
, SystemConfiguration
|
2023-04-12 12:48:02 +00:00
|
|
|
, protobuf
|
2022-11-21 17:40:18 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "surrealdb";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "1.0.0";
|
2022-11-21 17:40:18 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "surrealdb";
|
|
|
|
repo = "surrealdb";
|
|
|
|
rev = "v${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-rBqg8tMcdc9VavYQDiKQwNp2IxYvpDNB/Qb74uiMmO4=";
|
2022-11-21 17:40:18 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
cargoHash = "sha256-qbKc9/n4bOvdP2iXg6IF3jAwxx6Wj17Uxlj3F/gx+1g=";
|
2022-11-21 17:40:18 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
# error: linker `aarch64-linux-gnu-gcc` not found
|
|
|
|
postPatch = ''
|
|
|
|
rm .cargo/config.toml
|
|
|
|
'';
|
2022-11-21 17:40:18 +00:00
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
PROTOC = "${protobuf}/bin/protoc";
|
|
|
|
PROTOC_INCLUDE = "${protobuf}/include";
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
ROCKSDB_INCLUDE_DIR = "${rocksdb}/include";
|
|
|
|
ROCKSDB_LIB_DIR = "${rocksdb}/lib";
|
2022-11-21 17:40:18 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
2023-07-15 17:15:38 +00:00
|
|
|
rustPlatform.bindgenHook
|
2022-11-21 17:40:18 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [ openssl ]
|
|
|
|
++ lib.optionals stdenv.isDarwin [ SystemConfiguration ];
|
|
|
|
|
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = surrealdb;
|
|
|
|
command = "surreal version";
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A scalable, distributed, collaborative, document-graph database, for the realtime web";
|
|
|
|
homepage = "https://surrealdb.com/";
|
|
|
|
mainProgram = "surreal";
|
|
|
|
license = licenses.bsl11;
|
|
|
|
maintainers = with maintainers; [ sikmir happysalada ];
|
|
|
|
};
|
|
|
|
}
|