From f412bce03a634406d929b22e615765a65ef61606 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Tue, 20 Sep 2022 23:11:36 +0800 Subject: [PATCH] hugo: fix cross compilation --- pkgs/applications/misc/hugo/default.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/misc/hugo/default.nix b/pkgs/applications/misc/hugo/default.nix index 0e176e1971e8..7f4b42351ff0 100644 --- a/pkgs/applications/misc/hugo/default.nix +++ b/pkgs/applications/misc/hugo/default.nix @@ -1,4 +1,4 @@ -{ lib, buildGoModule, fetchFromGitHub, installShellFiles }: +{ stdenv, lib, buildGoModule, fetchFromGitHub, installShellFiles, buildPackages }: buildGoModule rec { pname = "hugo"; @@ -25,13 +25,13 @@ buildGoModule rec { ldflags = [ "-s" "-w" "-X github.com/gohugoio/hugo/common/hugo.vendorInfo=nixpkgs" ]; - postInstall = '' - $out/bin/hugo gen man + postInstall = let emulator = stdenv.hostPlatform.emulator buildPackages; in '' + ${emulator} $out/bin/hugo gen man installManPage man/* installShellCompletion --cmd hugo \ - --bash <($out/bin/hugo completion bash) \ - --fish <($out/bin/hugo completion fish) \ - --zsh <($out/bin/hugo completion zsh) + --bash <(${emulator} $out/bin/hugo completion bash) \ + --fish <(${emulator} $out/bin/hugo completion fish) \ + --zsh <(${emulator} $out/bin/hugo completion zsh) ''; meta = with lib; {