1{
2 lib,
3 rustPlatform,
4 fetchFromGitHub,
5 pkg-config,
6 openssl,
7 sqlite,
8 zlib,
9 python3,
10}:
11
12rustPlatform.buildRustPackage rec {
13 pname = "prqlc";
14 version = "0.13.4";
15
16 src = fetchFromGitHub {
17 owner = "prql";
18 repo = "prql";
19 rev = version;
20 hash = "sha256-lJkZXiwZUr/qACb9X52EGR0FBOicuPMmyA1105G7gZU=";
21 };
22
23 cargoHash = "sha256-Dq5jfj5Z4W9x43LncgWspOWVtGnsJPQ8xvC1gGYiPYw=";
24
25 nativeBuildInputs = [
26 pkg-config
27 rustPlatform.bindgenHook
28 ];
29
30 buildInputs = [
31 openssl
32 sqlite
33 zlib
34 ];
35
36 env = {
37 PYO3_PYTHON = "${python3}/bin/python3";
38 };
39
40 # we are only interested in the prqlc binary
41 postInstall = ''
42 rm -r $out/bin/compile-files $out/bin/mdbook-prql $out/lib
43 '';
44
45 meta = with lib; {
46 description = "CLI for the PRQL compiler - a simple, powerful, pipelined SQL replacement";
47 homepage = "https://github.com/prql/prql";
48 changelog = "https://github.com/prql/prql/blob/${src.rev}/CHANGELOG.md";
49 license = licenses.asl20;
50 maintainers = with maintainers; [ dit7ya ];
51 };
52}