1{ stdenv
2, lib
3, runCommand
4, patchelf
5, fetchFromGitHub
6, rustPlatform
7, makeWrapper
8, pkg-config
9, curl
10, Security
11, CoreServices
12, libiconv
13, xz
14, perl
15, substituteAll
16}:
17
18rustPlatform.buildRustPackage rec {
19 pname = "edgedb";
20 version = "2.0.1";
21
22 src = fetchFromGitHub {
23 owner = "edgedb";
24 repo = "edgedb-cli";
25 rev = "v${version}";
26 sha256 = "sha256-U+fF0t+dj8wUfCviNu/zcoz3lhMXcQlDgz8B3gB+EJI=";
27 };
28
29 cargoSha256 = "sha256-Pm3PBg7sbFwLHaozfsbQbPd4gmcMUHxmGT4AsQRDX0g=";
30
31 nativeBuildInputs = [ makeWrapper pkg-config perl ];
32
33 buildInputs = [
34 curl
35 ] ++ lib.optionals stdenv.isDarwin [ CoreServices Security libiconv xz ];
36
37 checkFeatures = [ ];
38
39 patches = [
40 (substituteAll {
41 src = ./0001-dynamically-patchelf-binaries.patch;
42 inherit patchelf;
43 dynamicLinker = stdenv.cc.bintools.dynamicLinker;
44 })
45 ];
46
47 doCheck = false;
48
49 meta = with lib; {
50 description = "EdgeDB cli";
51 homepage = "https://www.edgedb.com/docs/cli/index";
52 license = with licenses; [ asl20 /* or */ mit ];
53 maintainers = [ maintainers.ranfdev ];
54 };
55}