1{ darwin
2, fetchFromGitHub
3, lib
4, libiconv
5, libpg_query
6, openssl
7, pkg-config
8, rustPlatform
9, stdenv
10}:
11
12rustPlatform.buildRustPackage rec {
13 pname = "squawk";
14 version = "0.24.0";
15
16 src = fetchFromGitHub {
17 owner = "sbdchd";
18 repo = pname;
19 rev = "v${version}";
20 hash = "sha256-eic5j/mD4PBCMcATTSTJSKazZFJOxQuW7NyiYPjKCcM=";
21 };
22
23 cargoHash = "sha256-kzb00W9IlshhiV+vUIOlO6BnprHr2XPf8P207WYFP5I=";
24
25 nativeBuildInputs = [
26 pkg-config
27 rustPlatform.bindgenHook
28 ];
29
30 buildInputs = lib.optionals (!stdenv.isDarwin) [
31 libiconv
32 openssl
33 ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
34 CoreFoundation
35 Security
36 ]);
37
38 OPENSSL_NO_VENDOR = 1;
39
40 LIBPG_QUERY_PATH = libpg_query;
41
42 meta = with lib; {
43 description = "Linter for PostgreSQL, focused on migrations";
44 homepage = "https://squawkhq.com/";
45 changelog = "https://github.com/sbdchd/squawk/blob/v${version}/CHANGELOG.md";
46 license = licenses.gpl3Only;
47 maintainers = with lib.maintainers; [ andrewsmith ];
48 };
49}