Translations:FAQ/65/en: Difference between revisions

FuzzyBot (talk | contribs)
Importing a new version from external source
 
FuzzyBot (talk | contribs)
Importing a new version from external source
Tags: Replaced Mobile edit Mobile web edit
 
Line 1: Line 1:
<syntaxhighlight lang="nix">
# mybinaryprogram.nix
with import <nixpkgs> {};
stdenv.mkDerivation rec {
  name = "somename";
  buildInputs = [ makeWrapper ];
  buildPhase = "true";
  libPath = lib.makeLibraryPath with xlibs;[ libXrandr libXinerama libXcursor ];
  unpackPhase = "true";
  installPhase = ''
    mkdir -p $out/bin
    cp ${./mybinaryprogram} $out/bin/mybinaryprogram
  '';
  postFixup = ''
    patchelf \
      --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
      --set-rpath "${libPath}" \
      $out/bin/mybinaryprogram
  '';
}</syntaxhighlight>
This can be built with:
This can be built with: