buildGoPackage: use $out instead of $bin

This commit is contained in:
zowoq 2020-04-18 23:21:06 +10:00
parent 453dca2edc
commit 3f17518490
3 changed files with 8 additions and 18 deletions

View file

@ -191,18 +191,6 @@ deis = buildGoPackage rec {
To extract dependency information from a Go package in automated way use <link xlink:href="https://github.com/kamilchm/go2nix">go2nix</link>. It can produce complete derivation and <varname>goDeps</varname> file for Go programs. To extract dependency information from a Go package in automated way use <link xlink:href="https://github.com/kamilchm/go2nix">go2nix</link>. It can produce complete derivation and <varname>goDeps</varname> file for Go programs.
</para> </para>
<para>
<varname>buildGoPackage</varname> produces <xref linkend='chap-multiple-output' xrefstyle="select: title" /> where <varname>bin</varname> includes program binaries. You can test build a Go binary as follows:
<screen>
<prompt>$ </prompt>nix-build -A deis.bin
</screen>
or build all outputs with:
<screen>
<prompt>$ </prompt>nix-build -A deis.all
</screen>
<varname>bin</varname> output will be installed by default with <varname>nix-env -i</varname> or <varname>systemPackages</varname>.
</para>
<para> <para>
You may use Go packages installed into the active Nix profiles by adding the following to your ~/.bashrc: You may use Go packages installed into the active Nix profiles by adding the following to your ~/.bashrc:
<screen> <screen>

View file

@ -312,6 +312,11 @@ environment.systemPackages = [
the <literal>notmuch.emacs</literal> output. the <literal>notmuch.emacs</literal> output.
</para> </para>
</listitem> </listitem>
<listitem>
<para>
The default output of <literal>buildGoPackage</literal> is now <literal>$out</literal> instead of <literal>$bin</literal>.
</para>
</listitem>
</itemizedlist> </itemizedlist>
</section> </section>
</section> </section>

View file

@ -203,15 +203,15 @@ let
installPhase = args.installPhase or '' installPhase = args.installPhase or ''
runHook preInstall runHook preInstall
mkdir -p $bin mkdir -p $out
dir="$NIX_BUILD_TOP/go/bin" dir="$NIX_BUILD_TOP/go/bin"
[ -e "$dir" ] && cp -r $dir $bin [ -e "$dir" ] && cp -r $dir $out
runHook postInstall runHook postInstall
''; '';
preFixup = preFixup + '' preFixup = preFixup + ''
find $bin/bin -type f -exec ${removeExpr removeReferences} '{}' + || true find $out/bin -type f -exec ${removeExpr removeReferences} '{}' + || true
''; '';
strictDeps = true; strictDeps = true;
@ -235,9 +235,6 @@ let
enableParallelBuilding = enableParallelBuilding; enableParallelBuilding = enableParallelBuilding;
# I prefer to call this dev but propagatedBuildInputs expects $out to exist
outputs = args.outputs or [ "bin" "out" ];
meta = { meta = {
# Add default meta information # Add default meta information
homepage = "https://${goPackagePath}"; homepage = "https://${goPackagePath}";