Files
nixpkgs/pkgs/development/compilers/dart/package-source-builders/rhttp/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

78 lines
1.7 KiB
Nix

{
lib,
rustPlatform,
stdenv,
replaceVars,
}:
{ version, src, ... }:
let
rustDep = rustPlatform.buildRustPackage {
pname = "rhttp-rs";
inherit version src;
sourceRoot = "${src.name}/rust";
unpackPhase = ''
runHook preUnpack
if [ -d $src/rhttp ]; then
cp -r $src/rhttp ${src.name}
else
cp -r $src ${src.name}
fi
chmod -R u+w -- "$sourceRoot"
runHook postUnpack
'';
cargoHash =
{
_0_9_1 = "sha256-ZVl1nesepZnmOWeJPOgE6IDCokQm5FedbA5MBvr5S8c=";
_0_9_6 = "sha256-vvzb+jNN5lmRrKJ3zqvORvdduqEHRmbp85L/9Zegh/E=";
_0_9_8 = "sha256-cwb1wYVXOE5YABlMxUDt+OMlDpIlipqeNI7ZFAGHCqo=";
_0_10_0 = "sha256-2SpAj53XvZXKRpMzFXJGcx7E2TlMUD+ooHkFwg/9fe4=";
_0_11_0 = "sha256-sngh5k9GoCZhnIFTpnAVHZjxTcOv+Ui6pJ2cFyriL84=";
_0_12_0 = "sha256-W2DcBy1n73nR2oZIQcFt6A+NElQWtfEtKB1YIweQUVo=";
}
.${"_" + (lib.replaceStrings [ "." ] [ "_" ] version)} or (throw ''
Unsupported version of pub 'rhttp': '${version}'
Please add cargoHash here. If the cargoHash
is the same with existing versions, add an alias here.
'');
env.RUSTFLAGS = "--cfg reqwest_unstable";
passthru.libraryPath = "lib/librhttp.so";
};
in
stdenv.mkDerivation {
pname = "rhttp";
inherit version src;
inherit (src) passthru;
prePatch = ''
if [ -d rhttp ]; then pushd rhttp; fi
'';
patches = [
(replaceVars ./cargokit.patch {
output_lib = "${rustDep}/${rustDep.passthru.libraryPath}";
})
];
postPatch = ''
popd || true
'';
installPhase = ''
runHook preInstall
cp -r . $out
runHook postInstall
'';
}