about summary refs log tree commit diff
path: root/pkgs/servers/sql/sqld/default.nix
blob: 2acb0ec4d368b39293762c61ffca991df01bc943 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{ lib
, rustPlatform
, fetchFromGitHub
, pkg-config
, protobuf
, openssl
, sqlite
, zstd
, stdenv
, darwin
}:

rustPlatform.buildRustPackage rec {
  pname = "sqld";
  version = "0.17.2";

  src = fetchFromGitHub {
    owner = "libsql";
    repo = "sqld";
    rev = "v${version}";
    hash = "sha256-KoEscrzkFJnxxJKL/2r4cY0oLpKdQMjFR3daryzrVKQ=";
  };

  cargoLock = {
    lockFile = ./Cargo.lock;
    outputHashes = {
      "libsqlite3-sys-0.26.0" = "sha256-JzSGpqYtkIq0mVYD0kERIB6rmZUttqkCGne+M4vqTJU=";
      "octopod-0.1.0" = "sha256-V16fOlIp9BCpyzgh1Aei3Mra/y15v8dQFA8tHdOwZm4=";
    };
  };

  nativeBuildInputs = [
    pkg-config
    protobuf
    rustPlatform.bindgenHook
  ];

  buildInputs = [
    openssl
    sqlite
    zstd
  ] ++ lib.optionals stdenv.isDarwin [
    darwin.apple_sdk.frameworks.Security
  ];

  env.ZSTD_SYS_USE_PKG_CONFIG = true;

  # requires a complex setup with podman for the end-to-end tests
  doCheck = false;

  meta = {
    description = "LibSQL with extended capabilities like HTTP protocol, replication, and more";
    homepage = "https://github.com/libsql/sqld";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ dit7ya ];
  };
}