Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c7739191daf5
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b8726c346cdb
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Jul 7, 2017

  1. luajit: add 2.0 version again

    The reason will be apparent from the followup commit.
    Also order the phases, quote shell variables, add myself to
    maintainers, etc.
    vcunat committed Jul 7, 2017

    Verified

    This commit was signed with the committer’s verified signature.
    edolstra Eelco Dolstra
    Copy the full SHA
    e36b588 View commit details
  2. 1

    Verified

    This commit was signed with the committer’s verified signature.
    edolstra Eelco Dolstra
    Copy the full SHA
    b8726c3 View commit details
Showing with 68 additions and 36 deletions.
  1. +66 −35 pkgs/development/interpreters/luajit/default.nix
  2. +2 −1 pkgs/top-level/all-packages.nix
101 changes: 66 additions & 35 deletions pkgs/development/interpreters/luajit/default.nix
Original file line number Diff line number Diff line change
@@ -1,41 +1,72 @@
{ stdenv, fetchurl }:
{ stdenv, fetchurl, hostPlatform }:
rec {

stdenv.mkDerivation rec {
name = "luajit-${version}";
version = "2.1.0-beta3";
luaversion = "5.1";
luajit =
# Compatibility problems with lightuserdata pointers; see:
# https://github.com/LuaJIT/LuaJIT/blob/v2.1/doc/status.html#L101
if hostPlatform.is64bit && (hostPlatform.isArm || hostPlatform.isSunOS)
then luajit_2_0
else luajit_2_1;

src = fetchurl {
url = "http://luajit.org/download/LuaJIT-${version}.tar.gz";
sha256 = "1hyrhpkwjqsv54hnnx4cl8vk44h9d6c9w0fz1jfjz00w255y7lhs";
luajit_2_0 = generic {
version = "2.0.5";
isStable = true;
sha256 = "0yg9q4q6v028bgh85317ykc9whgxgysp76qzaqgq55y6jy11yjw7";
};

enableParallelBuilding = true;

patchPhase = ''
substituteInPlace Makefile \
--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;
buildFlags = [ "amalg" ]; # Build highly optimized version
installPhase = ''
make install INSTALL_INC=$out/include PREFIX=$out
ln -s $out/bin/luajit* $out/bin/lua
ln -s $out/bin/luajit* $out/bin/luajit
'';

meta = with stdenv.lib; {
description = "High-performance JIT compiler for Lua 5.1";
homepage = http://luajit.org;
license = licenses.mit;
platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers ; [ thoughtpolice smironov ];
luajit_2_1 = generic {
version = "2.1.0-beta3";
isStable = false;
sha256 = "1hyrhpkwjqsv54hnnx4cl8vk44h9d6c9w0fz1jfjz00w255y7lhs";
};


generic =
{ version, sha256 ? null, isStable
, name ? "luajit-${version}"
, src ?
(fetchurl {
url = "http://luajit.org/download/LuaJIT-${version}.tar.gz";
inherit sha256;
})
}:

stdenv.mkDerivation rec {
inherit name version src;

luaversion = "5.1";

patchPhase = ''
substituteInPlace Makefile \
--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;

buildFlags = [ "amalg" ]; # Build highly optimized version
enableParallelBuilding = true;

installPhase = ''
make install INSTALL_INC="$out"/include PREFIX="$out"
ln -s "$out"/bin/luajit-* "$out"/bin/lua
''
+ stdenv.lib.optionalString (!isStable)
''
ln -s "$out"/bin/luajit-* "$out"/bin/luajit
'';

meta = with stdenv.lib; {
description = "High-performance JIT compiler for Lua 5.1";
homepage = http://luajit.org;
license = licenses.mit;
platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers ; [ thoughtpolice smironov vcunat ];
};
};
}
3 changes: 2 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
@@ -6117,7 +6117,8 @@ with pkgs;

luaPackages = lua52Packages;

luajit = callPackage ../development/interpreters/luajit {};
inherit (callPackages ../development/interpreters/luajit {})
luajit luajit_2_0 luajit_2_1;

luarocks = luaPackages.luarocks;