2025-08-02 14:34:32 +00:00

51 lines
1.1 KiB
Nix

{
fetchFromGitHub,
lib,
libiconv,
libpg_query,
openssl,
pkg-config,
rustPlatform,
stdenv,
}:
rustPlatform.buildRustPackage rec {
pname = "squawk";
version = "2.21.1";
src = fetchFromGitHub {
owner = "sbdchd";
repo = "squawk";
tag = "v${version}";
hash = "sha256-Ox6UPy4EFN3WEpXYXx0SGVRcAY0zl0x7eCxKP/kS3qo=";
};
cargoHash = "sha256-WRGz70lb1HwVOwi+un8h7PoDMlFrJbuFmw3q+JKkfZw=";
nativeBuildInputs = [
pkg-config
rustPlatform.bindgenHook
];
buildInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [
libiconv
openssl
];
OPENSSL_NO_VENDOR = 1;
LIBPG_QUERY_PATH = libpg_query;
checkFlags = [
# depends on the PostgreSQL version
"--skip=parse::tests::test_parse_sql_query_json"
];
meta = {
description = "Linter for PostgreSQL, focused on migrations";
homepage = "https://squawkhq.com";
changelog = "https://github.com/sbdchd/squawk/blob/v${version}/CHANGELOG.md";
license = with lib.licenses; [ gpl3Only ];
maintainers = with lib.maintainers; [ andrewsmith ];
};
}