uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
|
|
@ -0,0 +1,28 @@
|
|||
From e3651ca79c0edb66c04e0d3381f3b0b6f76d37d2 Mon Sep 17 00:00:00 2001
|
||||
From: 5aaee9 <jiduye@gmail.com>
|
||||
Date: Thu, 24 Mar 2022 17:34:38 +0800
|
||||
Subject: [PATCH] fix: add nix path to exec env
|
||||
|
||||
---
|
||||
lib/srv/exec.go | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/srv/exec.go b/lib/srv/exec.go
|
||||
index 253fbafef..815a2e1e0 100644
|
||||
--- a/lib/srv/exec.go
|
||||
+++ b/lib/srv/exec.go
|
||||
@@ -41,9 +41,9 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
- defaultPath = "/bin:/usr/bin:/usr/local/bin:/sbin"
|
||||
+ defaultPath = "/run/wrappers/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/bin:/usr/bin:/usr/local/bin:/sbin"
|
||||
defaultEnvPath = "PATH=" + defaultPath
|
||||
- defaultRootPath = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
+ defaultRootPath = "/run/wrappers/bin:/etc/profiles/per-user/root/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
defaultEnvRootPath = "PATH=" + defaultRootPath
|
||||
defaultTerm = "xterm"
|
||||
defaultLoginDefsPath = "/etc/login.defs"
|
||||
--
|
||||
2.32.0 (Apple Git-132)
|
||||
|
||||
145
pkgs/servers/teleport/default.nix
Normal file
145
pkgs/servers/teleport/default.nix
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
{ lib
|
||||
, buildGoModule
|
||||
, rustPlatform
|
||||
, fetchFromGitHub
|
||||
, makeWrapper
|
||||
, symlinkJoin
|
||||
, CoreFoundation
|
||||
, openssl
|
||||
, pkg-config
|
||||
, protobuf
|
||||
, Security
|
||||
, stdenv
|
||||
, xdg-utils
|
||||
, nixosTests
|
||||
|
||||
, withRdpClient ? true
|
||||
, withRoleTester ? true
|
||||
}:
|
||||
let
|
||||
# This repo has a private submodule "e" which fetchgit cannot handle without failing.
|
||||
src = fetchFromGitHub {
|
||||
owner = "gravitational";
|
||||
repo = "teleport";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-KQfdeMuZ9LJHhEJLMl58Yb0+gxgDT7VcVnK1JxjVZaI=";
|
||||
};
|
||||
version = "9.1.2";
|
||||
|
||||
rdpClient = rustPlatform.buildRustPackage rec {
|
||||
name = "teleport-rdpclient";
|
||||
cargoSha256 = "sha256-Jz7bB/f4HRxBhSevmfELSrIm+IXUVlADIgp2qWQd5PY=";
|
||||
inherit version src;
|
||||
|
||||
buildAndTestSubdir = "lib/srv/desktop/rdp/rdpclient";
|
||||
|
||||
buildInputs = [ openssl ]
|
||||
++ lib.optionals stdenv.isDarwin [ CoreFoundation Security ];
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
|
||||
# https://github.com/NixOS/nixpkgs/issues/161570 ,
|
||||
# buildRustPackage sets strictDeps = true;
|
||||
checkInputs = buildInputs;
|
||||
|
||||
OPENSSL_NO_VENDOR = "1";
|
||||
|
||||
postInstall = ''
|
||||
cp -r target $out
|
||||
'';
|
||||
};
|
||||
|
||||
roleTester = rustPlatform.buildRustPackage {
|
||||
name = "teleport-roletester";
|
||||
inherit version src;
|
||||
|
||||
cargoSha256 = "sha256-gCm4ETbXy6tGJQVSzUkoAWUmKD3poYgkw133LtziASI=";
|
||||
buildAndTestSubdir = "lib/datalog/roletester";
|
||||
|
||||
PROTOC = "${protobuf}/bin/protoc";
|
||||
PROTOC_INCLUDE = "${protobuf}/include";
|
||||
|
||||
postInstall = ''
|
||||
cp -r target $out
|
||||
'';
|
||||
};
|
||||
|
||||
webassets = fetchFromGitHub {
|
||||
owner = "gravitational";
|
||||
repo = "webassets";
|
||||
rev = "67e608db77300d8a6cb17709be67f12c1d3271c3";
|
||||
sha256 = "sha256-o4qjXGaNi5XDSUQrUuU+G77EdRnvJ1WUPWrryZU1CUE=";
|
||||
};
|
||||
in
|
||||
buildGoModule rec {
|
||||
pname = "teleport";
|
||||
|
||||
inherit src version;
|
||||
vendorSha256 = "sha256-UMgWM7KHag99JR4i4mwVHa6yd9aHQ6Dy+pmUijNL4Ew=";
|
||||
|
||||
subPackages = [ "tool/tbot" "tool/tctl" "tool/teleport" "tool/tsh" ];
|
||||
tags = [ "webassets_embed" ]
|
||||
++ lib.optional withRdpClient "desktop_access_rdp"
|
||||
++ lib.optional withRoleTester "roletester";
|
||||
|
||||
buildInputs = [ openssl ]
|
||||
++ lib.optionals (stdenv.isDarwin && withRdpClient) [ CoreFoundation Security ];
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
patches = [
|
||||
# https://github.com/NixOS/nixpkgs/issues/120738
|
||||
./tsh.patch
|
||||
# https://github.com/NixOS/nixpkgs/issues/132652
|
||||
./test.patch
|
||||
./0001-fix-add-nix-path-to-exec-env.patch
|
||||
./rdpclient.patch
|
||||
];
|
||||
|
||||
# Reduce closure size for client machines
|
||||
outputs = [ "out" "client" ];
|
||||
|
||||
preBuild =
|
||||
let rustDeps = symlinkJoin {
|
||||
name = "teleport-rust-deps";
|
||||
paths = lib.optional withRdpClient rdpClient
|
||||
++ lib.optional withRoleTester roleTester;
|
||||
};
|
||||
in
|
||||
''
|
||||
mkdir -p build
|
||||
echo "making webassets"
|
||||
cp -r ${webassets}/* webassets/
|
||||
make lib/web/build/webassets
|
||||
|
||||
cp -r ${rustDeps}/. .
|
||||
'';
|
||||
|
||||
# Multiple tests fail in the build sandbox
|
||||
# due to trying to spawn nixbld's shell (/noshell), etc.
|
||||
doCheck = false;
|
||||
|
||||
postInstall = ''
|
||||
install -Dm755 -t $client/bin $out/bin/tsh
|
||||
wrapProgram $client/bin/tsh --prefix PATH : ${lib.makeBinPath [ xdg-utils ]}
|
||||
wrapProgram $out/bin/tsh --prefix PATH : ${lib.makeBinPath [ xdg-utils ]}
|
||||
'';
|
||||
|
||||
doInstallCheck = true;
|
||||
|
||||
installCheckPhase = ''
|
||||
$out/bin/tsh version | grep ${version} > /dev/null
|
||||
$client/bin/tsh version | grep ${version} > /dev/null
|
||||
$out/bin/tbot version | grep ${version} > /dev/null
|
||||
$out/bin/tctl version | grep ${version} > /dev/null
|
||||
$out/bin/teleport version | grep ${version} > /dev/null
|
||||
'';
|
||||
|
||||
passthru.tests = nixosTests.teleport;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Certificate authority and access plane for SSH, Kubernetes, web applications, and databases";
|
||||
homepage = "https://goteleport.com/";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ sigma tomberek freezeboy ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
17
pkgs/servers/teleport/rdpclient.patch
Normal file
17
pkgs/servers/teleport/rdpclient.patch
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
diff --git a/lib/srv/desktop/rdp/rdpclient/client.go b/lib/srv/desktop/rdp/rdpclient/client.go
|
||||
index d191c768f..71117a30d 100644
|
||||
--- a/lib/srv/desktop/rdp/rdpclient/client.go
|
||||
+++ b/lib/srv/desktop/rdp/rdpclient/client.go
|
||||
@@ -56,10 +56,10 @@ package rdpclient
|
||||
#cgo linux,amd64 LDFLAGS: -L${SRCDIR}/../../../../../target/x86_64-unknown-linux-gnu/release
|
||||
#cgo linux,arm LDFLAGS: -L${SRCDIR}/../../../../../target/arm-unknown-linux-gnueabihf/release
|
||||
#cgo linux,arm64 LDFLAGS: -L${SRCDIR}/../../../../../target/aarch64-unknown-linux-gnu/release
|
||||
-#cgo linux LDFLAGS: -l:librdp_client.a -lpthread -ldl -lm
|
||||
+#cgo linux LDFLAGS: -l:librdp_client.a -lpthread -ldl -lm -lssl -lcrypto
|
||||
#cgo darwin,amd64 LDFLAGS: -L${SRCDIR}/../../../../../target/x86_64-apple-darwin/release
|
||||
#cgo darwin,arm64 LDFLAGS: -L${SRCDIR}/../../../../../target/aarch64-apple-darwin/release
|
||||
-#cgo darwin LDFLAGS: -framework CoreFoundation -framework Security -lrdp_client -lpthread -ldl -lm
|
||||
+#cgo darwin LDFLAGS: -framework CoreFoundation -framework Security -lrdp_client -lpthread -ldl -lm -lssl -lcrypto
|
||||
#include <librdprs.h>
|
||||
*/
|
||||
import "C"
|
||||
13
pkgs/servers/teleport/test.patch
Normal file
13
pkgs/servers/teleport/test.patch
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/tool/tsh/resolve_default_addr_test.go b/tool/tsh/resolve_default_addr_test.go
|
||||
index d5976f156..aec5199aa 100644
|
||||
--- a/tool/tsh/resolve_default_addr_test.go
|
||||
+++ b/tool/tsh/resolve_default_addr_test.go
|
||||
@@ -237,7 +237,7 @@ func TestResolveDefaultAddrTimeoutBeforeAllRacersLaunched(t *testing.T) {
|
||||
|
||||
blockingHandler, doneCh := newWaitForeverHandler()
|
||||
|
||||
- servers := make([]*httptest.Server, 1000)
|
||||
+ servers := make([]*httptest.Server, 100)
|
||||
for i := 0; i < len(servers); i++ {
|
||||
servers[i] = makeTestServer(t, blockingHandler)
|
||||
}
|
||||
17
pkgs/servers/teleport/tsh.patch
Normal file
17
pkgs/servers/teleport/tsh.patch
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
diff --git a/tool/tsh/tsh.go b/tool/tsh/tsh.go
|
||||
index 57379c40f..cb4d7b84c 100644
|
||||
--- a/tool/tsh/tsh.go
|
||||
+++ b/tool/tsh/tsh.go
|
||||
@@ -514,10 +514,11 @@ func Run(args []string, opts ...cliOption) error {
|
||||
}
|
||||
}
|
||||
|
||||
- cf.executablePath, err = os.Executable()
|
||||
+ tempBinaryPath, err := os.Executable()
|
||||
if err != nil {
|
||||
return trace.Wrap(err)
|
||||
}
|
||||
+ cf.executablePath = path.Dir(tempBinaryPath) + "/tsh"
|
||||
|
||||
if err := client.ValidateAgentKeyOption(cf.AddKeysToAgent); err != nil {
|
||||
return trace.Wrap(err)
|
||||
Loading…
Add table
Add a link
Reference in a new issue