@@ -0,0 +1,31 @@
1+{ stdenv, fetchFromGitHub, postgresql }:
2+
3+stdenv.mkDerivation rec {
4+ name = "pg_hll-${version}";
5+ version = "2.10.2-${builtins.substring 0 7 src.rev}";
6+
7+ buildInputs = [ postgresql ];
8+
9+ src = fetchFromGitHub {
10+ owner = "citusdata";
11+ repo = "postgresql-hll";
12+ rev = "9af41684d479a3097bab87d04936702c9e6baf5c";
13+ sha256 = "044x9v9kjhxb0idqb9f5i7c3yygxxsqliswl4kspqy9f9qcblckl";
14+ };
15+
16+ installPhase = ''
17+ mkdir -p $out/{lib,share/extension}
18+
19+ cp *.so $out/lib
20+ cp *.sql $out/share/extension
21+ cp *.control $out/share/extension
22+ '';
23+
24+ meta = with stdenv.lib; {
25+ description = "HyperLogLog for PostgreSQL";
26+ homepage = https://www.citusdata.com/;
27+ maintainers = with maintainers; [ thoughtpolice ];
28+ platforms = platforms.linux;
29+ license = licenses.asl20;
30+ };
31+}