Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / libpg_query / default.nix
blob36820a2eecc27f7448a0664798676dfa77061b5b
1 { lib, stdenv, fetchFromGitHub, which, squawk }:
3 stdenv.mkDerivation rec {
4   pname = "libpg_query";
5   version = "15-4.2.3";
7   src = fetchFromGitHub {
8     owner = "pganalyze";
9     repo = "libpg_query";
10     rev = version;
11     hash = "sha256-/HUg6x0il5WxENmgR3slu7nmXTKv6YscjpX569Dztko=";
12   };
14   nativeBuildInputs = [ which ];
16   makeFlags = [ "build" "build_shared" ];
18   installPhase = ''
19     install -Dm644 -t $out/lib libpg_query.a
20     install -Dm644 -t $out/include pg_query.h
21     install -Dm644 -t $out/lib libpg_query${stdenv.hostPlatform.extensions.sharedLibrary}
22   '';
24   doCheck = true;
25   checkTarget = "test";
27   passthru.tests = {
28     inherit squawk;
29   };
31   meta = with lib; {
32     homepage = "https://github.com/pganalyze/libpg_query";
33     description = "C library for accessing the PostgreSQL parser outside of the server environment";
34     changelog = "https://github.com/pganalyze/libpg_query/blob/${version}/CHANGELOG.md";
35     license = licenses.bsd3;
36     platforms = platforms.unix;
37     maintainers = [ maintainers.marsam ];
38   };