mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-15 17:34:04 +00:00
Merge pull request #318084 from katexochen/snicat/mods
snicat: migrate to buildGoModule
This commit is contained in:
commit
5876493232
12
pkgs/by-name/sn/snicat/deps.nix
generated
12
pkgs/by-name/sn/snicat/deps.nix
generated
@ -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=";
|
||||
};
|
||||
}
|
||||
]
|
@ -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; {
|
||||
|
Loading…
Reference in New Issue
Block a user