cert-viewer: fix cross-compilation

Tested with `nix-build -A pkgsCross.armv7l-hf-multiplatform.cert-viewer`.

Fixes: 97faa99d9d ("cert-viewer: install manual page")
This commit is contained in:
Bjørn Forsman 2024-04-26 19:22:27 +02:00
parent dfd38d2388
commit 2066dc9896

View File

@ -1,7 +1,9 @@
{ buildGoModule
, buildPackages
, fetchFromGitHub
, lib
, installShellFiles
, stdenv
}:
buildGoModule rec {
@ -21,10 +23,17 @@ buildGoModule rec {
installShellFiles
];
postInstall = ''
$out/bin/cert-viewer --help-man > cert-viewer.1
installManPage cert-viewer.1
'';
postInstall =
let
prog =
if stdenv.buildPlatform.canExecute stdenv.hostPlatform
then "$out/bin/cert-viewer"
else lib.getExe buildPackages.cert-viewer;
in
''
${prog} --help-man > cert-viewer.1
installManPage cert-viewer.1
'';
meta = {
description = "Admin tool to view and inspect multiple x509 Certificates";