1{ lib
2, rustPlatform
3, fetchFromGitHub
4, pkg-config
5, protobuf
6, openssl
7, sqlite
8, zstd
9, stdenv
10, darwin
11}:
12
13rustPlatform.buildRustPackage rec {
14 pname = "sqld";
15 version = "0.17.2";
16
17 src = fetchFromGitHub {
18 owner = "libsql";
19 repo = "sqld";
20 rev = "v${version}";
21 hash = "sha256-KoEscrzkFJnxxJKL/2r4cY0oLpKdQMjFR3daryzrVKQ=";
22 };
23
24 cargoLock = {
25 lockFile = ./Cargo.lock;
26 outputHashes = {
27 "libsqlite3-sys-0.26.0" = "sha256-JzSGpqYtkIq0mVYD0kERIB6rmZUttqkCGne+M4vqTJU=";
28 "octopod-0.1.0" = "sha256-V16fOlIp9BCpyzgh1Aei3Mra/y15v8dQFA8tHdOwZm4=";
29 };
30 };
31
32 nativeBuildInputs = [
33 pkg-config
34 protobuf
35 rustPlatform.bindgenHook
36 ];
37
38 buildInputs = [
39 openssl
40 sqlite
41 zstd
42 ] ++ lib.optionals stdenv.isDarwin [
43 darwin.apple_sdk.frameworks.Security
44 ];
45
46 env.ZSTD_SYS_USE_PKG_CONFIG = true;
47
48 # requires a complex setup with podman for the end-to-end tests
49 doCheck = false;
50
51 meta = {
52 description = "LibSQL with extended capabilities like HTTP protocol, replication, and more";
53 homepage = "https://github.com/libsql/sqld";
54 license = lib.licenses.mit;
55 maintainers = with lib.maintainers; [ dit7ya ];
56 };
57}