Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at release-20.03 68 lines 2.1 kB view raw
1# similar to interpreters/python/default.nix 2{ stdenv, lib, callPackage, fetchurl, fetchpatch }: 3let 4 dsoPatch51 = fetchurl { 5 url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/lua-arch.patch?h=packages/lua51"; 6 sha256 = "11fcyb4q55p4p7kdb8yp85xlw8imy14kzamp2khvcyxss4vw8ipw"; 7 name = "lua-arch.patch"; 8 }; 9 10 dsoPatch52 = fetchurl { 11 url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/liblua.so.patch?h=packages/lua52"; 12 sha256 = "1by1dy4ql61f5c6njq9ibf9kaqm3y633g2q8j54iyjr4cxvqwqz9"; 13 name = "lua-arch.patch"; 14 }; 15 16in rec { 17 18 lua5_3 = callPackage ./interpreter.nix { 19 sourceVersion = { major = "5"; minor = "3"; patch = "5"; }; 20 hash = "0c2eed3f960446e1a3e4b9a1ca2f3ff893b6ce41942cf54d5dd59ab4b3b058ac"; 21 patches = 22 lib.optionals stdenv.isDarwin [ ./5.2.darwin.patch ] ++ [ 23 ./CVE-2019-6706.patch 24 ]; 25 postConfigure = lib.optionalString (!stdenv.isDarwin) '' 26 cat ${./lua-5.3-dso.make} >> src/Makefile 27 sed -e 's/ALL_T *= */& $(LUA_SO)/' -i src/Makefile 28 ''; 29 30 postBuild = stdenv.lib.optionalString (!stdenv.isDarwin) '' 31 ( cd src; make $makeFlags "''${makeFlagsArray[@]}" liblua.so ) 32 ''; 33 }; 34 35 lua5_3_compat = lua5_3.override({ 36 compat = true; 37 }); 38 39 40 lua5_2 = callPackage ./interpreter.nix { 41 sourceVersion = { major = "5"; minor = "2"; patch = "4"; }; 42 hash = "0jwznq0l8qg9wh5grwg07b5cy3lzngvl5m2nl1ikp6vqssmf9qmr"; 43 patches = if stdenv.isDarwin then [ ./5.2.darwin.patch ] else [ dsoPatch52 ]; 44 }; 45 46 lua5_2_compat = lua5_2.override({ 47 compat = true; 48 }); 49 50 51 lua5_1 = callPackage ./interpreter.nix { 52 sourceVersion = { major = "5"; minor = "1"; patch = "5"; }; 53 hash = "2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333"; 54 patches = (if stdenv.isDarwin then [ ./5.1.darwin.patch ] else [ dsoPatch51 ]) 55 ++ [ ./CVE-2014-5461.patch ]; 56 }; 57 58 luajit_2_0 = import ../luajit/2.0.nix { 59 self = luajit_2_0; 60 inherit callPackage lib; 61 }; 62 63 luajit_2_1 = import ../luajit/2.1.nix { 64 self = luajit_2_1; 65 inherit callPackage; 66 }; 67 68}