depot/third_party/nixpkgs/pkgs/development/tools/rust/cargo-pgrx/default.nix
Default email b5f92a349c Project import generated by Copybara.
GitOrigin-RevId: 7c9cc5a6e5d38010801741ac830a3f8fd667a7a0
2023-10-19 15:55:26 +02:00

38 lines
1,002 B
Nix

{ lib, stdenv, fetchCrate, rustPlatform, pkg-config, openssl, Security }:
let
pname = "cargo-pgrx";
version = "0.11.0";
in
rustPlatform.buildRustPackage rec {
inherit version pname;
src = fetchCrate {
inherit version pname;
hash = "sha256-GiUjsSqnrUNgiT/d3b8uK9BV7cHFvaDoq6cUGRwPigM=";
};
cargoHash = "sha256-oXOPpK8VWzbFE1xHBQYyM5+YP/pRdLvTVN/fjxrgD/c=";
nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl ]
++ lib.optionals stdenv.isDarwin [ Security ];
preCheck = ''
export PGRX_HOME=$(mktemp -d)
'';
checkFlags = [
# requires pgrx to be properly initialized with cargo pgrx init
"--skip=command::schema::tests::test_parse_managed_postmasters"
];
meta = with lib; {
description = "Build Postgres Extensions with Rust!";
homepage = "https://github.com/tcdi/pgrx";
changelog = "https://github.com/tcdi/pgrx/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ happysalada ];
};
}