Unverified Commit b79cb79b authored by Vilsol's avatar Vilsol
Browse files

telepresence2: 2.6.4 -> 2.15.1

parent b3485e81
Loading
Loading
Loading
Loading
+38 −12
Original line number Diff line number Diff line
{ lib, buildGoModule, fetchFromGitHub, kubernetes-helm }:
{ lib
, fetchFromGitHub
, buildGoModule
, fuse
}:

let
  fuseftp = buildGoModule rec {
    pname = "go-fuseftp";
    version = "0.4.2";

    src = fetchFromGitHub {
      owner = "datawire";
      repo = "go-fuseftp";
      rev = "v${version}";
      hash = "sha256-bkaC+EOqFPQA4fDkVhO6EqgGhOJy31yGwVbbPoRd+70=";
    };

    vendorHash = "sha256-Dk4wvg2lTGTw8vP42+XuvmMXeMluR0SPwlVHLEB8yCQ=";

    buildInputs = [ fuse ];

    ldflags = [ "-s" "-w" ];

    subPackages = [ "pkg/main" ];
  };
in
buildGoModule rec {
  pname = "telepresence2";
  version = "2.6.4";
  version = "2.15.1";

  src = fetchFromGitHub {
    owner = "telepresenceio";
    repo = "telepresence";
    rev = "v${version}";
    sha256 = "sha256-AZW58L0971GVnvafecHfVg3MWr/xGHi4ptycXcV63Fg=";
    hash = "sha256-67a5e7Lun/mlRwRoD6eomQpgUXqzAUx8IS7Mv86j6Gw=";
  };

  # The Helm chart is go:embed'ed as a tarball in the binary.
  # That tarball is generated by running ./build-aux/package_embedded_chart/main.go,
  # which tries to invoke helm from tools/bin/helm.
  # Oh well…
  propagatedBuildInputs = [
    fuseftp
  ];

  # telepresence depends on fuseftp existing as a built binary, as it gets embedded
  # CGO gets disabled to match their build process as that is how it's done upstream
  preBuild = ''
    mkdir -p tools/bin
    ln -sfn ${kubernetes-helm}/bin/helm tools/bin/helm
    go run ./build-aux/package_embedded_chart/main.go ${src.rev}
    cp ${fuseftp}/bin/main ./pkg/client/remotefs/fuseftp.bits
    export CGO_ENABLED=0
  '';

  vendorHash = "sha256-aa40+6cjpA6/bqpFiqayCkX0PBToPmsp99ykv6e7Huc=";
  vendorHash = "sha256-/13OkcLJI/q14tyFsynL5ZAIITH1w9XWpzRqZoJJesE=";

  ldflags = [
    "-s" "-w" "-X=github.com/telepresenceio/telepresence/v2/pkg/version.Version=${src.rev}"
@@ -33,7 +59,7 @@ buildGoModule rec {
    description = "Local development against a remote Kubernetes or OpenShift cluster";
    homepage = "https://telepresence.io";
    license = licenses.asl20;
    maintainers = with maintainers; [ mausch ];
    maintainers = with maintainers; [ mausch vilsol ];
    mainProgram = "telepresence";
  };
}