2021-10-06 13:57:05 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchCrate
|
|
|
|
, installShellFiles
|
|
|
|
, makeWrapper
|
|
|
|
, pkg-config
|
|
|
|
, ronn
|
|
|
|
, openssl
|
|
|
|
, stdenv
|
2023-03-24 00:07:29 +00:00
|
|
|
, darwin
|
2021-10-06 13:57:05 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "httplz";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "1.13.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-10-06 13:57:05 +00:00
|
|
|
src = fetchCrate {
|
|
|
|
inherit version;
|
|
|
|
pname = "https";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-sTkj2UkUENpezPFAzyDUz6rC4F0G864uLLYOU9fyXjo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
cargoHash = "sha256-omjm+NSny1NLUj9MCeGU6XgrVRAxMJzTbvIyfmWgoCU=";
|
2021-10-06 13:57:05 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
makeWrapper
|
|
|
|
pkg-config
|
|
|
|
ronn
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [
|
2023-03-24 00:07:29 +00:00
|
|
|
darwin.apple_sdk.frameworks.Security
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-10-06 13:57:05 +00:00
|
|
|
cargoBuildFlags = [ "--bin" "httplz" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2021-10-06 13:57:05 +00:00
|
|
|
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
|
2020-04-24 23:36:52 +00:00
|
|
|
wrapProgram $out/bin/httplz \
|
|
|
|
--prefix PATH : "${openssl}/bin"
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A basic http server for hosting a folder fast and simply";
|
|
|
|
homepage = "https://github.com/thecoshman/http";
|
2023-07-15 17:15:38 +00:00
|
|
|
changelog = "https://github.com/thecoshman/http/releases/tag/v${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2021-10-06 13:57:05 +00:00
|
|
|
maintainers = with maintainers; [ figsoda ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|