Merge pull request #318084 from katexochen/snicat/mods

snicat: migrate to buildGoModule
This commit is contained in:
Paul Meyer 2024-06-08 13:21:18 +02:00 committed by GitHub
commit 5876493232
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 23 deletions

View File

@ -1,12 +0,0 @@
[
{
goPackagePath = "github.com/therootcompany/sclient";
fetch = {
type = "FromGitHub";
owner = "therootcompany";
repo = "sclient";
rev = "v1.5.0";
sha256 = "sha256-NAFTOx2sm92K+d746Z5UpB1HGsJI6cJgmh+YTyVkJ0w=";
};
}
]

View File

@ -1,8 +1,9 @@
{ lib
, buildGoPackage
, buildGoModule
, fetchFromGitHub
, fetchpatch
}:
buildGoPackage rec {
buildGoModule rec {
pname = "snicat";
version = "0.0.1";
@ -13,18 +14,21 @@ buildGoPackage rec {
hash = "sha256-fFlTBOz127le2Y7F9KKhbcldcyFEpAU5QiJ4VCAPs9Y=";
};
goPackagePath = "github.com/CTFd/snicat";
patches = [
# Migrate to Go modules
(fetchpatch {
url = "https://github.com/CTFd/snicat/commit/098a5ce3141bae5d2e188338d78517d710d10f70.patch";
hash = "sha256-pIdXViUz14nkvL1H3u3oFkm308XA2POtKIGZOKDO6p8=";
})
];
goDeps = ./deps.nix;
vendorHash = "sha256-27ykI9HK1jFanxwa6QrN6ZS548JbFNSZHaXr4ciCVOE=";
proxyVendor = true;
ldflags = [ "-s" "-w" "-X main.version=v${version}" ];
ldflags = [ "-s" "-X main.version=v${version}" ];
installPhase = ''
runHook preInstall
install -Dm555 go/bin/snicat $out/bin/sc
runHook postInstall
postInstall = ''
mv $out/bin/snicat $out/bin/sc
'';
meta = with lib; {