1{ stdenv, lib, rustPlatform, fetchFromGitHub, pkg-config, openssl, SystemConfiguration, CoreFoundation, Security, libiconv }:
2
3rustPlatform.buildRustPackage rec {
4 pname = "sqlx-cli";
5 version = "0.5.9";
6
7 src = fetchFromGitHub {
8 owner = "launchbadge";
9 repo = "sqlx";
10 rev = "v${version}";
11 sha256 = "sha256-z8gIuMknqiXpmXANS+V1GYioevCysDDzb+UYc9NeU04=";
12 };
13
14 cargoSha256 = "sha256-b+X4u83Jae2xjKFT4lYqSk125wPQjMiM8wZ36tA/rjo=";
15
16 doCheck = false;
17 cargoBuildFlags = [ "-p sqlx-cli" ];
18
19 nativeBuildInputs = [ pkg-config ];
20 buildInputs = lib.optionals stdenv.isLinux [ openssl ]
21 ++ lib.optionals stdenv.isDarwin [ SystemConfiguration CoreFoundation Security libiconv ];
22
23 meta = with lib; {
24 description =
25 "SQLx's associated command-line utility for managing databases, migrations, and enabling offline mode with sqlx::query!() and friends.";
26 homepage = "https://github.com/launchbadge/sqlx";
27 license = licenses.asl20;
28 maintainers = with maintainers; [ greizgh ];
29 };
30}