Skip to content

Commit

Permalink
lua 5: Don't use stdenv.cross, and use less make flags
Browse files Browse the repository at this point in the history
cc-wrapper will define environment variables matching those now
  • Loading branch information
Ericson2314 committed Jun 28, 2017
1 parent c3c5793 commit 5d1e51a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
12 changes: 4 additions & 8 deletions pkgs/development/interpreters/lua-5/5.2.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{ stdenv, fetchurl, readline, compat ? false }:
{ stdenv, fetchurl, readline, compat ? false
, hostPlatform
}:

let
dsoPatch = fetchurl {
Expand Down Expand Up @@ -55,21 +57,15 @@ stdenv.mkDerivation rec {
'';

crossAttrs = let
isMingw = stdenv.cross.libc == "msvcrt";
isDarwin = stdenv.cross.libc == "libSystem";
inherit (hostPlatform) isDarwin isMingw;
in {
configurePhase = ''
makeFlagsArray=(
INSTALL_TOP=$out
INSTALL_MAN=$out/share/man/man1
CC=${stdenv.cross.config}-gcc
STRIP=:
RANLIB=${stdenv.cross.config}-ranlib
V=${luaversion}
R=${version}
${if isMingw then "mingw" else stdenv.lib.optionalString isDarwin ''
AR="${stdenv.cross.config}-ar rcu"
macosx
''}
)
'' + stdenv.lib.optionalString isMingw ''
Expand Down
12 changes: 4 additions & 8 deletions pkgs/development/interpreters/lua-5/5.3.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{ stdenv, fetchurl, readline, compat ? false }:
{ stdenv, fetchurl, readline, compat ? false
, hostPlatform
}:

stdenv.mkDerivation rec {
name = "lua-${version}";
Expand Down Expand Up @@ -54,21 +56,15 @@ stdenv.mkDerivation rec {
'';

crossAttrs = let
isMingw = stdenv.cross.libc == "msvcrt";
isDarwin = stdenv.cross.libc == "libSystem";
inherit (hostPlatform) isDarwin isMingw;
in {
configurePhase = ''
makeFlagsArray=(
INSTALL_TOP=$out
INSTALL_MAN=$out/share/man/man1
CC=${stdenv.cross.config}-gcc
STRIP=:
RANLIB=${stdenv.cross.config}-ranlib
V=${luaversion}
R=${version}
${if isMingw then "mingw" else stdenv.lib.optionalString isDarwin ''
AR="${stdenv.cross.config}-ar rcu"
macosx
''}
)
'' + stdenv.lib.optionalString isMingw ''
Expand Down

0 comments on commit 5d1e51a

Please sign in to comment.