From 94141b785f633d5355cd0d34c0591a511c5734c5 Mon Sep 17 00:00:00 2001 From: Ivan Trubach Date: Tue, 16 May 2023 18:34:14 +0300 Subject: [PATCH] pufferpanel: fix build on i686-linux --- pkgs/servers/pufferpanel/bump-sha1cd.patch | 28 ++++++++++++++++++++++ pkgs/servers/pufferpanel/default.nix | 16 +++++++++---- 2 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 pkgs/servers/pufferpanel/bump-sha1cd.patch diff --git a/pkgs/servers/pufferpanel/bump-sha1cd.patch b/pkgs/servers/pufferpanel/bump-sha1cd.patch new file mode 100644 index 00000000000..944d4adac5d --- /dev/null +++ b/pkgs/servers/pufferpanel/bump-sha1cd.patch @@ -0,0 +1,28 @@ +diff --git a/go.mod b/go.mod +index 107660ef..8efd7ebf 100644 +--- a/go.mod ++++ b/go.mod +@@ -128,7 +128,7 @@ require ( + github.com/pelletier/go-toml v1.9.5 // indirect + github.com/pelletier/go-toml/v2 v2.0.6 // indirect + github.com/pierrec/lz4/v4 v4.1.2 // indirect +- github.com/pjbgf/sha1cd v0.2.0 // indirect ++ github.com/pjbgf/sha1cd v0.3.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/robfig/cron/v3 v3.0.1 // indirect + github.com/rogpeppe/go-internal v1.9.0 // indirect +diff --git a/go.sum b/go.sum +index 021d3ab9..13592e36 100644 +--- a/go.sum ++++ b/go.sum +@@ -485,8 +485,9 @@ github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvI + github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= + github.com/pierrec/lz4/v4 v4.1.2 h1:qvY3YFXRQE/XB8MlLzJH7mSzBs74eA2gg52YTk6jUPM= + github.com/pierrec/lz4/v4 v4.1.2/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +-github.com/pjbgf/sha1cd v0.2.0 h1:gIsJVwjbRviE4gydidGztxH1IlJQoYBcCrwG4Dz8wvM= + github.com/pjbgf/sha1cd v0.2.0/go.mod h1:HOK9QrgzdHpbc2Kzip0Q1yi3M2MFGPADtR6HjG65m5M= ++github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= ++github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= + github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= + github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= + github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= diff --git a/pkgs/servers/pufferpanel/default.nix b/pkgs/servers/pufferpanel/default.nix index be2aaffd1e9..f8c61ea1769 100644 --- a/pkgs/servers/pufferpanel/default.nix +++ b/pkgs/servers/pufferpanel/default.nix @@ -5,6 +5,7 @@ , fetchzip , fetchpatch , pathDeps ? [ ] +, nixosTests }: buildGoModule rec { @@ -13,19 +14,20 @@ buildGoModule rec { patches = [ # Bump go-sqlite3 version to avoid a GNU C compiler error. - # See https://github.com/PufferPanel/PufferPanel/pull/1240 (fetchpatch { - url = "https://github.com/PufferPanel/PufferPanel/pull/1240/commits/3065dca2d9b05a56789971ccf0f43a7079a390b8.patch"; + url = "https://github.com/PufferPanel/PufferPanel/commit/dd7fc80c33c7618c98311af09c78c25b77658aef.patch"; hash = "sha256-ygMrhJoba8swoRBBii7BEiLihqOebLUtSH7os7W3s+k="; }) # Fix errors in tests. - # See https://github.com/PufferPanel/PufferPanel/pull/1241 (fetchpatch { - url = "https://github.com/PufferPanel/PufferPanel/pull/1241/commits/ffd21bce4bff3040c8e3e783e5b4779222e7a3a5.patch"; + url = "https://github.com/PufferPanel/PufferPanel/commit/ad6ab4b4368e1111292fadfb3d9f058fa399fa21.patch"; hash = "sha256-BzGfcWhzRrCHKkAhWf0uvXiiiutWqthn/ed7bN2hR8U="; }) + # Bump sha1cd package, otherwise i686-linux fails to build. + ./bump-sha1cd.patch + # Seems to be an anti-feature. Startup is the only place where user/group is # hardcoded and checked. # @@ -68,7 +70,7 @@ buildGoModule rec { nativeBuildInputs = [ makeWrapper ]; - vendorHash = "sha256-fB8MxSl9E2W+BdO6i+drbCe9Z3bPHPi0MvpJEomU9co="; + vendorHash = "sha256-Esfk7SvqiWeiobXSI+4wYVEH9yVkB+rO7bxUQ5TzvG4="; proxyVendor = true; postFixup = '' @@ -90,6 +92,10 @@ buildGoModule rec { --prefix PATH : ${lib.escapeShellArg (lib.makeBinPath pathDeps)} ''; + passthru.tests = { + inherit (nixosTests) pufferpanel; + }; + meta = with lib; { description = "A free, open source game management panel"; homepage = "https://www.pufferpanel.com/";