2023-02-16 17:41:37 +00:00
|
|
|
{ darwin
|
|
|
|
, fetchFromGitHub
|
|
|
|
, lib
|
|
|
|
, libiconv
|
|
|
|
, libpg_query
|
|
|
|
, openssl
|
|
|
|
, pkg-config
|
|
|
|
, rustPlatform
|
|
|
|
, stdenv
|
|
|
|
}:
|
2023-03-27 19:17:25 +00:00
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "squawk";
|
2024-06-20 14:57:18 +00:00
|
|
|
version = "1.0.0";
|
2023-02-16 17:41:37 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sbdchd";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-06-20 14:57:18 +00:00
|
|
|
hash = "sha256-Uc357UspC2O/IxRRTy04jubzhKDRnIAN2CoHvbrGbHg=";
|
2023-02-16 17:41:37 +00:00
|
|
|
};
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
cargoHash = "sha256-G0t3wvcp1Dm0ZCDnzTVf1XJ2Dtr0LyrKM1Vvso0IoaA=";
|
2023-02-16 17:41:37 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
rustPlatform.bindgenHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = lib.optionals (!stdenv.isDarwin) [
|
|
|
|
libiconv
|
|
|
|
openssl
|
|
|
|
] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
|
|
|
|
CoreFoundation
|
|
|
|
Security
|
|
|
|
]);
|
|
|
|
|
2023-02-22 10:55:15 +00:00
|
|
|
OPENSSL_NO_VENDOR = 1;
|
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
LIBPG_QUERY_PATH = libpg_query;
|
2023-02-16 17:41:37 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
checkFlags = [
|
|
|
|
# depends on the PostgreSQL version
|
|
|
|
"--skip=parse::tests::test_parse_sql_query_json"
|
|
|
|
];
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Linter for PostgreSQL, focused on migrations";
|
|
|
|
homepage = "https://squawkhq.com/";
|
|
|
|
changelog = "https://github.com/sbdchd/squawk/blob/v${version}/CHANGELOG.md";
|
|
|
|
license = licenses.gpl3Only;
|
2024-05-15 15:35:15 +00:00
|
|
|
maintainers = with lib.maintainers; [ andrewsmith ];
|
2023-02-16 17:41:37 +00:00
|
|
|
};
|
|
|
|
}
|