Files
nixpkgs/pkgs/by-name/pd/pdqsort/package.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

50 lines
1.1 KiB
Nix

{
lib,
stdenvNoCC,
stdenv, # for tests
fetchFromGitHub,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "pdqsort";
version = "0-unstable-2021-03-14";
src = fetchFromGitHub {
owner = "orlp";
repo = "pdqsort";
rev = "b1ef26a55cdb60d236a5cb199c4234c704f46726";
hash = "sha256-xn3Jjn/jxJBckpg1Tx3HHVAWYPVTFMiDFiYgB2WX7Sc=";
};
installPhase = ''
runHook preInstall
mkdir -p $out/include
cp -r *.h $out/include/
runHook postInstall
'';
# The benchmark takes too long to run as a regular checkPhase here.
passthru.tests.bench = stdenv.mkDerivation {
pname = "pdqsort-bench";
inherit (finalAttrs) version src;
doCheck = true;
checkPhase = ''
c++ bench/bench.cpp -o bench/bench
./bench/bench > $out
'';
meta.platforms = lib.platforms.x86_64;
};
meta = {
description = "Novel sorting algorithm that combines the fast average case of randomized quicksort with the fast worst case of heapsort";
homepage = "https://github.com/orlp/pdqsort";
license = lib.licenses.zlib;
maintainers = with lib.maintainers; [ jherland ];
};
})