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

51 lines
1.4 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
rustPlatform,
libtirpc,
pam,
rpcsvc-proto,
enablePAM ? stdenv.hostPlatform.isLinux,
}:
rustPlatform.buildRustPackage rec {
pname = "webdav-server-rs";
# The v0.4.0 tag cannot build. So we use the 547602e commit.
version = "unstable-2021-08-16";
src = fetchFromGitHub {
owner = "miquels";
repo = pname;
rev = "547602e78783935b4ddd038fb795366c9c476bcc";
sha256 = "sha256-nTygUEjAUXD0mRTmjt8/UPVfZA4rP6oop1s/fI5mYeg=";
};
useFetchCargoVendor = true;
cargoHash = "sha256-0Ee0L3gKNP1O3SFkImBzQrT1fgnWFrrW8owxEM1dUYQ=";
buildInputs = [ libtirpc ] ++ lib.optional enablePAM pam;
nativeBuildInputs = [ rpcsvc-proto ];
buildNoDefaultFeatures = true;
buildFeatures = [ "quota" ] ++ lib.optional enablePAM "pam";
postPatch = ''
substituteInPlace fs_quota/build.rs \
--replace '/usr/include/tirpc' '${libtirpc.dev}/include/tirpc'
'';
meta = with lib; {
description = "Implementation of WebDAV server in Rust";
longDescription = ''
webdav-server-rs is an implementation of WebDAV with full support for
RFC4918. It also supports local unix accounts, PAM authentication, and
quota.
'';
homepage = "https://github.com/miquels/webdav-server-rs";
license = licenses.asl20;
maintainers = with maintainers; [ pmy ];
mainProgram = "webdav-server";
};
}