From 2cde68f821d1fb45d95da20ebac971247aee952c Mon Sep 17 00:00:00 2001 From: azahi Date: Fri, 3 Apr 2026 13:01:35 +0300 Subject: [PATCH] seaweedfs: 4.17 -> 4.18 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: ᎠᎡ. Ѕϵrgϵ Ѵictor --- pkgs/by-name/se/seaweedfs/package.nix | 106 +++++++++++++++++++------- 1 file changed, 78 insertions(+), 28 deletions(-) diff --git a/pkgs/by-name/se/seaweedfs/package.nix b/pkgs/by-name/se/seaweedfs/package.nix index e4aac4235040..f42b91b6f137 100644 --- a/pkgs/by-name/se/seaweedfs/package.nix +++ b/pkgs/by-name/se/seaweedfs/package.nix @@ -1,76 +1,126 @@ { - lib, - stdenv, buildGoModule, fetchFromGitHub, - libredirect, iana-etc, - testers, - seaweedfs, + installShellFiles, + lib, + libredirect, + nix-update-script, + stdenv, + versionCheckHook, }: - buildGoModule (finalAttrs: { pname = "seaweedfs"; - version = "4.17"; + version = "4.18"; src = fetchFromGitHub { owner = "seaweedfs"; repo = "seaweedfs"; tag = finalAttrs.version; - hash = "sha256-xy3gXw3cbFO3OkzgEmIecvxPJT15tn58FI4ppibckzE="; + leaveDotGit = true; + postFetch = '' + pushd "$out" + git rev-parse --short HEAD 2>/dev/null >$out/COMMIT + find "$out" -name .git -print0 | xargs -0 rm -rf + popd + ''; + hash = "sha256-X0/BCdLpM7Cs2Q7goW9JHw8tA+ztlm+qxusn+OIQ/qg="; }; - vendorHash = "sha256-XbfKYftKfbJDkbp9DwVAs56w5lMvqdlW5cwhhivniBM="; + postPatch = '' + # Remove unmaintained code that's not used and generates various issues. + rm -rf unmaintained + ''; - nativeBuildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libredirect.hook ]; + vendorHash = "sha256-W5fRmE89IBP5h11+Op3mkCQw9WkUgAtXduEHBdHiQVI="; + + nativeBuildInputs = [ + installShellFiles + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libredirect.hook + ]; subPackages = [ "weed" ]; - ldflags = [ - "-s" - "-X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=N/A" - ]; - tags = [ "elastic" "gocdk" + "rclone" "sqlite" - "ydb" + "tarantool" "tikv" + "ydb" ]; + ldflags = [ + "-s" + "-extldflags=-static" + ]; + + env = { + CGO_ENABLED = 0; + GODEBUG = "http2client=0"; + }; + preBuild = '' - export GODEBUG=http2client=0 + ldflags+=" -X \"github.com/seaweedfs/seaweedfs/weed/util/version.COMMIT=$(