mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-18 18:14:42 +00:00
luajit: fix cross-compilation, partially
Also clean the expression a bit.
This commit is contained in:
parent
147a685948
commit
5ddfa4183a
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, lib, fetchurl
|
{ stdenv, lib, fetchurl, buildPackages
|
||||||
, name ? "luajit-${version}"
|
, name ? "luajit-${version}"
|
||||||
, isStable
|
, isStable
|
||||||
, sha256
|
, sha256
|
||||||
@ -20,24 +20,23 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
luaversion = "5.1";
|
luaversion = "5.1";
|
||||||
|
|
||||||
patchPhase = ''
|
postPatch = ''
|
||||||
substituteInPlace Makefile \
|
substituteInPlace Makefile --replace ldconfig :
|
||||||
--replace /usr/local "$out"
|
|
||||||
|
|
||||||
substituteInPlace src/Makefile --replace gcc cc
|
|
||||||
'' + stdenv.lib.optionalString (stdenv.cc.libc != null)
|
|
||||||
''
|
|
||||||
substituteInPlace Makefile \
|
|
||||||
--replace ldconfig ${stdenv.cc.libc.bin or stdenv.cc.libc}/bin/ldconfig
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
configurePhase = false;
|
configurePhase = false;
|
||||||
|
|
||||||
|
makeFlags = [
|
||||||
|
"PREFIX=$(out)"
|
||||||
|
"DEFAULT_CC=cc"
|
||||||
|
"CROSS=${stdenv.cc.targetPrefix}"
|
||||||
|
# TODO: when pointer size differs, we would need e.g. -m32
|
||||||
|
"HOST_CC=${buildPackages.stdenv.cc}/bin/cc"
|
||||||
|
];
|
||||||
buildFlags = [ "amalg" ]; # Build highly optimized version
|
buildFlags = [ "amalg" ]; # Build highly optimized version
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
installPhase = ''
|
postInstall = ''
|
||||||
make install PREFIX="$out"
|
|
||||||
( cd "$out/include"; ln -s luajit-*/* . )
|
( cd "$out/include"; ln -s luajit-*/* . )
|
||||||
ln -s "$out"/bin/luajit-* "$out"/bin/lua
|
ln -s "$out"/bin/luajit-* "$out"/bin/lua
|
||||||
''
|
''
|
||||||
|
Loading…
Reference in New Issue
Block a user