@@ -0,0 +1,34 @@
1+{ lib, bundlerApp, fetchurl, ruby }:
2+
3+let
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+ };
10+in bundlerApp {
11+ pname = "sqlint";
12+ gemdir = ./.;
13+ inherit ruby;
14+
15+ exes = [ "sqlint" ];
16+
17+ gemConfig = {
18+ pg_query = attrs: {
19+ dontBuild = false;
20+ postPatch = ''
21+ substituteInPlace ext/pg_query/extconf.rb \
22+ --replace "#{workdir}/libpg_query.tar.gz" "${libpgQuerySrc}"
23+ '';
24+ };
25+ };
26+
27+ meta = with lib; {
28+ description = "Simple SQL linter";
29+ homepage = https://github.com/purcell/sqlint;
30+ license = licenses.mit;
31+ maintainers = with maintainers; [ ariutta ];
32+ platforms = with platforms; [ "x86_64-linux" "x86_64-darwin" ];
33+ };
34+}