2022-06-16 17:23:12 +00:00
|
|
|
{ stdenv, lib, rustPlatform, fetchFromGitHub, pkg-config, openssl, SystemConfiguration, CoreFoundation, Security, libiconv, testers, sqlx-cli }:
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "sqlx-cli";
|
2022-09-22 12:36:57 +00:00
|
|
|
version = "0.6.2";
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "launchbadge";
|
|
|
|
repo = "sqlx";
|
|
|
|
rev = "v${version}";
|
2022-09-22 12:36:57 +00:00
|
|
|
sha256 = "sha256-pQlrKjhOJfjNEmLxqnFmmBY1naheZUsaq2tGdLKGxjg=";
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
|
2022-09-22 12:36:57 +00:00
|
|
|
cargoSha256 = "sha256-AbA8L7rkyZfKW0vvjyrcW5eU6jGD+zAqIcEUOJmeqJs=";
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
cargoBuildFlags = [ "-p sqlx-cli" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2021-03-20 04:20:00 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isLinux [ openssl ]
|
2021-05-20 23:08:51 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ SystemConfiguration CoreFoundation Security libiconv ];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = sqlx-cli;
|
|
|
|
command = "sqlx --version";
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description =
|
|
|
|
"SQLx's associated command-line utility for managing databases, migrations, and enabling offline mode with sqlx::query!() and friends.";
|
|
|
|
homepage = "https://github.com/launchbadge/sqlx";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ greizgh ];
|
|
|
|
};
|
|
|
|
}
|