Unverified Commit 58764932 authored by Paul Meyer's avatar Paul Meyer Committed by GitHub
Browse files

Merge pull request #318084 from katexochen/snicat/mods

snicat: migrate to buildGoModule
parents be1eff5d 87934e2e
Loading
Loading
Loading
Loading

pkgs/by-name/sn/snicat/deps.nix

deleted100644 → 0
+0 −12
Original line number Diff line number Diff line
[
  {
    goPackagePath = "github.com/therootcompany/sclient";
    fetch = {
      type = "FromGitHub";
      owner = "therootcompany";
      repo = "sclient";
      rev = "v1.5.0";
      sha256 = "sha256-NAFTOx2sm92K+d746Z5UpB1HGsJI6cJgmh+YTyVkJ0w=";
    };
  }
]
+15 −11
Original line number Diff line number Diff line
{ 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; {