1{ stdenv, lib, fetchFromGitHub, gcc, postgresql }:
2
3stdenv.mkDerivation {
4
5 name = "pg_similarity-1.0";
6 src = fetchFromGitHub {
7 owner = "eulerto";
8 repo = "pg_similarity";
9 rev = "be1a8b08c8716e59b89982557da9ea68cdf868c5";
10 sha256 = "1z4v4r2yccdr8kz3935fnk1bc5vj0qj0apscldyap4wxlyi89xim";
11 };
12
13 buildInputs = [ postgresql gcc ];
14 buildPhase = "USE_PGXS=1 make";
15 installPhase = ''
16 mkdir -p $out/bin # for buildEnv to setup proper symlinks
17 install -D pg_similarity.so -t $out/lib/
18 install -D ./{pg_similarity--unpackaged--1.0.sql,pg_similarity--1.0.sql,pg_similarity.control} -t $out/share/extension
19 '';
20
21 meta = {
22 description = ''
23 pg_similarity is an extension to support similarity queries on PostgreSQL. The implementation
24 is tightly integrated in the RDBMS in the sense that it defines operators so instead of the traditional
25 operators (= and <>) you can use ~~~ and ~!~ (any of these operators represents a similarity function).
26 '';
27 platforms = stdenv.lib.platforms.linux;
28 license = stdenv.lib.licenses.gpl2;
29 maintainers = with lib.maintainers; [ danbst ];
30 };
31}