2021-05-20 23:08:51 +00:00
|
|
|
{ lib, stdenv, rustPlatform, fetchFromGitHub, pkg-config, openssl, Security }:
|
2021-04-26 19:14:03 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "simple-http-server";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "0.6.2";
|
2021-04-26 19:14:03 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "TheWaWaR";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-08-12 12:06:08 +00:00
|
|
|
sha256 = "sha256-ndLFN9FZZA+zsb+bjZ3gMvQJqo6I92erGOQ44H+/LCg=";
|
2021-04-26 19:14:03 +00:00
|
|
|
};
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
cargoLock.lockFile = ./Cargo.lock;
|
|
|
|
|
|
|
|
patches = [ ./0001-cargo-remove-vendored-openssl.patch ];
|
|
|
|
postPatch = ''
|
|
|
|
cp ${./Cargo.lock} Cargo.lock
|
|
|
|
'';
|
2021-04-26 19:14:03 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
buildInputs = [ openssl ] ++ lib.optional stdenv.isDarwin Security;
|
2021-04-26 19:14:03 +00:00
|
|
|
|
|
|
|
# Currently no tests are implemented, so we avoid building the package twice
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Simple HTTP server in Rust";
|
|
|
|
homepage = "https://github.com/TheWaWaR/simple-http-server";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ mephistophiles ];
|
|
|
|
};
|
|
|
|
}
|