push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
{
lib,
buildGoModule,
fetchFromGitHub,
curl,
stdenv,
testers,
static-server,
replaceVars,
}:
buildGoModule rec {
pname = "static-server";
version = "1.2.1";
src = fetchFromGitHub {
owner = "eliben";
repo = "static-server";
rev = "v${version}";
hash = "sha256-AZcNh/kF6IdAceA7qe+nhRlwU4yGh19av/S1Zt7iKIs=";
};
vendorHash = "sha256-1p3dCLLo+MTPxf/Y3zjxTagUi+tq7nZSj4ZB/aakJGY=";
patches = [
# patch out debug.ReadBuidlInfo since version information is not available with buildGoModule
(replaceVars ./version.patch {
inherit version;
})
];
nativeCheckInputs = [
curl
];
ldflags = [
"-s"
"-w"
];
# tests sometimes fail with SIGQUIT on darwin
doCheck = !stdenv.hostPlatform.isDarwin;
passthru.tests = {
version = testers.testVersion {
package = static-server;
};
};
__darwinAllowLocalNetworking = true;
meta = with lib; {
description = "Simple, zero-configuration HTTP server CLI for serving static files";
homepage = "https://github.com/eliben/static-server";
license = licenses.unlicense;
maintainers = with maintainers; [ figsoda ];
mainProgram = "static-server";
};
}

View File

@@ -0,0 +1,23 @@
--- a/internal/server/server.go
+++ b/internal/server/server.go
@@ -15,7 +15,6 @@ import (
"net"
"net/http"
"os"
- "runtime/debug"
"strings"
)
@@ -50,11 +49,7 @@ func Main() int {
flags.Parse(os.Args[1:])
if *versionFlag {
- if buildInfo, ok := debug.ReadBuildInfo(); ok {
- fmt.Printf("%v %v\n", programName, buildInfo.Main.Version)
- } else {
- errorLog.Printf("version info unavailable! run 'go version -m %v'", programName)
- }
+ fmt.Printf("%v %v\n", programName, "@version@")
os.Exit(0)
}