Skip to content

Commit efed5ad

Browse files
spacetimedb: init at 1.0.0 (#389030)
2 parents 772b4b3 + c39f334 commit efed5ad

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
lib,
3+
fetchFromGitHub,
4+
rustPlatform,
5+
pkg-config,
6+
perl,
7+
git,
8+
versionCheckHook,
9+
}:
10+
rustPlatform.buildRustPackage (finalAttrs: {
11+
pname = "spacetimedb";
12+
version = "1.0.0";
13+
14+
src = fetchFromGitHub {
15+
owner = "clockworklabs";
16+
repo = "spacetimedb";
17+
tag = "v${finalAttrs.version}";
18+
hash = "sha256-L3D7DfMQNuoZ/twAsrK20royIGp6PXCAFZKnb0PgSu0=";
19+
};
20+
21+
useFetchCargoVendor = true;
22+
cargoHash = "sha256-eOZRp3LRbQzHfT+evKY55ifevX+ki9oT5B7vZs3ym+c=";
23+
24+
nativeBuildInputs = [
25+
pkg-config
26+
perl
27+
];
28+
29+
# Replace hardcoded git binary
30+
postPatch = ''
31+
substituteInPlace crates/cli/build.rs --replace-fail 'Command::new("git")' 'Command::new("${lib.getExe git}")'
32+
'';
33+
34+
cargoBuildFlags = [ "-p spacetimedb-standalone -p spacetimedb-cli" ];
35+
36+
checkFlags = [
37+
# requires wasm32-unknown-unknown target
38+
"--skip=codegen"
39+
];
40+
41+
doInstallCheck = true;
42+
nativeInstallCheckInputs = [ versionCheckHook ];
43+
versionCheckProgram = "${placeholder "out"}/bin/spacetime";
44+
versionCheckProgramArg = "--version";
45+
46+
postInstall = ''
47+
mv $out/bin/spacetimedb-cli $out/bin/spacetime
48+
'';
49+
50+
meta = {
51+
description = "Full-featured relational database system that lets you run your application logic inside the database";
52+
homepage = "https://github.com/clockworklabs/SpacetimeDB";
53+
license = lib.licenses.bsl11;
54+
mainProgram = "spacetime";
55+
maintainers = with lib.maintainers; [ akotro ];
56+
};
57+
})

0 commit comments

Comments
 (0)