Skip to content

Instantly share code, notes, and snippets.

@CapsAdmin
Created January 26, 2018 01:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CapsAdmin/5970c7289210af74cc0cb47f85fb9118 to your computer and use it in GitHub Desktop.
Save CapsAdmin/5970c7289210af74cc0cb47f85fb9118 to your computer and use it in GitHub Desktop.
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "ffibuild_luajit";
src = ./.;
buildInputs = [ gcc ]==] .. data.name .. [==[ ];
buildPhase = ''
gcc -xc -E -P -I${stdenv.lib.getDev ]==] .. data.name .. [==[} -c ]==] .. tmp_main .. [==[ -o temp.p
'';
installPhase = ''
mkdir $out;
find ${]==] .. data.name .. [==[.lib}/lib/;
cp ${]==] .. data.name .. [==[.lib}/lib/]==] .. lib_name .. [==[ $out/]==] .. lib_name .. [==[;
mv temp.p $out/temp.p;
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment