Files
nixpkgs/pkgs/development/tools/rust/cargo-pgrx/default.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

69 lines
1.5 KiB
Nix

{
fetchCrate,
lib,
openssl,
pkg-config,
rustPlatform,
}:
let
generic =
{
version,
hash,
cargoHash,
}:
rustPlatform.buildRustPackage {
pname = "cargo-pgrx";
inherit version;
src = fetchCrate {
inherit version hash;
pname = "cargo-pgrx";
};
inherit cargoHash;
nativeBuildInputs = [
pkg-config
];
buildInputs = [
openssl
];
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 = {
description = "Build Postgres Extensions with Rust";
homepage = "https://github.com/pgcentralfoundation/pgrx";
changelog = "https://github.com/pgcentralfoundation/pgrx/releases/tag/v${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
happysalada
matthiasbeyer
];
mainProgram = "cargo-pgrx";
};
};
in
{
# Default version for direct usage.
# Not to be used with buildPgrxExtension, where it should be pinned.
# When you make an extension use the latest version, *copy* this to a separate pinned attribute.
cargo-pgrx = generic {
version = "0.16.1";
hash = "sha256-AjoBr+/sEPdzbD0wLUNVm2syCySkGaFOFQ70TST1U9w=";
cargoHash = "sha256-95DHq5GLnAqb3bbKwwaeBeKEmkfRh81ZTRaJ7L59DAg=";
};
}
// lib.mapAttrs (_: generic) (import ./pinned.nix)