Skip to content

Instantly share code, notes, and snippets.

@cleverca22
Last active September 8, 2019 12:43
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cleverca22/8cae5bc9c02c12099a3bf5e20e75161f to your computer and use it in GitHub Desktop.
Save cleverca22/8cae5bc9c02c12099a3bf5e20e75161f to your computer and use it in GitHub Desktop.
patchelf util
with import <nixpkgs> { system = "i686-linux"; };
runCommandCC "filename" { buildInputs = [ gcc ]; } ''
cat <<EOF > $out
#!${stdenv.shell}
patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" --set-rpath ${lib.makeLibraryPath [ zlib ]} \$1
EOF
chmod +x $out
''
with import <nixpkgs> {};
runCommandCC "filename" { buildInputs = [ gcc ]; } ''
cat <<EOF > $out
#!${stdenv.shell}
patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" --set-rpath ${lib.makeLibraryPath [ zlib ]} \$1
EOF
chmod +x $out
''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment