Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 56e12aae54bc
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 551cee25b675
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Nov 27, 2018

  1. stern: build shell completion scripts even when cross-compiling (#51075)

    Moments after merging #49668 I realized that this is not hard to do
    correctly, so here it is now.
    benley authored Nov 27, 2018

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    NeQuissimus Tim Steinbach
    Copy the full SHA
    551cee2 View commit details
Showing with 11 additions and 9 deletions.
  1. +11 −9 pkgs/applications/networking/cluster/stern/default.nix
20 changes: 11 additions & 9 deletions pkgs/applications/networking/cluster/stern/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{ stdenv, lib, buildGoPackage, fetchFromGitHub }:
{ stdenv, lib, buildPackages, buildGoPackage, fetchFromGitHub }:

let isCrossBuild = stdenv.hostPlatform != stdenv.buildPlatform; in

buildGoPackage rec {
name = "stern-${version}";
@@ -15,14 +17,14 @@ buildGoPackage rec {

goDeps = ./deps.nix;

# Only build shell completion if we're _not_ cross compiling,
# because it requires executing the compiled stern binary.
postInstall = lib.optionalString (stdenv.buildPlatform == stdenv.hostPlatform) ''
mkdir -p $bin/share/bash-completion/completions
$bin/bin/stern --completion bash > $bin/share/bash-completion/completions/stern
mkdir -p $bin/share/zsh/site-functions
$bin/bin/stern --completion zsh > $bin/share/zsh/site-functions/_stern
'';
postInstall =
let stern = if isCrossBuild then buildPackages.stern else "$bin"; in
''
mkdir -p $bin/share/bash-completion/completions
${stern}/bin/stern --completion bash > $bin/share/bash-completion/completions/stern
mkdir -p $bin/share/zsh/site-functions
${stern}/bin/stern --completion zsh > $bin/share/zsh/site-functions/_stern
'';

meta = with lib; {
description = "Multi pod and container log tailing for Kubernetes";