git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commit35461141898fcf83892fbbf607bfff0284118cf9 authoradisbladis <adisbladis@gmail.com> dateMon 22 Feb 2021, 00:27 (6 years ago) parentfb6f9b7
1 file changed+14−1
pkgs/applications/blockchains/go-ethereum.nix+14−1
pkgs/applications/blockchains/go-ethereum.nix+14−1
@@ -1,6 +1,12 @@
11{ lib, stdenv, buildGoModule, fetchFromGitHub, libobjc, IOKit }:
22
3−buildGoModule rec {
3+let
4+ # A list of binaries to put into separate outputs
5+ bins = [
6+ "geth"
7+ ];
8+
9+in buildGoModule rec {
410 pname = "go-ethereum";
511 version = "1.9.25";
612
@@ -16,6 +22,13 @@ buildGoModule rec {
1622
1723 doCheck = false;
1824
25+ outputs = [ "out" ] ++ bins;
26+
27+ # Move binaries to separate outputs and symlink them back to $out
28+ postInstall = lib.concatStringsSep "\n" (
29+ builtins.map (bin: "mkdir -p \$${bin}/bin && mv $out/bin/${bin} \$${bin}/bin/ && ln -s \$${bin}/bin/${bin} $out/bin/") bins
30+ );
31+
1932 subPackages = [
2033 "cmd/abidump"
2134 "cmd/abigen"