This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchzip,
|
||||
makeRustPlatform,
|
||||
rust-bin,
|
||||
pkg-config,
|
||||
openssl,
|
||||
}:
|
||||
let
|
||||
revision = "2060c79ba17c6bb9f5823312b6f6b7f4a845738e";
|
||||
toolchain = rust-bin.stable."1.86.0".minimal;
|
||||
rustPlatform = makeRustPlatform {
|
||||
cargo = toolchain;
|
||||
rustc = toolchain;
|
||||
};
|
||||
in
|
||||
rustPlatform.buildRustPackage {
|
||||
pname = "affine-prisma-engines";
|
||||
version = "6.8.2";
|
||||
src = fetchzip {
|
||||
url = "https://github.com/prisma/prisma-engines/archive/${revision}.tar.gz";
|
||||
hash = "sha256-YvP3yJQoe+q7jjpwntaYkYjxyoDzqnXcpIZa4Y+I/+E=";
|
||||
};
|
||||
cargoHash = "sha256-lRM5Ha0+f+srxYaosbCe/hhpzIPVc7f+ux4FFvISHmM=";
|
||||
cargoBuildFlags = [
|
||||
"-p" "schema-engine-cli"
|
||||
"-p" "query-engine-node-api"
|
||||
];
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
buildInputs = [ openssl ];
|
||||
env = {
|
||||
OPENSSL_NO_VENDOR = "1";
|
||||
GIT_HASH = revision;
|
||||
SQLITE_MAX_VARIABLE_NUMBER = "250000";
|
||||
SQLITE_MAX_EXPR_DEPTH = "10000";
|
||||
CARGO_BUILD_JOBS = "8";
|
||||
};
|
||||
doCheck = false;
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
install -Dm755 target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/schema-engine \
|
||||
"$out/bin/schema-engine"
|
||||
install -Dm755 target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/libquery_engine.so \
|
||||
"$out/lib/libquery_engine.node"
|
||||
runHook postInstall
|
||||
'';
|
||||
meta = {
|
||||
description = "Source-built Prisma engines matching AFFiNE's locked client";
|
||||
homepage = "https://github.com/prisma/prisma-engines";
|
||||
license = lib.licenses.asl20;
|
||||
platforms = [ "x86_64-linux" ];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user