nixpkgs/pkgs/development/tools/rust/sqlx-cli/default.nix
2022-09-19 21:02:19 +08:00

36 lines
1.1 KiB
Nix

{ stdenv, lib, rustPlatform, fetchFromGitHub, pkg-config, openssl, SystemConfiguration, CoreFoundation, Security, libiconv, testers, sqlx-cli }:
rustPlatform.buildRustPackage rec {
pname = "sqlx-cli";
version = "0.6.2";
src = fetchFromGitHub {
owner = "launchbadge";
repo = "sqlx";
rev = "v${version}";
sha256 = "sha256-pQlrKjhOJfjNEmLxqnFmmBY1naheZUsaq2tGdLKGxjg=";
};
cargoSha256 = "sha256-AbA8L7rkyZfKW0vvjyrcW5eU6jGD+zAqIcEUOJmeqJs=";
doCheck = false;
cargoBuildFlags = [ "-p sqlx-cli" ];
nativeBuildInputs = [ pkg-config ];
buildInputs = lib.optionals stdenv.isLinux [ openssl ]
++ lib.optionals stdenv.isDarwin [ SystemConfiguration CoreFoundation Security libiconv ];
passthru.tests.version = testers.testVersion {
package = sqlx-cli;
command = "sqlx --version";
};
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 ];
};
}