diff --git a/pkgs/servers/static-web-server/default.nix b/pkgs/servers/static-web-server/default.nix index a38c1bcc3636..3e29f5aa42d7 100644 --- a/pkgs/servers/static-web-server/default.nix +++ b/pkgs/servers/static-web-server/default.nix @@ -1,41 +1,57 @@ -{ lib, rustPlatform, fetchFromGitHub, stdenv, darwin, nixosTests }: +{ + lib, + rustPlatform, + fetchFromGitHub, + fetchpatch, + stdenv, + darwin, + nixosTests, +}: rustPlatform.buildRustPackage rec { pname = "static-web-server"; - version = "2.24.2"; + version = "2.32.1"; src = fetchFromGitHub { owner = "static-web-server"; repo = pname; rev = "v${version}"; - hash = "sha256-5Axqn3sYLM4yjGkN8d0ZUe8KrjYszaZmTg5GqmamNtc="; + hash = "sha256-PkDT6FU6JSIeeKCJeeIjjqZfoo+tGzqyPyWuIiwusQY="; }; - cargoHash = "sha256-xS2XARqXXcQ2J1k3jC5St19RdcK2korbEia4koUxG5s="; + cargoHash = "sha256-ymI5O6j6NEcgIbMLEYgyUZBBkwxDWDWaVn4hqJScGxA="; - buildInputs = lib.optionals stdenv.isDarwin [ - darwin.apple_sdk.frameworks.Security + patches = [ + (fetchpatch { + url = "https://github.com/static-web-server/static-web-server/pull/466.patch"; + hash = "sha256-VYSoi6swG4nEFmGKvdEaJ05mJlxaXYsjs8cQai40P4g="; + }) ]; - checkFlags = [ - # TODO: investigate why these tests fail - "--skip=tests::handle_byte_ranges_if_range_too_old" - "--skip=tests::handle_not_modified" - "--skip=handle_precondition" - ]; + buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ]; + + # Some tests rely on timestamps newer than 18 Nov 1974 00:00:00 + preCheck = '' + find docker/public -exec touch -m {} \; + ''; # Need to copy in the systemd units for systemd.packages to discover them postInstall = '' install -Dm444 -t $out/lib/systemd/system/ systemd/static-web-server.{service,socket} ''; - passthru.tests = { inherit (nixosTests) static-web-server; }; + passthru.tests = { + inherit (nixosTests) static-web-server; + }; meta = with lib; { description = "Asynchronous web server for static files-serving"; homepage = "https://static-web-server.net/"; changelog = "https://github.com/static-web-server/static-web-server/blob/v${version}/CHANGELOG.md"; - license = with licenses; [ mit /* or */ asl20 ]; + license = with licenses; [ + mit # or + asl20 + ]; maintainers = with maintainers; [ figsoda ]; mainProgram = "static-web-server"; };