2023-08-10 07:59:29 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pkg-config
|
|
|
|
, openssl
|
|
|
|
, sqlite
|
|
|
|
, zlib
|
|
|
|
, stdenv
|
|
|
|
, darwin
|
|
|
|
, python3
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "prqlc";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0.10.0";
|
2023-08-10 07:59:29 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "prql";
|
|
|
|
repo = "prql";
|
|
|
|
rev = version;
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-McJ3V3kndawheWo/xsBU8Xi8K47vHMpQHTpDbR4vkWk=";
|
2023-08-10 07:59:29 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
cargoHash = "sha256-Q1PSpGpd5QRT6QKQOd6hVdZrlDBawfsqqp/CTJfnl7E=";
|
2023-08-10 07:59:29 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
rustPlatform.bindgenHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs =
|
|
|
|
[
|
|
|
|
openssl
|
|
|
|
sqlite
|
|
|
|
zlib
|
|
|
|
]
|
|
|
|
++ lib.optionals stdenv.isDarwin [
|
|
|
|
darwin.apple_sdk.frameworks.CoreFoundation
|
|
|
|
darwin.apple_sdk.frameworks.CoreServices
|
|
|
|
darwin.apple_sdk.frameworks.Security
|
|
|
|
];
|
|
|
|
|
|
|
|
env = {
|
|
|
|
PYO3_PYTHON = "${python3}/bin/python3";
|
|
|
|
};
|
|
|
|
|
|
|
|
# we are only interested in the prqlc binary
|
|
|
|
postInstall = ''
|
|
|
|
rm -r $out/bin/compile-files $out/bin/mdbook-prql $out/lib
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A CLI for the PRQL compiler - a simple, powerful, pipelined SQL replacement";
|
|
|
|
homepage = "https://github.com/prql/prql";
|
|
|
|
changelog = "https://github.com/prql/prql/blob/${src.rev}/CHANGELOG.md";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ dit7ya ];
|
|
|
|
};
|
|
|
|
}
|