lol
1{ lib
2, rustPlatform
3, fetchCrate
4, installShellFiles
5, makeWrapper
6, pkg-config
7, ronn
8, openssl
9, stdenv
10, libiconv
11, Security
12}:
13
14rustPlatform.buildRustPackage rec {
15 pname = "httplz";
16 version = "1.12.1";
17
18 src = fetchCrate {
19 inherit version;
20 pname = "https";
21 sha256 = "sha256-vMhQHWzsZlqMVkEQHCZTB8T4ETTaf8iAS9QhgYdfcx0=";
22 };
23
24 cargoSha256 = "sha256-9gnKVZ3HQs3kNj4i1cgC+Jl3dhjx7QRaHSih1HOB3nI=";
25
26 nativeBuildInputs = [
27 installShellFiles
28 makeWrapper
29 pkg-config
30 ronn
31 ];
32
33 buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [
34 libiconv
35 Security
36 ];
37
38 cargoBuildFlags = [ "--bin" "httplz" ];
39
40 postInstall = ''
41 sed -E 's/http(`| |\(|$)/httplz\1/g' http.md > httplz.1.ronn
42 RUBYOPT=-Eutf-8:utf-8 ronn --organization "http developers" -r httplz.1.ronn
43 installManPage httplz.1
44 wrapProgram $out/bin/httplz \
45 --prefix PATH : "${openssl}/bin"
46 '';
47
48 meta = with lib; {
49 description = "A basic http server for hosting a folder fast and simply";
50 homepage = "https://github.com/thecoshman/http";
51 license = licenses.mit;
52 maintainers = with maintainers; [ figsoda ];
53 };
54}