Created
June 23, 2016 17:25
-
-
Save velveteer/355183807a3f41bc1d631408f5e5c949 to your computer and use it in GitHub Desktop.
Nix derivation for SunVox binary
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ stdenv, pkgs, patchelf, libX11, alsaLib, SDL }: | |
stdenv.mkDerivation rec { | |
name = "sunvox-${version}"; | |
version = "1.9.1"; | |
src = ./sunvox-1.9.1.zip; | |
buildInputs = [ pkgs.unzip patchelf]; | |
libPath = stdenv.lib.makeLibraryPath [ | |
stdenv.cc.cc | |
alsaLib | |
SDL | |
libX11 | |
]; | |
phases = [ "unpackPhase" "installPhase" ]; | |
installPhase = '' | |
mkdir -p "$out/opt/sunvox" | |
cp -r sunvox/linux_x86_64/sunvox "$out/opt/sunvox" | |
chmod +x "$out/opt/sunvox/sunvox" | |
patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ | |
--set-rpath "$libPath" "$out/opt/sunvox/sunvox" | |
mkdir "$out/bin" | |
ln -s "$out/opt/sunvox/sunvox" "$out/bin/sunvox" | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment