summary refs log tree commit diff
path: root/pkgs/tools/networking/httplz/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/networking/httplz/default.nix')
-rw-r--r--pkgs/tools/networking/httplz/default.nix47
1 files changed, 33 insertions, 14 deletions
diff --git a/pkgs/tools/networking/httplz/default.nix b/pkgs/tools/networking/httplz/default.nix
index 2424018d885..52654a49d65 100644
--- a/pkgs/tools/networking/httplz/default.nix
+++ b/pkgs/tools/networking/httplz/default.nix
@@ -1,27 +1,46 @@
-{ stdenv, lib, fetchFromGitHub, makeWrapper, rustPlatform
-, openssl, pkg-config, darwin, libiconv }:
+{ lib
+, rustPlatform
+, fetchCrate
+, installShellFiles
+, makeWrapper
+, pkg-config
+, ronn
+, openssl
+, stdenv
+, libiconv
+, Security
+}:
 
 rustPlatform.buildRustPackage rec {
   pname = "httplz";
-  version = "1.9.2";
+  version = "1.12.1";
 
-  src = fetchFromGitHub {
-    owner = "thecoshman";
-    repo = "http";
-    rev = "v${version}";
-    sha256 = "154alxxclz78r29m656c8yahnzq0vd64s4sp19h0ca92dfw4s46y";
+  src = fetchCrate {
+    inherit version;
+    pname = "https";
+    sha256 = "sha256-vMhQHWzsZlqMVkEQHCZTB8T4ETTaf8iAS9QhgYdfcx0=";
   };
 
-  nativeBuildInputs = [ makeWrapper pkg-config ];
+  cargoSha256 = "sha256-9gnKVZ3HQs3kNj4i1cgC+Jl3dhjx7QRaHSih1HOB3nI=";
+
+  nativeBuildInputs = [
+    installShellFiles
+    makeWrapper
+    pkg-config
+    ronn
+  ];
+
   buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [
-    libiconv darwin.apple_sdk.frameworks.Security
+    libiconv
+    Security
   ];
 
-  cargoBuildFlags = [ "--bin httplz" ];
-  cargoPatches = [ ./cargo-lock.patch ];
-  cargoSha256 = "0r33vg9431jv32r03ryxb3rc4mp6h1kc00d3h1knssfvkwsh31yn";
+  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"
   '';
@@ -30,6 +49,6 @@ rustPlatform.buildRustPackage rec {
     description = "A basic http server for hosting a folder fast and simply";
     homepage = "https://github.com/thecoshman/http";
     license = licenses.mit;
-    maintainers = with maintainers; [ ];
+    maintainers = with maintainers; [ figsoda ];
   };
 }