1{
2 lib,
3 stdenv,
4 fetchurl,
5 libxcrypt,
6}:
7
8stdenv.mkDerivation rec {
9 pname = "thttpd";
10 version = "2.29";
11
12 src = fetchurl {
13 url = "https://acme.com/software/thttpd/${pname}-${version}.tar.gz";
14 sha256 = "15x3h4b49wgfywn82i3wwbf38mdns94mbi4ma9xiwsrjv93rzh4r";
15 };
16
17 prePatch = ''
18 sed -i -e 's/getline/getlineX/' extras/htpasswd.c
19 sed -i -e 's/chmod 2755/chmod 755/' extras/Makefile.in
20 '';
21
22 # Work around failures with GCC 14, upstream is inactive unfortunately
23 # https://gcc.gnu.org/gcc-14/porting_to.html#warnings-as-errors
24 NIX_CFLAGS_COMPILE = [
25 "-Wno-error=implicit-int"
26 "-Wno-error=implicit-function-declaration"
27 ];
28
29 buildInputs = [
30 libxcrypt
31 ];
32
33 preInstall = ''
34 mkdir -p "$out/man/man1"
35 sed -i -e 's/-o bin -g bin *//' Makefile
36 sed -i -e '/chgrp/d' extras/Makefile
37 '';
38
39 meta = {
40 description = "Tiny/turbo/throttling HTTP server";
41 homepage = "http://www.acme.com/software/thttpd/";
42 license = lib.licenses.bsd2;
43 platforms = lib.platforms.linux;
44 };
45}