go-ethereum: Make multi output

Put geth in a separate output and prepare the expression for more
derivation outputs.

For now we only have a separate `geth` output since that's the most relevant.
This commit is contained in:
adisbladis 2021-02-22 00:27:17 +01:00
parent fb6f9b7eb0
commit 3546114189
No known key found for this signature in database
GPG Key ID: 110BFAD44C6249B7

View File

@ -1,6 +1,12 @@
{ lib, stdenv, buildGoModule, fetchFromGitHub, libobjc, IOKit }:
buildGoModule rec {
let
# A list of binaries to put into separate outputs
bins = [
"geth"
];
in buildGoModule rec {
pname = "go-ethereum";
version = "1.9.25";
@ -16,6 +22,13 @@ buildGoModule rec {
doCheck = false;
outputs = [ "out" ] ++ bins;
# Move binaries to separate outputs and symlink them back to $out
postInstall = lib.concatStringsSep "\n" (
builtins.map (bin: "mkdir -p \$${bin}/bin && mv $out/bin/${bin} \$${bin}/bin/ && ln -s \$${bin}/bin/${bin} $out/bin/") bins
);
subPackages = [
"cmd/abidump"
"cmd/abigen"