diff options
Diffstat (limited to 'nixpkgs/pkgs/servers/http/webfs')
-rw-r--r-- | nixpkgs/pkgs/servers/http/webfs/default.nix | 34 | ||||
-rw-r--r-- | nixpkgs/pkgs/servers/http/webfs/ls.c.patch | 13 |
2 files changed, 47 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/http/webfs/default.nix b/nixpkgs/pkgs/servers/http/webfs/default.nix new file mode 100644 index 000000000000..3fb3890f9c4e --- /dev/null +++ b/nixpkgs/pkgs/servers/http/webfs/default.nix @@ -0,0 +1,34 @@ +{ stdenv, fetchurl, openssl }: +let + # Let's not pull the whole apache httpd package + mime_file = fetchurl { + url = https://raw.githubusercontent.com/apache/httpd/906e419c1f703360e2e8ec077b393347f993884f/docs/conf/mime.types; + sha256 = "ef972fc545cbff4c0daa2b2e6b440859693b3c10435ee90f10fa6fffad800c16"; + }; +in +stdenv.mkDerivation rec { + name = "webfs-${version}"; + version = "1.21"; + + src = fetchurl { + url = "https://www.kraxel.org/releases/webfs/${name}.tar.gz"; + sha256 = "98c1cb93473df08e166e848e549f86402e94a2f727366925b1c54ab31064a62a"; + }; + + patches = [ ./ls.c.patch ]; + + buildInputs = [ openssl ]; + + makeFlags = [ + "mimefile=${mime_file}" + "prefix=$(out)" + ]; + + meta = with stdenv.lib; { + description = "HTTP server for purely static content"; + homepage = http://linux.bytesex.org/misc/webfs.html; + license = licenses.gpl2; + platforms = platforms.all; + maintainers = with maintainers; [ zimbatm ]; + }; +} diff --git a/nixpkgs/pkgs/servers/http/webfs/ls.c.patch b/nixpkgs/pkgs/servers/http/webfs/ls.c.patch new file mode 100644 index 000000000000..78b83b725887 --- /dev/null +++ b/nixpkgs/pkgs/servers/http/webfs/ls.c.patch @@ -0,0 +1,13 @@ +# Source: homebrew +# https://raw.githubusercontent.com/Homebrew/patches/0518a6d1/webfs/patch-ls.c +--- ./ls.c.orig Fri Oct 15 14:20:50 2004 ++++ ./ls.c Fri Oct 15 14:21:13 2004 +@@ -160,7 +160,7 @@ + return buf; + } + +-#if !defined(__FreeBSD__) && !defined(__OpenBSD__) ++#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__APPLE__) + static void strmode(mode_t mode, char *dest) + { + static const char *rwx[] = { |