1{ lib, bundlerApp, fetchurl, bundlerUpdateScript }:
2
3let
4 LIB_PG_QUERY_TAG = "10-1.0.1";
5 libpgQuerySrc = fetchurl {
6 name = "libpg_query.tar.gz";
7 url = "https://codeload.github.com/lfittl/libpg_query/tar.gz/${LIB_PG_QUERY_TAG}";
8 sha256 = "0m5jv134hgw2vcfkqlnw80fr3wmrdvgrvk1ndcx9s44bzi5nsp47";
9 };
10in bundlerApp {
11 pname = "sqlint";
12 gemdir = ./.;
13
14 exes = [ "sqlint" ];
15
16 gemConfig = {
17 pg_query = attrs: {
18 dontBuild = false;
19 postPatch = ''
20 substituteInPlace ext/pg_query/extconf.rb \
21 --replace "#{workdir}/libpg_query.tar.gz" "${libpgQuerySrc}"
22 '';
23 };
24 };
25
26 passthru.updateScript = bundlerUpdateScript "sqlint";
27
28 meta = with lib; {
29 description = "Simple SQL linter";
30 homepage = "https://github.com/purcell/sqlint";
31 license = licenses.mit;
32 maintainers = with maintainers; [ ariutta nicknovitski ];
33 platforms = with platforms; [ "x86_64-linux" "x86_64-darwin" ];
34 };
35}