ruby docs: fix text and example (#28006)
1. 'wrapper' has been renamed to 'wrappedRuby', so use this instead. 2. mkDerivation isn't called with a 'src' attribute, so skip the 'unpackPhase' to avoid an error. 3. Simplify the build command. 'mkdir' and 'patchShebangs' don't need to be called explicitly.
This commit is contained in:
parent
2203908e5f
commit
f37972588d
@ -82,7 +82,7 @@ versions available from various packages.
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>Resulting derivations for both builders also have two helpful
|
<para>Resulting derivations for both builders also have two helpful
|
||||||
attributes, <literal>env</literal> and <literal>wrapper</literal>.
|
attributes, <literal>env</literal> and <literal>wrappedRuby</literal>.
|
||||||
The first one allows one to quickly drop into
|
The first one allows one to quickly drop into
|
||||||
<command>nix-shell</command> with the specified environment present.
|
<command>nix-shell</command> with the specified environment present.
|
||||||
E.g. <command>nix-shell -A sensu.env</command> would give you an
|
E.g. <command>nix-shell -A sensu.env</command> would give you an
|
||||||
@ -110,15 +110,11 @@ the needed dependencies. For example, to make a derivation
|
|||||||
|
|
||||||
in stdenv.mkDerivation {
|
in stdenv.mkDerivation {
|
||||||
name = "my-script";
|
name = "my-script";
|
||||||
|
buildInputs = [ env.wrappedRuby ];
|
||||||
buildInputs = [ env.wrapper ];
|
phases = [ "installPhase" "fixupPhase" ];
|
||||||
|
|
||||||
script = ./my-script.rb;
|
script = ./my-script.rb;
|
||||||
|
|
||||||
buildCommand = ''
|
buildCommand = ''
|
||||||
mkdir -p $out/bin
|
|
||||||
install -D -m755 $script $out/bin/my-script
|
install -D -m755 $script $out/bin/my-script
|
||||||
patchShebangs $out/bin/my-script
|
|
||||||
'';
|
'';
|
||||||
}]]>
|
}]]>
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user