nixpkgs/pkgs/by-name/ht/httplz/package.nix
Alyssa Ross 63bff8c132
treewide: migrate to fetchCargoVendor, batch 1
Cargo 1.84.0 seems to have changed the output format of cargo vendor
again, once again invalidating fetchCargoTarball FOD hashes.  It's
time to fix this once and for all, switching across the board to
fetchCargoVendor, which is not dependent on cargo vendor's output
format.

It should be possible to reproduce this diff.  To do so, get the list
of files changed by this commit, e.g. with git diff --name-only, then
run the following two commands, each with that list of files as their
standard input:

	xargs sed -i 's/^\(. *\)\(cargoHash\)\b/\1useFetchCargoVendor = true;\n\1cargoHash/'
	cut -d / -f 4 | xargs -n 1 nix-update --version=skip

This will take a long time.  It might be possible to parallelize it
using xargs' -P option.  I haven't tested it.
2025-01-23 11:46:43 +01:00

62 lines
1.3 KiB
Nix

{
lib,
rustPlatform,
fetchCrate,
installShellFiles,
makeWrapper,
pkg-config,
ronn,
openssl,
stdenv,
darwin,
}:
rustPlatform.buildRustPackage rec {
pname = "httplz";
version = "1.13.2";
src = fetchCrate {
inherit version;
pname = "https";
hash = "sha256-uxEMgSrcxMZD/3GQuH9S/oYtMUPzgMR61ZzLcb65zXU=";
};
useFetchCargoVendor = true;
cargoHash = "sha256-DXSHaiiIRdyrlX4UYPFD3aTAv65k3x/PU2VW047odH0=";
nativeBuildInputs = [
installShellFiles
makeWrapper
pkg-config
ronn
];
buildInputs =
[ openssl ]
++ lib.optionals stdenv.hostPlatform.isDarwin [
darwin.apple_sdk.frameworks.Security
];
cargoBuildFlags = [
"--bin"
"httplz"
];
postInstall = ''
sed -E 's/http(`| |\(|$)/httplz\1/g' http.md > httplz.1.ronn
RUBYOPT=-Eutf-8:utf-8 ronn --organization "http developers" -r httplz.1.ronn
installManPage httplz.1
wrapProgram $out/bin/httplz \
--prefix PATH : "${openssl}/bin"
'';
meta = with lib; {
description = "Basic http server for hosting a folder fast and simply";
mainProgram = "httplz";
homepage = "https://github.com/thecoshman/http";
changelog = "https://github.com/thecoshman/http/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ figsoda ];
};
}