summaryrefslogtreecommitdiff
path: root/dev-lang/lua
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-lang/lua
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-lang/lua')
-rw-r--r--dev-lang/lua/Manifest37
-rw-r--r--dev-lang/lua/files/5.1.4/01_all_boolean_expression.upstream.patch48
-rw-r--r--dev-lang/lua/files/5.1.4/02_all_table.upstream.patch22
-rw-r--r--dev-lang/lua/files/5.1.4/03_all_debug_getfenv.upstream.patch10
-rw-r--r--dev-lang/lua/files/5.1.4/04_all_gc_performance.upstream.patch14
-rw-r--r--dev-lang/lua/files/5.1.4/05_all_string_format.upstream.patch21
-rw-r--r--dev-lang/lua/files/5.1.4/06_all_io_read.upstream.patch15
-rw-r--r--dev-lang/lua/files/5.1.4/07_all_boolean_expression.upstream.patch30
-rw-r--r--dev-lang/lua/files/5.1.4/08_all_metatable.upstream.patch10
-rw-r--r--dev-lang/lua/files/5.1.4/09_all_prototype_collection.upstream.patch13
-rw-r--r--dev-lang/lua/files/5.2.0/01_all_memory_hoarding.upstream.patch49
-rw-r--r--dev-lang/lua/files/5.2.0/02_all_hex_number_handling.upstream.patch26
-rw-r--r--dev-lang/lua/files/configure.in5
-rw-r--r--dev-lang/lua/files/lua-5.1-make-r1.patch66
-rw-r--r--dev-lang/lua/files/lua-5.1-make-r2.patch97
-rw-r--r--dev-lang/lua/files/lua-5.1-make_static-r1.patch12
-rw-r--r--dev-lang/lua/files/lua-5.1-module_paths.patch30
-rw-r--r--dev-lang/lua/files/lua-5.1-readline.patch10
-rw-r--r--dev-lang/lua/files/lua-5.1.4-deprecated.patch46
-rw-r--r--dev-lang/lua/files/lua-5.1.4-test.patch11
-rw-r--r--dev-lang/lua/files/lua-5.1.5-fix_vararg_calls.patch12
-rw-r--r--dev-lang/lua/files/lua-5.2-make-r1.patch75
-rw-r--r--dev-lang/lua/files/lua-5.3-make-r1.patch91
-rw-r--r--dev-lang/lua/files/lua.pc31
-rw-r--r--dev-lang/lua/lua-5.1.5-r100.ebuild137
-rw-r--r--dev-lang/lua/lua-5.1.5-r101.ebuild144
-rw-r--r--dev-lang/lua/lua-5.1.5-r4.ebuild134
-rw-r--r--dev-lang/lua/lua-5.2.3-r1.ebuild136
-rw-r--r--dev-lang/lua/lua-5.2.3-r2.ebuild143
-rw-r--r--dev-lang/lua/lua-5.2.3.ebuild117
-rw-r--r--dev-lang/lua/lua-5.3.3-r1.ebuild143
-rw-r--r--dev-lang/lua/lua-5.3.3.ebuild136
-rw-r--r--dev-lang/lua/metadata.xml13
33 files changed, 1884 insertions, 0 deletions
diff --git a/dev-lang/lua/Manifest b/dev-lang/lua/Manifest
new file mode 100644
index 000000000000..0147ede94533
--- /dev/null
+++ b/dev-lang/lua/Manifest
@@ -0,0 +1,37 @@
+AUX 5.1.4/01_all_boolean_expression.upstream.patch 1064 SHA256 9506fa6932454abe735b9d620ca0b322b4e2eb03b38a5d3d717823508110620e SHA512 b8d92c22059a50e7af0bc6fcc5773cda018628929c970650c963e2ad551cf758f503fe97de6542629d3b61ab2779970db811a1c7f7b7a2849a7632a4ec07b566 WHIRLPOOL 883a622142e9ded2d5fc7e6de282b53616ba4b1574eb00298d36f5865b981f7aac4920343826c1d8271798ee441989f95c378a42837f7aebe8c6cf1af5cc16d1
+AUX 5.1.4/02_all_table.upstream.patch 643 SHA256 e55930ccbfadf384b2b981da3454b0dfd8544ffcb29e10ad07c7404142447b09 SHA512 fe362cb51516ea010eba28d15946641ef08e49e08d8a98b0fafcb86a4eb45311f8379efb67e82dbdd83533763000b59b438b0339c784c00ecbe85266f610c9e6 WHIRLPOOL 4168c3b636b488c9cec46dfb52e3d6dc6f75a7ad93540305163b762aa7c2d428b5352a40b50217819f3422675e2c277295e9aaaf8c6cfb50b98a7d9a2aa9d1a9
+AUX 5.1.4/03_all_debug_getfenv.upstream.patch 232 SHA256 a6aa45a96ba44f04fd516851fc4188d89ad0c6d2b927d3be9faf84808c4a138d SHA512 226437b7943e914e402ac386bf8d78fe4d1584a581df2911d500a46b445aeb8c9ce5224aff2b063d1e45b56770facabc69548081f11342de212041404e8415b6 WHIRLPOOL dd2de9942456a4d5487714f6095153a7221b4befb93060c2e12cb1695da282ad221c3e2c2de1e242fa6877c686c9c64a75a2b766f33724f6546d9410b9153039
+AUX 5.1.4/04_all_gc_performance.upstream.patch 414 SHA256 cba9899e1f940b21c1a25f65279004ee64d78a4c48db3501677c106266bc23dd SHA512 e706bd69a4c471a105d50a1d97cce8a055aa532b5840cfa76f407d12d8169cac1ef077b77c75a9b9579d0480256c0d3cc6a89eba5a4027fe70494da4b6d546e8 WHIRLPOOL 316afd42bd2a00379bf18271a31d003b683af548c0123cd064a10bf2fcf0e07e0e5e6b06e469cd17413ec64da34d71ae96d18c490f10ee6889727e07f9b6cf9e
+AUX 5.1.4/05_all_string_format.upstream.patch 651 SHA256 4365eb9f4b5c4831f81e1a98f2252e3cf5522a18794e936057ae521edf9512e9 SHA512 4820764c9a832d7707b0710fc3f16a58958d23a3b2bf04875a71973a7aee65426a5c009298cf5f4d6333dc2e722f55a77b926a2cc14687927d777409a8e1ecd7 WHIRLPOOL 5d8b6c02ba93336d3793ca640add4e513e086ceb82d6062e7b7a8226503c3f998f7db67e73173826d061ac069a1b1dc3c7ff1fc5273235a4aae93cba7c7e1b32
+AUX 5.1.4/06_all_io_read.upstream.patch 319 SHA256 b363334e16edda78f1fc183f63751d8aef876e327e716468ab3f54c641f72f7c SHA512 0fba978b95c9d0ff65fd8d05ebaabd75a65922360739c4df4c0a2c8412ad60f37d7ac2ad7413ca203b481b2818d7a446495a2b6f2f45c17815c5e0c8108f1a6b WHIRLPOOL 941f10b1b8e978a2fe3108d66b62037ab2447e15bbf20046888507d5bebdd8d9a9df51368975a3a946795611b7b57774e014b9baf405126ed9939d5dee566ae7
+AUX 5.1.4/07_all_boolean_expression.upstream.patch 679 SHA256 40567e96231919a350ba460abc911d5105edacd630bcacb40ce987c3c9cb666b SHA512 1175e695cdb4f7e8ba8421a89016d40b28be165bbdb758317b7514fdd89fec51ac00a2b3d6e0a03abd76bbf98634a7ebf5b52cefbf3a3866457b84487e0efcb5 WHIRLPOOL 433495b19aa4a8609696b27c5e8cab7470680ddb15a99233cccc1c2bfea703f9688c5e358db2117bf4e625a55532aa656064abd08c83e07b26d0133f388ef1d2
+AUX 5.1.4/08_all_metatable.upstream.patch 379 SHA256 6ead3599283478a7dec288620beaf58357253154a580a80f93f1b14607a44c7f SHA512 064d8a6e23cc5a1eb099b15e554ebe24bf29a677cd4a4885977b66d1de19d84a716e348380b784b3ec3ea4cfbd5d90d91936af231f3851dea9965c646be8e792 WHIRLPOOL 68c32e36d298895b255505365de5e86fbf675764aca3984d4172271e6801199645b565c79c165d015e6411bb014e9402959e2066041e3d08b655e51f7b5e5f60
+AUX 5.1.4/09_all_prototype_collection.upstream.patch 459 SHA256 643a4a61f8812c274e3a24f5b73a4257cf4185900913deab34a06243b72f9350 SHA512 4fd573d9346e09dcbe65fc9e3a9147dc586f728db95f62d1b731b39f442b08c21d74562ceafdbd39ecad4091afda2996b582c9e9a758d4e08d1f5f9a330fe47d WHIRLPOOL 0b89ee123dfd02cc0d85565d999fa7f339208670784bfedf8de05e881c3a27435888d3e1d593b559e800df49382525795ce8bd9b1227894ee80b5f018e9f4ae9
+AUX 5.2.0/01_all_memory_hoarding.upstream.patch 1639 SHA256 1794d833097afb18c6ec4e0ed06a6a03b58dfcc4a56f0fb37b2c9fbc03754531 SHA512 c1e0d0db9899539ade393ddfe7f5b9493576227cc4e29ad6623c869d1e91b0d28061f85e5cf9fc36bb70b5e53aad5d9c8848982ccfbba2cf4a6019fd260eed8f WHIRLPOOL dbae41c0799e3cf0b72d328224042da5ea29987fb5fe8df85f8cb65fee4a321186959ce5293b6881a08d7e841475d8b65cce46acf524765f1d76286054fa630c
+AUX 5.2.0/02_all_hex_number_handling.upstream.patch 938 SHA256 608bf0ccbfc1a0b86e974bd56b0abc836eba7bb5eff412cd4288e3d0ff692e88 SHA512 950c05767fd2fb39cef253323544fe079e88443047f63b495ff7639c980fd410db0f5769fa7a19134db819b1fc0b252e5f34d48fa6c1352874f734586cc2d41e WHIRLPOOL 4662bc06437b2e5225f6ff0c2d10e17f88351732403a6760bbed9aea2b300a1fe530ba8e295e1d870ab2c4252a1bfa387d1c0e10fe059eb14c82dac5d87b7318
+AUX configure.in 66 SHA256 1b4477324c94c0793df2117e80bd325bb2cc1cf6be16658151b272d4aca023c6 SHA512 b61041151ad4be2bb4a62f6659850fcf4179553103c421694ce739b84a57408fc59d09f5ad3f6dd8513be78ffa472689dc729031e3ef42b99f11ecc8e0053ffc WHIRLPOOL 152f63a1a8fc222fb6fe11b3e196a91b3791fcfd1249e9682323f4de12dd4d550668480b45d68855b540831c3e1c483639b65c67dbf25bc6594041999eeede46
+AUX lua-5.1-make-r1.patch 2229 SHA256 bf691afd2480a496bfa9b2c46fcbb396e7034ea58e94399788e05ab7872ae46f SHA512 cd24e228b0d7f2abcb5afe045fc824811c9db9dc684f9e33f0de0e7215e18e6eae51fd86c5910a338a810679d46727944950fced42636e0484d9c3f08fa07fdd WHIRLPOOL fe780fb12a45c7c8a702ce71e6dfad83f45d9a23c16428d4216464019d065010a1015e786fee6830db0f424d9bfffb4214cca3fa16f7dffc33945d04960ef5b6
+AUX lua-5.1-make-r2.patch 3071 SHA256 ebf496443f6171e3f285a666b2ced5d68c03be05fd01dc17373cd65228637b07 SHA512 a5384262e033943fe0088ca14d854d1e3767f8e266d09ba1bb15caf5f3f4bf6285ed1e37dad100f931195bce0eca5a862bf52ab664482aaba6ccd905b6ca8ecd WHIRLPOOL 8e0035c3634177fe4104a71d2490919bcfca6db360002cf1c48f808a3ee902e52e0091e6b23da1e64c79032481b18a1a3450ee3dd91a98dc9a0ce447a317b2a0
+AUX lua-5.1-make_static-r1.patch 644 SHA256 077f5da55b9b354b8b901d8a769c92aad104d79ba0a6acee0096c9a5d94b259a SHA512 8cb1de7281839ebb492979f71b65c9ff6bbbde413c88323be6b77d7b7d26eb2034c541a883fd7cfab0694293732f3ac46dba33620d7df30c45059560b8d6503d WHIRLPOOL 9874b62e02b38bb1b935cba4b2a07e6b181c30bc2efc907478d2d48b98634718727ab5417825cfafd222090447ff900a09f1a71228756bc3b5f761576204bf74
+AUX lua-5.1-module_paths.patch 1078 SHA256 1115b6aa00eb4e918156ae70c763534bd2f603ba888da75e4908c19c2ac3e5f7 SHA512 123b115389d01d383af8698d2ed66c75bb7c3e2d33de57b8539ae56a9478930a0a72fa5657e78cc1c5b6bef00d07ec3a51e19ec0e419647e84eb158fb5c4795a WHIRLPOOL 08ee01e2758274e66096caba4a06f258a8fe1cdfba01623d075efae5502ebd706bcd1e689cede736d63e8f9582e64d11e9e0c9df903d55d400cd5bfa7163b55e
+AUX lua-5.1-readline.patch 360 SHA256 1f0f90eb8103e338f1188cc884c0c59cc6afd023828c11d86b8145b2a8d1efc2 SHA512 a99154258419dc2e582804eae97517687e5b8b5f731dc91722193d1ff470b8522af6ff4e7142c9258afe4734cd52e6987d3c2108ac52b1487a262f1e89f2f332 WHIRLPOOL 6523ca31a979d3af78346479da5b70d60a1880ed78715eb68373f4a21bb9e5a6afe3ee341f7d872f3ca9ecb02ae04826be6790565f288952657e3a92254730f6
+AUX lua-5.1.4-deprecated.patch 1417 SHA256 8d4d3c35d9cfb65f6caa360c09d1fa0c5dc1ee0de3389c1e73602fef86cd0e9f SHA512 5b82058ece2cde2a720f9cdae727be0a68895438f90e24f2e37adb1cd79cf637ce20bb283918e44f4f561aa87a9b4f19d3305d71537671f61438962d48970f39 WHIRLPOOL 34fad887d3a1eb1eedb4ba73852bd976c9397fbacc294adf31862684e1b957512c5a23ca54b2c5f0adebf9ce70b4d7e23103c3cbd0a1efda54a88e9fbb46a8e2
+AUX lua-5.1.4-test.patch 340 SHA256 cdbb06f6fc5e75512c912360e1efc12e1e62ac7079972ff1c9c9273898bf9e31 SHA512 720135cc9d4c224717c2718b5709b43a1d66340fbdc3826037db672ef92014b6145f50263198d7641525194e6f9f9fdf16b78bdc6fb832dd7d13a89f06af67d9 WHIRLPOOL ff625882f25d9b638031f29498ee0de3b92b353c48c381160294156e500c6b9735ddb5c09a0739243c0cceb40bcd234bd4bd3faab41b0b8c7f91c3f5c42889b4
+AUX lua-5.1.5-fix_vararg_calls.patch 470 SHA256 756ae7101590329d6b17e1d3bd1bde990317a31864f4804d78a49525fe0e554b SHA512 630e8537bd80771fecc4c8216ec96e243654bd0b7bd006b6867baca4effab90bab4a922951661d4fc3ac2700c3bd7c0c40227b9eeee7dd5a87c07a6382055b04 WHIRLPOOL f3e426eafad9284d5723893bfa18627c02c31caa309c022aa6f1c3a329ab7905fa7da24aa740fdf8eb0ed3f3ef19cedb88ac53be59f5bc5261cc4935dd9dc54c
+AUX lua-5.2-make-r1.patch 2442 SHA256 8447577f843eab7c6173431e97e9bec554f9cfdfe692294c2cce8ff5916f5329 SHA512 e51b6fd7c77906a918f3987379e134d7423cc9683efdf6cdd2992b187ab0fed99732523b0f2819816a8789e4ed176c6f62774237f036e09e0c9d56582e0c3be0 WHIRLPOOL 7e94f2221f2f708ef340c177bee0402d60e1b484d860a7400424ad050f2461fbb817358a30f95db66e85cae5403eb572bfff59280f175ea6dfb27d1aa82f2fd4
+AUX lua-5.3-make-r1.patch 2854 SHA256 9a0f7bfbf13a7c4ab2bc2d2cd85ac4a0650addd31cc53b3a56569f5dddf1d168 SHA512 80c2930bbd204551545cdd6793ec8dcd7d753fffc29710786b3662dde13b1af3a9825c95118e23bc98149f316f12f008223b675df929a244ef29c8a2a773560a WHIRLPOOL 2f470f6d5452d4a7f38b0f8bc1ee2c3c28dd40b1e720e83cc90c12eb40138232ef2521b60926ea8b158fcf402f4c7b2ad08f9eef41335e447add57cb6fcb938c
+AUX lua.pc 658 SHA256 ff7ae80c41698f27f4d1168c4cb2931d7b232e66528d9a2b0939723f4bb00145 SHA512 cb476ea6dd004a9aa0094cfc219d1888c5f578b44968a960acf1f2f32783a8e4d770bb033fb1ab4851f225188bbdd434b5d239718cae2c2c35f5b5f124a722ca WHIRLPOOL 6decd114e5edb6a5e4b17df8758f163a35f063b8e8a57c26bc2ada01145c1cc50d69a3146013e2edecb856c3c3220ed5f775f3b95cefb7655e5e7349bf988cb9
+DIST lua-5.1.5.tar.gz 221213 SHA256 2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333 SHA512 0142fefcbd13afcd9b201403592aa60620011cc8e8559d4d2db2f92739d18186860989f48caa45830ff4f99bfc7483287fd3ff3a16d4dec928e2767ce4d542a9 WHIRLPOOL 9dac93b73b9ad1ef6c69e0aa11fb53d5efe89274b65c55a1ac30bab23e8a255851b0e44306db54212b1d481e658cecd38e5ff22a25e1fa974858b7b03fb45b75
+DIST lua-5.2.3.tar.gz 251195 SHA256 13c2fb97961381f7d06d5b5cea55b743c163800896fd5c5e2356201d3619002d SHA512 264bb7c8db2f190ef0ca38584ec81999ab588f54e03119c5214c40bb8925b0eb407fac483a03e40cc8a220f6748ddff7d3a7392da3803418276b0d263b866449 WHIRLPOOL d278a1e38416bcf7f82eb3e7fd5fb423e60ccb69e9d57a937070516ff8be2d19a98bbfdaf37ec6fd6fb3ef2d625900977ca0cb47e46cb0ede5ebd5d37a9454ef
+DIST lua-5.3.3.tar.gz 294290 SHA256 5113c06884f7de453ce57702abaac1d618307f33f6789fa870e87a59d772aca2 SHA512 7b8122ed48ea2a9faa47d1b69b4a5b1523bb7be67e78f252bb4339bf75e957a88c5405156e22b4b63ccf607a5407bf017a4cee1ce12b1aa5262047655960a3cc WHIRLPOOL e9d58093327e3c67e167dad9952796f1f2f0dbfa4f165c0ec5a8808a6a73d3b25e564797a2804d408bdaeb7229e7684f907491137d4521119ba918ce87c781bc
+EBUILD lua-5.1.5-r100.ebuild 3770 SHA256 2ecbd6a8b5bc34175bb78f864b6b91a353ea901592810605997ac0ba8028ec17 SHA512 7b2c09578708f6c25dfeb4059bf134e428545e760b20f73e4ef61f01179ce211c351c49386d8771bd91f7ff418be9ba67e17aacccaedf1da182758dde2488aad WHIRLPOOL baaa5aab2c1aacc294a813bc187f753c2aee2978d564d4cd5c9a30e13b63fe88f45dcf3b11886fe2eb820041d5f340e5ab56d1b80598c972d9e80765e2d39ce3
+EBUILD lua-5.1.5-r101.ebuild 4031 SHA256 de9f0fd05953811c424dafd1077fe7f32a61bec4ef0bc5f809c8f30f1cfeb285 SHA512 aa8f1c4164ac498eed8c3279f2ef9d5538d583f0228c287c39a03d5cc01718a1b4adfb8c1af25368e533fcb7a105213933d577d9a82a5524deced0bb21bbcc6c WHIRLPOOL 7f14cb6042d75b961288b6fb1558b03b5582a81e4c8f64d3dbe3f6d228373bb03e5c56e51adb81bf4042c36175aeffc833f7be182640eff885b527967d963a00
+EBUILD lua-5.1.5-r4.ebuild 3665 SHA256 a0ad92d0d7e96df3d554924f1c59111f740d0e2797f02bb3fb27252972e0480c SHA512 bd9d21b1e6183634f9a005a38a8f70c51bc6edc178741991e4dccd49e4ff817ea63227d1a4d6bea65b179c9f7b17d4b0173a380331d8f2534f2f6adfee1686e8 WHIRLPOOL 6481dbf7242a3ab9a650f744904a47c010dbc6df2a49ae5c5c007b28c2ed6186ccec09d4e109bb3ebfaf58bd2479fffc301615c0cc41fc89d3954c310a4d594c
+EBUILD lua-5.2.3-r1.ebuild 3793 SHA256 8f36e8317317d6a3f9a66928968ecd63cced9700eb1671fc65bfb336f7fd2ba2 SHA512 aa3f363a71a82211a86c922bffec1704d8caa7be3fe04f8329c6c6c7e54e34a79328e707f8ad2128d787767f6030c9e1446ff93a4f950512f5bfed19cad9e334 WHIRLPOOL 2e2933c223d46301dcafabca105259af90d43aa85465802721af2193eabd61593a58dbda84b4f0710800ddea72842eff8fb9396fd00911196f56b56b1fe16faa
+EBUILD lua-5.2.3-r2.ebuild 4054 SHA256 fd752d94a3b8e78969869e4ccd81f120b706209ed20b93979a048e085a1667b4 SHA512 528881025ed6424c8174e7e066cfcd4e9a143a15b23041937dad8f17ac0206a49fbdf5804310e0cca98399f19719aeda013df01a6e15a91668e07be1180f8122 WHIRLPOOL 5b033c6070f263a7e1d36d83f1a0438b55c6bd4742a53e48ff46dbf00ba32085cb872f4674c522ac39a7bf80a7e8055707977a240c4bf66d0aee8b84bdbf5419
+EBUILD lua-5.2.3.ebuild 3279 SHA256 906ebad11d1cfabef6029647631fd5a400591c81d4eca30a58187232409f405c SHA512 cb851d092a833f29903fdf8f3f4acd6a2147b74d95504a9fe6e352e86de42c2d47739fda6552a8fa5aa849e3f68e9829921fb86a25f2009b1320ba767a4f768e WHIRLPOOL ed7ac1c1b15ed25c508d2ac12dc8fb04a6327c56eee407f3248adab8e4a4a753eade00af1391b952769d1f7eab2b85d80445511e66d51fae1a4612ee27d9b3ad
+EBUILD lua-5.3.3-r1.ebuild 4066 SHA256 8c19e02b82ab2179dba5d2fad2c3d10b43008a2176fbfdf22cda513a0a17018c SHA512 faaf2465de1617b0a6a9bf243e1329a6fc56fdf05e205df3c62366a95989453e2d65066644e315d7b4736ac032f9271bab107a33bf04397b38d22ff65f4bc540 WHIRLPOOL c8079229b48c46f29f6dbc5e734de666967ce18860c0ff42676d6e66c72ed32cbefcd01fba315f8f122e0599360d36fdfdba4ad222d6ff8577825d6d90e29b99
+EBUILD lua-5.3.3.ebuild 3805 SHA256 fe5d3e4bb3b8c43049745f38b347fcbd21f56bfccc18f255883630427dcc62eb SHA512 c911d5a741c7c68264bb447a3912a64fa928feff1fc0a4f3f5dd9643baeaf83b4ad2a9f005e0abe3cb098a437b5e07f676687826bb171faf88ba2f3225825d3c WHIRLPOOL 9c9b86aa0c7608eb9e1fbb40831163e4a2bb602266e534cecd7a7db7a306f490aa8924a1553bf3b63f2e9e92ea25e94512f68706d283c305d3598e55e7d5b5b8
+MISC ChangeLog 5822 SHA256 875067367d5b40477fd3828125fd88f816575bc7e702c07a5f3ef759bbb125ff SHA512 337dd1463ac728d8e5cb78b5920b4a02ff0e36d1b1e47dfe77586eb70a278db210b1612fc22cf6be0965daecacf4ce9c5b000ad0317ec94a0f69b11490dc9e60 WHIRLPOOL 1e59833a1451bc11f85aef662a90c90a72a16983431b5c67cba198fe9615ff5bd57d72b5acdc1a2a85c5ae2e0774b3225e266cc4f094e418b48640a91c9d7921
+MISC ChangeLog-2015 29535 SHA256 0d94a00dea04a7564b09f3d936cdf13fe556ba1126e1afc432df8edbf6fa404d SHA512 031cc926755a1654f3926d9c5e3b6e01a61c857f03050b418d5aee49d8192b58f4244cbae109dd45cb3d8c43aa42532cbf257df34bd2f7cc701e0c1cd6af008e WHIRLPOOL 3802188a9573e160c30507dac06bc830aa211edc238c56ad165ddc815fd827e5fd4bce9305bb2199646f24fdb56ee13006d84667e7b7fafaab4d745ae61c1efe
+MISC metadata.xml 451 SHA256 ce78308ac05d5727fab17ee88c47a5815584c09fb449d279a74d38ae5e98304c SHA512 ee674307c2a1daeeba3e9da078e440648ed379422801989007c15c4c8233e905b14f8e4fae66ae2804a5b39b0676e4cca9ff21fb8985874bccfef15b9dd918a9 WHIRLPOOL e15b2682053b142b73dd06e5558601b72515b5d5df8cc2433210825ab03f2b1e7e884d6c5e1ddd1e3e055bf9bb42d68b4a7994a2310e04b0595ab1706f19c413
diff --git a/dev-lang/lua/files/5.1.4/01_all_boolean_expression.upstream.patch b/dev-lang/lua/files/5.1.4/01_all_boolean_expression.upstream.patch
new file mode 100644
index 000000000000..f04eb85075a2
--- /dev/null
+++ b/dev-lang/lua/files/5.1.4/01_all_boolean_expression.upstream.patch
@@ -0,0 +1,48 @@
+--- lua-5.1.4.orig/src/lcode.c 2007/12/28 15:32:23 2.25.1.3
++++ lua-5.1.4/src/lcode.c 2009/06/15 14:07:34
+@@ -544,15 +544,18 @@
+ pc = NO_JUMP; /* always true; do nothing */
+ break;
+ }
+- case VFALSE: {
+- pc = luaK_jump(fs); /* always jump */
+- break;
+- }
+ case VJMP: {
+ invertjump(fs, e);
+ pc = e->u.s.info;
+ break;
+ }
++ case VFALSE: {
++ if (!hasjumps(e)) {
++ pc = luaK_jump(fs); /* always jump */
++ break;
++ }
++ /* else go through */
++ }
+ default: {
+ pc = jumponcond(fs, e, 0);
+ break;
+@@ -572,14 +575,17 @@
+ pc = NO_JUMP; /* always false; do nothing */
+ break;
+ }
+- case VTRUE: {
+- pc = luaK_jump(fs); /* always jump */
+- break;
+- }
+ case VJMP: {
+ pc = e->u.s.info;
+ break;
+ }
++ case VTRUE: {
++ if (!hasjumps(e)) {
++ pc = luaK_jump(fs); /* always jump */
++ break;
++ }
++ /* else go through */
++ }
+ default: {
+ pc = jumponcond(fs, e, 1);
+ break;
+
diff --git a/dev-lang/lua/files/5.1.4/02_all_table.upstream.patch b/dev-lang/lua/files/5.1.4/02_all_table.upstream.patch
new file mode 100644
index 000000000000..9ffc1bb28843
--- /dev/null
+++ b/dev-lang/lua/files/5.1.4/02_all_table.upstream.patch
@@ -0,0 +1,22 @@
+--- lua-5.1.4.orig/src/lvm.c 2007/12/28 15:32:23 2.63.1.3
++++ lua-5.1.4/src/lvm.c 2009/07/01 20:36:59
+@@ -133,6 +133,7 @@
+
+ void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {
+ int loop;
++ TValue temp;
+ for (loop = 0; loop < MAXTAGLOOP; loop++) {
+ const TValue *tm;
+ if (ttistable(t)) { /* `t' is a table? */
+@@ -152,7 +153,9 @@
+ callTM(L, tm, t, key, val);
+ return;
+ }
+- t = tm; /* else repeat with `tm' */
++ /* else repeat with `tm' */
++ setobj(L, &temp, tm); /* avoid pointing inside table (may rehash) */
++ t = &temp;
+ }
+ luaG_runerror(L, "loop in settable");
+ }
+
diff --git a/dev-lang/lua/files/5.1.4/03_all_debug_getfenv.upstream.patch b/dev-lang/lua/files/5.1.4/03_all_debug_getfenv.upstream.patch
new file mode 100644
index 000000000000..fce4d47db8f4
--- /dev/null
+++ b/dev-lang/lua/files/5.1.4/03_all_debug_getfenv.upstream.patch
@@ -0,0 +1,10 @@
+--- lua-5.1.4.orig/src/ldblib.c 2007/12/28 15:32:23 2.63.1.3
++++ lua-5.1.4/src/ldblib.c 2010/02/23 12:36:59
+@@ -45,6 +45,7 @@
+
+
+ static int db_getfenv (lua_State *L) {
++ luaL_checkany(L, 1);
+ lua_getfenv(L, 1);
+ return 1;
+ }
diff --git a/dev-lang/lua/files/5.1.4/04_all_gc_performance.upstream.patch b/dev-lang/lua/files/5.1.4/04_all_gc_performance.upstream.patch
new file mode 100644
index 000000000000..3c78525b0b2f
--- /dev/null
+++ b/dev-lang/lua/files/5.1.4/04_all_gc_performance.upstream.patch
@@ -0,0 +1,14 @@
+--- lua-5.1.4.orig/src/llex.c 2007/12/28 15:32:23 2.63.1.3
++++ lua-5.1.4/src/llex.c 2010/02/23 12:36:59
+@@ -118,8 +118,10 @@
+ lua_State *L = ls->L;
+ TString *ts = luaS_newlstr(L, str, l);
+ TValue *o = luaH_setstr(L, ls->fs->h, ts); /* entry for `str' */
+- if (ttisnil(o))
++ if (ttisnil(o)) {
+ setbvalue(o, 1); /* make sure `str' will not be collected */
++ luaC_checkGC(L);
++ }
+ return ts;
+ }
+
diff --git a/dev-lang/lua/files/5.1.4/05_all_string_format.upstream.patch b/dev-lang/lua/files/5.1.4/05_all_string_format.upstream.patch
new file mode 100644
index 000000000000..5127507df9f6
--- /dev/null
+++ b/dev-lang/lua/files/5.1.4/05_all_string_format.upstream.patch
@@ -0,0 +1,21 @@
+--- lua-5.1.4.orig/src/lstrlib.c 2008/07/11 17:27:21 1.132.1.4
++++ lua-5.1.4/src/lstrlib.c 2010/05/14 15:12:53
+@@ -754,6 +754,7 @@
+
+
+ static int str_format (lua_State *L) {
++ int top = lua_gettop(L);
+ int arg = 1;
+ size_t sfl;
+ const char *strfrmt = luaL_checklstring(L, arg, &sfl);
+@@ -768,7 +769,8 @@
+ else { /* format item */
+ char form[MAX_FORMAT]; /* to store the format (`%...') */
+ char buff[MAX_ITEM]; /* to store the formatted item */
+- arg++;
++ if (++arg > top)
++ luaL_argerror(L, arg, "no value");
+ strfrmt = scanformat(L, strfrmt, form);
+ switch (*strfrmt++) {
+ case 'c': {
+
diff --git a/dev-lang/lua/files/5.1.4/06_all_io_read.upstream.patch b/dev-lang/lua/files/5.1.4/06_all_io_read.upstream.patch
new file mode 100644
index 000000000000..94634c591404
--- /dev/null
+++ b/dev-lang/lua/files/5.1.4/06_all_io_read.upstream.patch
@@ -0,0 +1,15 @@
+--- lua-5.1.4.orig/src/liolib.c 2008/01/18 17:47:43 2.73.1.3
++++ lua-5.1.4/src/liolib.c 2010/05/14 15:29:29
+@@ -276,7 +276,10 @@
+ lua_pushnumber(L, d);
+ return 1;
+ }
+- else return 0; /* read fails */
++ else {
++ lua_pushnil(L); /* "result" to be removed */
++ return 0; /* read fails */
++ }
+ }
+
+
+
diff --git a/dev-lang/lua/files/5.1.4/07_all_boolean_expression.upstream.patch b/dev-lang/lua/files/5.1.4/07_all_boolean_expression.upstream.patch
new file mode 100644
index 000000000000..956e966817d4
--- /dev/null
+++ b/dev-lang/lua/files/5.1.4/07_all_boolean_expression.upstream.patch
@@ -0,0 +1,30 @@
+--- lua-5.1.4.orig/src/lcode.c 2007/12/28 15:32:23 2.25.1.3
++++ lua-5.1.4/src/lcode.c 2009/06/15 14:07:34
+@@ -549,13 +549,6 @@
+ pc = e->u.s.info;
+ break;
+ }
+- case VFALSE: {
+- if (!hasjumps(e)) {
+- pc = luaK_jump(fs); /* always jump */
+- break;
+- }
+- /* else go through */
+- }
+ default: {
+ pc = jumponcond(fs, e, 0);
+ break;
+@@ -579,13 +572,6 @@
+ pc = e->u.s.info;
+ break;
+ }
+- case VTRUE: {
+- if (!hasjumps(e)) {
+- pc = luaK_jump(fs); /* always jump */
+- break;
+- }
+- /* else go through */
+- }
+ default: {
+ pc = jumponcond(fs, e, 1);
+ break;
diff --git a/dev-lang/lua/files/5.1.4/08_all_metatable.upstream.patch b/dev-lang/lua/files/5.1.4/08_all_metatable.upstream.patch
new file mode 100644
index 000000000000..b74bafbebe41
--- /dev/null
+++ b/dev-lang/lua/files/5.1.4/08_all_metatable.upstream.patch
@@ -0,0 +1,10 @@
+--- lua-5.1.4.orig/src/lvm.c 2009/07/01 21:10:33 2.63.1.4
++++ lua-5.1.4/src/lvm.c 2011/08/17 20:36:28
+@@ -142,6 +142,7 @@
+ if (!ttisnil(oldval) || /* result is no nil? */
+ (tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL) { /* or no TM? */
+ setobj2t(L, oldval, val);
++ h->flags = 0;
+ luaC_barriert(L, h, val);
+ return;
+ }
diff --git a/dev-lang/lua/files/5.1.4/09_all_prototype_collection.upstream.patch b/dev-lang/lua/files/5.1.4/09_all_prototype_collection.upstream.patch
new file mode 100644
index 000000000000..000f78ccc7da
--- /dev/null
+++ b/dev-lang/lua/files/5.1.4/09_all_prototype_collection.upstream.patch
@@ -0,0 +1,13 @@
+--- lua-5.1.4.orig/src/lparser.c 2007/12/28 15:32:23 2.42.1.3
++++ lua-5.1.4/src/lparser.c 2011/10/17 13:10:43
+@@ -374,9 +374,9 @@
+ lua_assert(luaG_checkcode(f));
+ lua_assert(fs->bl == NULL);
+ ls->fs = fs->prev;
+- L->top -= 2; /* remove table and prototype from the stack */
+ /* last token read was anchored in defunct function; must reanchor it */
+ if (fs) anchor_token(ls);
++ L->top -= 2; /* remove table and prototype from the stack */
+ }
+
+
diff --git a/dev-lang/lua/files/5.2.0/01_all_memory_hoarding.upstream.patch b/dev-lang/lua/files/5.2.0/01_all_memory_hoarding.upstream.patch
new file mode 100644
index 000000000000..9fda24ad6609
--- /dev/null
+++ b/dev-lang/lua/files/5.2.0/01_all_memory_hoarding.upstream.patch
@@ -0,0 +1,49 @@
+--- lua-5.2.0.orig/src/ldblib.c 2007/12/28 15:32:23 2.25.1.3
++++ lua-5.2.0/src/ldblib.c 2009/06/15 14:07:34
+@@ -253,14 +253,15 @@
+ }
+
+
+-#define gethooktable(L) luaL_getsubtable(L, LUA_REGISTRYINDEX, HOOKKEY);
++#define gethooktable(L) luaL_getsubtable(L, LUA_REGISTRYINDEX, HOOKKEY)
+
+
+ static void hookf (lua_State *L, lua_Debug *ar) {
+ static const char *const hooknames[] =
+ {"call", "return", "line", "count", "tail call"};
+ gethooktable(L);
+- lua_rawgetp(L, -1, L);
++ lua_pushthread(L);
++ lua_rawget(L, -2);
+ if (lua_isfunction(L, -1)) {
+ lua_pushstring(L, hooknames[(int)ar->event]);
+ if (ar->currentline >= 0)
+@@ -306,10 +307,15 @@
+ count = luaL_optint(L, arg+3, 0);
+ func = hookf; mask = makemask(smask, count);
+ }
+- gethooktable(L);
++ if (gethooktable(L) == 0) { /* creating hook table? */
++ lua_pushstring(L, "k");
++ lua_setfield(L, -2, "__mode"); /** hooktable.__mode = "k" */
++ lua_pushvalue(L, -1);
++ lua_setmetatable(L, -2); /* setmetatable(hooktable) = hooktable */
++ }
++ lua_pushthread(L1); lua_xmove(L1, L, 1);
+ lua_pushvalue(L, arg+1);
+- lua_rawsetp(L, -2, L1); /* set new hook */
+- lua_pop(L, 1); /* remove hook table */
++ lua_rawset(L, -3); /* set new hook */
+ lua_sethook(L1, func, mask, count); /* set hooks */
+ return 0;
+ }
+@@ -325,7 +331,8 @@
+ lua_pushliteral(L, "external hook");
+ else {
+ gethooktable(L);
+- lua_rawgetp(L, -1, L1); /* get hook */
++ lua_pushthread(L1); lua_xmove(L1, L, 1);
++ lua_rawget(L, -2); /* get hook */
+ lua_remove(L, -2); /* remove hook table */
+ }
+ lua_pushstring(L, unmakemask(mask, buff));
diff --git a/dev-lang/lua/files/5.2.0/02_all_hex_number_handling.upstream.patch b/dev-lang/lua/files/5.2.0/02_all_hex_number_handling.upstream.patch
new file mode 100644
index 000000000000..26519e378e68
--- /dev/null
+++ b/dev-lang/lua/files/5.2.0/02_all_hex_number_handling.upstream.patch
@@ -0,0 +1,26 @@
+--- lua-5.2.0.orig/src/llex.c 2007/12/28 15:32:23 2.25.1.3
++++ lua-5.2.0/src/llex.c 2009/06/15 14:07:34
+@@ -223,12 +223,19 @@
+
+ /* LUA_NUMBER */
+ static void read_numeral (LexState *ls, SemInfo *seminfo) {
++ const char *expo = "Ee";
++ int first = ls->current;
+ lua_assert(lisdigit(ls->current));
+- do {
+- save_and_next(ls);
+- if (check_next(ls, "EePp")) /* exponent part? */
++ save_and_next(ls);
++ if (first == '0' && check_next(ls, "Xx")) /* hexadecimal? */
++ expo = "Pp";
++ for (;;) {
++ if (check_next(ls, expo)) /* exponent part? */
+ check_next(ls, "+-"); /* optional exponent sign */
+- } while (lislalnum(ls->current) || ls->current == '.');
++ if (lisxdigit(ls->current) || ls->current == '.')
++ save_and_next(ls);
++ else break;
++ }
+ save(ls, '\0');
+ buffreplace(ls, '.', ls->decpoint); /* follow locale for decimal point */
+ if (!buff2d(ls->buff, &seminfo->r)) /* format error? */
diff --git a/dev-lang/lua/files/configure.in b/dev-lang/lua/files/configure.in
new file mode 100644
index 000000000000..e4ba8164bbb5
--- /dev/null
+++ b/dev-lang/lua/files/configure.in
@@ -0,0 +1,5 @@
+top_buildir=.
+
+AC_INIT(src/luaconf.h)
+AC_PROG_LIBTOOL
+AC_OUTPUT()
diff --git a/dev-lang/lua/files/lua-5.1-make-r1.patch b/dev-lang/lua/files/lua-5.1-make-r1.patch
new file mode 100644
index 000000000000..8eecbdd40268
--- /dev/null
+++ b/dev-lang/lua/files/lua-5.1-make-r1.patch
@@ -0,0 +1,66 @@
+--- lua-5.1.1.orig/Makefile 2006-06-02 12:53:38.000000000 +0200
++++ lua-5.1.1/Makefile 2006-11-16 02:16:53.000000000 +0100
+@@ -127,3 +127,21 @@
+ .PHONY: all $(PLATS) clean test install local none dummy echo pecho lecho newer
+
+ # (end of Makefile)
++
++# Use libtool for binary installs, etc.
++
++export V
++export LIBTOOL = libtool --quiet --tag=CC
++# See libtool manual about how to set this
++
++gentoo_clean:
++ cd src; $(MAKE) $@
++
++gentoo_test: gentoo_linux
++ test/lua.static test/hello.lua
++
++gentoo_install:
++ mkdir -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB)
++ cd src; $(LIBTOOL) --mode=install $(INSTALL_EXEC) lua luac $(INSTALL_BIN)
++ cd src; $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
++ cd src; $(LIBTOOL) --mode=install $(INSTALL_DATA) liblua.la $(INSTALL_LIB)
+--- lua-5.1.1.orig/src/Makefile 2006-03-22 01:41:49.000000000 +0100
++++ lua-5.1.1/src/Makefile 2006-11-16 02:10:27.000000000 +0100
+@@ -54,1 +54,1 @@
+-$(LUA_T): $(LUA_O) $(LUA_A)
++origin$(LUA_T): $(LUA_O) $(LUA_A)
+@@ -57,1 +57,1 @@
+-$(LUAC_T): $(LUAC_O) $(LUA_A)
++origin$(LUAC_T): $(LUAC_O) $(LUA_A)
+@@ -176,3 +176,33 @@
+ ltm.h lzio.h lmem.h lopcodes.h lundump.h
+
+ # (end of Makefile)
++
++export LIBTOOL = libtool --quiet --tag=CC
++export LIB_VERSION = 6:1:1
++
++# The following rules use libtool for compiling and linking in order to
++# provide shared library support.
++
++LIB_NAME = liblua.la
++LIB_OBJS = $(CORE_O:.o=.lo) $(LIB_O:.o=.lo)
++
++%.lo %.o: %.c
++ $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
++
++$(LIB_NAME): $(LIB_OBJS)
++ $(LIBTOOL) --mode=link $(CC) -version-info $(LIB_VERSION) \
++ -rpath $(RPATH) $(LDFLAGS) -o $(LIB_NAME) $(LIB_OBJS) $(LIB_LIBS)
++
++$(LUA_T): $(LUA_O:.o=.lo) $(LIB_NAME)
++ $(LIBTOOL) --mode=link $(CC) -export-dynamic $(LDFLAGS) -o $@ $(LUA_O:.o=.lo) $(LIB_NAME) $(LUA_LIBS)
++
++lua_test: $(LUA_O:.o=.lo) $(LIB_NAME)
++ $(LIBTOOL) --mode=link $(CC) -static -export-dynamic $(LDFLAGS) -o $@ $(LUA_O:.o=.lo) $(LIB_NAME) $(LUA_LIBS)
++
++$(LUAC_T): $(LUAC_O:.o=.lo) $(LIB_NAME)
++ $(LIBTOOL) --mode=link $(CC) -static $(LDFLAGS) -o $@ $(LUAC_O:.o=.lo) $(LIB_NAME)
++
++gentoo_clean:
++ $(LIBTOOL) --mode=clean $(RM) $(ALL_O:.o=.lo) $(LIB_NAME) lua luac
++
++gentoo_all: $(LIB_NAME) $(LUA_T) lua_test $(LUAC_T)
diff --git a/dev-lang/lua/files/lua-5.1-make-r2.patch b/dev-lang/lua/files/lua-5.1-make-r2.patch
new file mode 100644
index 000000000000..2905a62d0f9e
--- /dev/null
+++ b/dev-lang/lua/files/lua-5.1-make-r2.patch
@@ -0,0 +1,97 @@
+diff -ru lua-5.1.5.orig/Makefile lua-5.1.5/Makefile
+--- lua-5.1.5.orig/Makefile 2014-04-15 17:43:34.845435031 +0200
++++ lua-5.1.5/Makefile 2014-04-15 19:05:08.669304987 +0200
+@@ -11,7 +11,7 @@
+ # so take care if INSTALL_TOP is not an absolute path.
+ INSTALL_TOP= /usr/local
+ INSTALL_BIN= $(INSTALL_TOP)/bin
+-INSTALL_INC= $(INSTALL_TOP)/include
++INSTALL_INC= $(INSTALL_TOP)/include/lua$V
+ INSTALL_LIB= $(INSTALL_TOP)/lib
+ INSTALL_MAN= $(INSTALL_TOP)/man/man1
+ #
+@@ -126,3 +126,21 @@
+ .PHONY: all $(PLATS) clean test install local none dummy echo pecho lecho
+
+ # (end of Makefile)
++
++# Use libtool for binary installs, etc.
++
++export V
++export LIBTOOL = libtool --quiet --tag=CC
++# See libtool manual about how to set this
++
++gentoo_clean:
++ cd src; $(MAKE) $@
++
++gentoo_test: gentoo_linux
++ test/lua.static test/hello.lua
++
++gentoo_install:
++ mkdir -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB)
++ cd src; $(LIBTOOL) --mode=install $(INSTALL_EXEC) lua$V luac$V $(INSTALL_BIN)
++ cd src; $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
++ cd src; $(LIBTOOL) --mode=install $(INSTALL_DATA) liblua$V.la $(INSTALL_LIB)
+diff -ru lua-5.1.5.orig/src/Makefile lua-5.1.5/src/Makefile
+--- lua-5.1.5.orig/src/Makefile 2014-04-15 17:43:34.844435031 +0200
++++ lua-5.1.5/src/Makefile 2014-04-15 18:07:21.427397122 +0200
+@@ -29,10 +29,10 @@
+ LIB_O= lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o \
+ lstrlib.o loadlib.o linit.o
+
+-LUA_T= lua
++LUA_T= lua$V
+ LUA_O= lua.o
+
+-LUAC_T= luac
++LUAC_T= luac$V
+ LUAC_O= luac.o print.o
+
+ ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O)
+@@ -51,10 +51,10 @@
+ $(AR) $@ $(CORE_O) $(LIB_O) # DLL needs all object files
+ $(RANLIB) $@
+
+-$(LUA_T): $(LUA_O) $(LUA_A)
++origin$(LUA_T): $(LUA_O) $(LUA_A)
+ $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
+
+-$(LUAC_T): $(LUAC_O) $(LUA_A)
++origin$(LUAC_T): $(LUAC_O) $(LUA_A)
+ $(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
+
+ clean:
+@@ -180,3 +180,33 @@
+ ltm.h lzio.h lmem.h lopcodes.h lundump.h
+
+ # (end of Makefile)
++
++export LIBTOOL = libtool --tag=CC
++export LIB_VERSION = 5:1:5
++
++# The following rules use libtool for compiling and linking in order to
++# provide shared library support.
++
++LIB_NAME = liblua$V.la
++LIB_OBJS = $(CORE_O:.o=.lo) $(LIB_O:.o=.lo)
++
++%.lo %.o: %.c
++ $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
++
++$(LIB_NAME): $(LIB_OBJS)
++ $(LIBTOOL) --mode=link $(CC) -version-info 0:0:0 \
++ -rpath $(RPATH) $(LDFLAGS) -o $(LIB_NAME) $(LIB_OBJS) $(LIB_LIBS)
++
++$(LUA_T): $(LUA_O:.o=.lo) $(LIB_NAME)
++ $(LIBTOOL) --mode=link $(CC) -export-dynamic $(LDFLAGS) -o $@ $(LUA_O:.o=.lo) $(LIB_NAME) $(LUA_LIBS)
++
++lua_test: $(LUA_O:.o=.lo) $(LIB_NAME)
++ $(LIBTOOL) --mode=link $(CC) -static -export-dynamic $(LDFLAGS) -o $@ $(LUA_O:.o=.lo) $(LIB_NAME) $(LUA_LIBS)
++
++$(LUAC_T): $(LUAC_O:.o=.lo) $(LIB_NAME)
++ $(LIBTOOL) --mode=link $(CC) -static $(LDFLAGS) -o $@ $(LUAC_O:.o=.lo) $(LIB_NAME)
++
++gentoo_clean:
++ $(LIBTOOL) --mode=clean $(RM) $(ALL_O:.o=.lo) $(LIB_NAME) lua$V luac$V
++
++gentoo_all: $(LIB_NAME) $(LUA_T) lua_test $(LUAC_T)
diff --git a/dev-lang/lua/files/lua-5.1-make_static-r1.patch b/dev-lang/lua/files/lua-5.1-make_static-r1.patch
new file mode 100644
index 000000000000..e5fdc3a6bfa1
--- /dev/null
+++ b/dev-lang/lua/files/lua-5.1-make_static-r1.patch
@@ -0,0 +1,12 @@
+diff -ru lua-5.1.1.orig/src/Makefile lua-5.1.1/src/Makefile
+--- lua-5.1.1.orig/src/Makefile 2006-11-21 07:19:31 +0000
++++ lua-5.1.1/src/Makefile 2006-11-21 07:19:52 +0000
+@@ -196,7 +196,7 @@
+ -rpath $(RPATH) $(LDFLAGS) -o $(LIB_NAME) $(LIB_OBJS) $(LIB_LIBS)
+
+ $(LUA_T): $(LUA_O:.o=.lo) $(LIB_NAME)
+- $(LIBTOOL) --mode=link $(CC) -export-dynamic $(LDFLAGS) -o $@ $(LUA_O:.o=.lo) $(LIB_NAME) $(LUA_LIBS)
++ $(LIBTOOL) --mode=link $(CC) -static -export-dynamic $(LDFLAGS) -o $@ $(LUA_O:.o=.lo) $(LIB_NAME) $(LUA_LIBS)
+
+ $(LUAC_T): $(LUAC_O:.o=.lo) $(LIB_NAME)
+ $(LIBTOOL) --mode=link $(CC) -static -o $@ $(LUAC_O:.o=.lo) $(LIB_NAME)
diff --git a/dev-lang/lua/files/lua-5.1-module_paths.patch b/dev-lang/lua/files/lua-5.1-module_paths.patch
new file mode 100644
index 000000000000..29ac4c3bf4bd
--- /dev/null
+++ b/dev-lang/lua/files/lua-5.1-module_paths.patch
@@ -0,0 +1,30 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## src_luaconf.h.dpatch by John V. Belmonte <jbelmonte@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Set Lua's default PATH and CPATH.
+
+@DPATCH@
+diff -urNad trunk~/src/luaconf.h trunk/src/luaconf.h
+--- trunk~/src/luaconf.h 2006-02-10 12:44:06.000000000 -0500
++++ trunk/src/luaconf.h 2006-02-17 21:32:55.000000000 -0500
+@@ -83,13 +83,17 @@
+
+ #else
+ #define LUA_ROOT "/usr/local/"
++#define LUA_ROOT2 "/usr/"
+ #define LUA_LDIR LUA_ROOT "share/lua/5.1/"
++#define LUA_LDIR2 LUA_ROOT2 "share/lua/5.1/"
+ #define LUA_CDIR LUA_ROOT "lib/lua/5.1/"
++#define LUA_CDIR2 LUA_ROOT2 "lib/lua/5.1/"
+ #define LUA_PATH_DEFAULT \
+ "./?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \
+- LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua"
++ LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" \
++ LUA_LDIR2"?.lua;" LUA_LDIR2"?/init.lua"
+ #define LUA_CPATH_DEFAULT \
+- "./?.so;" LUA_CDIR"?.so;" LUA_CDIR"loadall.so"
++ "./?.so;" LUA_CDIR"?.so;" LUA_CDIR2"?.so;" LUA_CDIR"loadall.so"
+ #endif
+
+
diff --git a/dev-lang/lua/files/lua-5.1-readline.patch b/dev-lang/lua/files/lua-5.1-readline.patch
new file mode 100644
index 000000000000..f144861efb6b
--- /dev/null
+++ b/dev-lang/lua/files/lua-5.1-readline.patch
@@ -0,0 +1,10 @@
+--- lua-5.1.1.orig/src/luaconf.h 2006-04-10 20:27:23.000000000 +0200
++++ lua-5.1.1/src/luaconf.h 2006-11-15 14:53:07.000000000 +0100
+@@ -36,7 +36,6 @@
+ #if defined(LUA_USE_LINUX)
+ #define LUA_USE_POSIX
+ #define LUA_USE_DLOPEN /* needs an extra library: -ldl */
+-#define LUA_USE_READLINE /* needs some extra libraries */
+ #endif
+
+ #if defined(LUA_USE_MACOSX)
diff --git a/dev-lang/lua/files/lua-5.1.4-deprecated.patch b/dev-lang/lua/files/lua-5.1.4-deprecated.patch
new file mode 100644
index 000000000000..a88a991d053e
--- /dev/null
+++ b/dev-lang/lua/files/lua-5.1.4-deprecated.patch
@@ -0,0 +1,46 @@
+diff -rdu lua-5.1.3.orig/src/luaconf.h lua-5.1.3/src/luaconf.h
+--- lua-5.1.3.orig/src/luaconf.h 2008-02-12 17:00:03.000000000 +0000
++++ lua-5.1.3/src/luaconf.h 2008-02-12 17:07:55.000000000 +0000
+@@ -340,14 +340,14 @@
+ ** CHANGE it to undefined as soon as your programs use only '...' to
+ ** access vararg parameters (instead of the old 'arg' table).
+ */
+-#define LUA_COMPAT_VARARG
++#undef LUA_COMPAT_VARARG
+
+ /*
+ @@ LUA_COMPAT_MOD controls compatibility with old math.mod function.
+ ** CHANGE it to undefined as soon as your programs use 'math.fmod' or
+ ** the new '%' operator instead of 'math.mod'.
+ */
+-#define LUA_COMPAT_MOD
++#undef LUA_COMPAT_MOD
+
+ /*
+ @@ LUA_COMPAT_LSTR controls compatibility with old long string nesting
+@@ -355,14 +355,14 @@
+ ** CHANGE it to 2 if you want the old behaviour, or undefine it to turn
+ ** off the advisory error when nesting [[...]].
+ */
+-#define LUA_COMPAT_LSTR 1
++#undef LUA_COMPAT_LSTR
+
+ /*
+ @@ LUA_COMPAT_GFIND controls compatibility with old 'string.gfind' name.
+ ** CHANGE it to undefined as soon as you rename 'string.gfind' to
+ ** 'string.gmatch'.
+ */
+-#define LUA_COMPAT_GFIND
++#undef LUA_COMPAT_GFIND
+
+ /*
+ @@ LUA_COMPAT_OPENLIB controls compatibility with old 'luaL_openlib'
+@@ -370,7 +370,7 @@
+ ** CHANGE it to undefined as soon as you replace to 'luaL_register'
+ ** your uses of 'luaL_openlib'
+ */
+-#define LUA_COMPAT_OPENLIB
++#undef LUA_COMPAT_OPENLIB
+
+
+
diff --git a/dev-lang/lua/files/lua-5.1.4-test.patch b/dev-lang/lua/files/lua-5.1.4-test.patch
new file mode 100644
index 000000000000..99b4ad648cc7
--- /dev/null
+++ b/dev-lang/lua/files/lua-5.1.4-test.patch
@@ -0,0 +1,11 @@
+--- test/sieve.lua~ 2002-10-31 03:52:58.000000000 +0100
++++ test/sieve.lua 2008-02-20 17:44:22.468281121 +0100
+@@ -14,7 +14,7 @@
+ while 1 do
+ local n = g()
+ if n == nil then return end
+- if math.mod(n, p) ~= 0 then coroutine.yield(n) end
++ if math.fmod(n, p) ~= 0 then coroutine.yield(n) end
+ end
+ end)
+ end
diff --git a/dev-lang/lua/files/lua-5.1.5-fix_vararg_calls.patch b/dev-lang/lua/files/lua-5.1.5-fix_vararg_calls.patch
new file mode 100644
index 000000000000..cec818203360
--- /dev/null
+++ b/dev-lang/lua/files/lua-5.1.5-fix_vararg_calls.patch
@@ -0,0 +1,12 @@
+diff -uNr lua-5.1.5.orig/src/ldo.c lua-5.1.5/src/ldo.c
+--- lua-5.1.5.orig/src/ldo.c 2016-11-28 20:04:13.177047928 +0100
++++ lua-5.1.5/src/ldo.c 2016-11-28 20:07:15.170432525 +0100
+@@ -274,7 +274,7 @@
+ CallInfo *ci;
+ StkId st, base;
+ Proto *p = cl->p;
+- luaD_checkstack(L, p->maxstacksize);
++ luaD_checkstack(L, p->maxstacksize + p->numparams);
+ func = restorestack(L, funcr);
+ if (!p->is_vararg) { /* no varargs? */
+ base = func + 1;
diff --git a/dev-lang/lua/files/lua-5.2-make-r1.patch b/dev-lang/lua/files/lua-5.2-make-r1.patch
new file mode 100644
index 000000000000..a0624af9cc33
--- /dev/null
+++ b/dev-lang/lua/files/lua-5.2-make-r1.patch
@@ -0,0 +1,75 @@
+--- lua-5.1.1.orig/Makefile 2006-06-02 12:53:38.000000000 +0200
++++ lua-5.1.1/Makefile 2006-11-16 02:16:53.000000000 +0100
+@@ -11,7 +11,7 @@
+ # so take care if INSTALL_TOP is not an absolute path.
+ INSTALL_TOP= /usr/local
+ INSTALL_BIN= $(INSTALL_TOP)/bin
+-INSTALL_INC= $(INSTALL_TOP)/include
++INSTALL_INC= $(INSTALL_TOP)/include/lua$V
+ INSTALL_LIB= $(INSTALL_TOP)/lib
+ INSTALL_MAN= $(INSTALL_TOP)/man/man1
+ #
+@@ -127,3 +127,18 @@
+ .PHONY: all $(PLATS) clean install local none dummy echo pecho lecho newer
+
+ # (end of Makefile)
++
++# Use libtool for binary installs, etc.
++
++export V
++export LIBTOOL = $(EROOT)usr/bin/libtool --quiet --tag=CC
++# See libtool manual about how to set this
++
++gentoo_clean:
++ cd src; $(MAKE) $@
++
++gentoo_install:
++ mkdir -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB)
++ cd src; $(LIBTOOL) --mode=install $(INSTALL_EXEC) lua$V luac$V $(INSTALL_BIN)
++ cd src; $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
++ cd src; $(LIBTOOL) --mode=install $(INSTALL_DATA) liblua$V.la $(INSTALL_LIB)
+--- lua-5.1.1.orig/src/Makefile 2006-03-22 01:41:49.000000000 +0100
++++ lua-5.1.1/src/Makefile 2006-11-16 02:10:27.000000000 +0100
+@@ -39,1 +39,1 @@
+-LUA_T= lua
++LUA_T= lua$V
+@@ -42,1 +42,1 @@
+-LUAC_T= luac
++LUAC_T= luac$V
+@@ -54,1 +54,1 @@
+-$(LUA_T): $(LUA_O) $(LUA_A)
++origin$(LUA_T): $(LUA_O) $(LUA_A)
+@@ -57,1 +57,1 @@
+-$(LUAC_T): $(LUAC_O) $(LUA_A)
++origin$(LUAC_T): $(LUAC_O) $(LUA_A)
+@@ -185,3 +185,30 @@
+ lzio.o: lzio.c lua.h luaconf.h llimits.h lmem.h lstate.h lobject.h ltm.h \
+ lzio.h
+
++
++export LIBTOOL = $(EROOT)usr/bin/libtool --quiet --tag=CC
++export LIB_VERSION = 6:1:1
++
++# The following rules use libtool for compiling and linking in order to
++# provide shared library support.
++
++LIB_NAME = liblua$V.la
++LIB_OBJS = $(CORE_O:.o=.lo) $(LIB_O:.o=.lo)
++
++%.lo %.o: %.c
++ $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
++
++$(LIB_NAME): $(LIB_OBJS)
++ $(LIBTOOL) --mode=link $(CC) -version-info $(LIB_VERSION) \
++ -rpath $(RPATH) $(LDFLAGS) -o $(LIB_NAME) $(LIB_OBJS) $(LIB_LIBS)
++
++$(LUA_T): $(LUA_O:.o=.lo) $(LIB_NAME)
++ $(LIBTOOL) --mode=link $(CC) -export-dynamic $(LDFLAGS) -o $@ $(LUA_O:.o=.lo) $(LIB_NAME) $(LUA_LIBS)
++
++$(LUAC_T): $(LUAC_O:.o=.lo) $(LIB_NAME)
++ $(LIBTOOL) --mode=link $(CC) -static $(LDFLAGS) -o $@ $(LUAC_O:.o=.lo) $(LIB_NAME)
++
++gentoo_clean:
++ $(LIBTOOL) --mode=clean $(RM) $(ALL_O:.o=.lo) $(LIB_NAME) lua$V luac$V
++
++gentoo_all: $(LIB_NAME) $(LUA_T) $(LUAC_T)
diff --git a/dev-lang/lua/files/lua-5.3-make-r1.patch b/dev-lang/lua/files/lua-5.3-make-r1.patch
new file mode 100644
index 000000000000..b9e9051462c4
--- /dev/null
+++ b/dev-lang/lua/files/lua-5.3-make-r1.patch
@@ -0,0 +1,91 @@
+diff -uNr lua-5.3.3.orig/Makefile lua-5.3.3/Makefile
+--- lua-5.3.3.orig/Makefile 2016-12-04 22:29:54.839135901 +0100
++++ lua-5.3.3/Makefile 2016-12-04 22:31:14.235851109 +0100
+@@ -12,7 +12,7 @@
+ # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h.
+ INSTALL_TOP= /usr/local
+ INSTALL_BIN= $(INSTALL_TOP)/bin
+-INSTALL_INC= $(INSTALL_TOP)/include
++INSTALL_INC= $(INSTALL_TOP)/include/lua$V
+ INSTALL_LIB= $(INSTALL_TOP)/lib
+ INSTALL_MAN= $(INSTALL_TOP)/man/man1
+ INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
+@@ -112,3 +112,18 @@
+ .PHONY: all $(PLATS) clean test install local none dummy echo pecho lecho
+
+ # (end of Makefile)
++
++# Use libtool for binary installs, etc.
++
++export V
++export LIBTOOL = $(EROOT)usr/bin/libtool --quiet --tag=CC
++# See libtool manual about how to set this
++
++gentoo_clean:
++ cd src; $(MAKE) $@
++
++gentoo_install:
++ mkdir -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB)
++ cd src; $(LIBTOOL) --mode=install $(INSTALL_EXEC) lua$V luac$V $(INSTALL_BIN)
++ cd src; $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
++ cd src; $(LIBTOOL) --mode=install $(INSTALL_DATA) liblua$V.la $(INSTALL_LIB)
+diff -uNr lua-5.3.3.orig/src/Makefile lua-5.3.3/src/Makefile
+--- lua-5.3.3.orig/src/Makefile 2016-12-04 22:29:54.840135910 +0100
++++ lua-5.3.3/src/Makefile 2016-12-04 22:34:55.980848068 +0100
+@@ -36,10 +36,10 @@
+ lmathlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o loadlib.o linit.o
+ BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
+
+-LUA_T= lua
++LUA_T= lua$V
+ LUA_O= lua.o
+
+-LUAC_T= luac
++LUAC_T= luac$V
+ LUAC_O= luac.o
+
+ ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
+@@ -59,10 +59,10 @@
+ $(AR) $@ $(BASE_O)
+ $(RANLIB) $@
+
+-$(LUA_T): $(LUA_O) $(LUA_A)
++origin$(LUA_T): $(LUA_O) $(LUA_A)
+ $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
+
+-$(LUAC_T): $(LUAC_O) $(LUA_A)
++origin$(LUAC_T): $(LUAC_O) $(LUA_A)
+ $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
+
+ clean:
+@@ -195,3 +195,30 @@
+ lobject.h ltm.h lzio.h
+
+ # (end of Makefile)
++
++export LIBTOOL = $(EROOT)usr/bin/libtool --quiet --tag=CC
++export LIB_VERSION = 6:1:1
++
++# The following rules use libtool for compiling and linking in order to
++# provide shared library support.
++
++LIB_NAME = liblua$V.la
++LIB_OBJS = $(CORE_O:.o=.lo) $(LIB_O:.o=.lo)
++
++%.lo %.o: %.c
++ $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
++
++$(LIB_NAME): $(LIB_OBJS)
++ $(LIBTOOL) --mode=link $(CC) -version-info $(LIB_VERSION) \
++ -rpath $(RPATH) $(LDFLAGS) -o $(LIB_NAME) $(LIB_OBJS) $(LIB_LIBS)
++
++$(LUA_T): $(LUA_O:.o=.lo) $(LIB_NAME)
++ $(LIBTOOL) --mode=link $(CC) -export-dynamic $(LDFLAGS) -o $@ $(LUA_O:.o=.lo) $(LIB_NAME) $(LUA_LIBS)
++
++$(LUAC_T): $(LUAC_O:.o=.lo) $(LIB_NAME)
++ $(LIBTOOL) --mode=link $(CC) -static $(LDFLAGS) -o $@ $(LUAC_O:.o=.lo) $(LIB_NAME)
++
++gentoo_clean:
++ $(LIBTOOL) --mode=clean $(RM) $(ALL_O:.o=.lo) $(LIB_NAME) lua$V luac$V
++
++gentoo_all: $(LIB_NAME) $(LUA_T) $(LUAC_T)
diff --git a/dev-lang/lua/files/lua.pc b/dev-lang/lua/files/lua.pc
new file mode 100644
index 000000000000..e53971852c10
--- /dev/null
+++ b/dev-lang/lua/files/lua.pc
@@ -0,0 +1,31 @@
+# lua.pc -- pkg-config data for Lua
+
+# vars from install Makefile
+
+# grep '^V=' ../Makefile
+V= 5.1
+# grep '^R=' ../Makefile
+R= 5.1.4
+
+# grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/'
+prefix= /usr
+INSTALL_BIN= ${prefix}/bin
+INSTALL_INC= ${prefix}/include
+INSTALL_LIB= ${prefix}/,lib,
+INSTALL_MAN= ${prefix}/man/man1
+INSTALL_LMOD= ${prefix}/share/lua/${V}
+INSTALL_CMOD= ${prefix}/,lib,/lua/${V}
+
+# canonical vars
+exec_prefix=${prefix}
+libdir=${exec_prefix}/,lib,
+includedir=${prefix}/include
+
+Name: Lua
+Description: An Extensible Extension Language
+Version: ${R}
+Requires:
+Libs: -L${libdir} -llua -lm
+Cflags: -I${includedir}
+
+# (end of lua.pc)
diff --git a/dev-lang/lua/lua-5.1.5-r100.ebuild b/dev-lang/lua/lua-5.1.5-r100.ebuild
new file mode 100644
index 000000000000..a14eb65c7d8e
--- /dev/null
+++ b/dev-lang/lua/lua-5.1.5-r100.ebuild
@@ -0,0 +1,137 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils multilib multilib-minimal portability toolchain-funcs versionator
+
+DESCRIPTION="A powerful light-weight programming language designed for extending applications"
+HOMEPAGE="http://www.lua.org/"
+SRC_URI="http://www.lua.org/ftp/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="5.1"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="+deprecated emacs readline static"
+
+RDEPEND="readline? ( >=sys-libs/readline-6.2_p5-r1:0=[${MULTILIB_USEDEP}] )
+ app-eselect/eselect-lua
+ !dev-lang/lua:0"
+DEPEND="${RDEPEND}
+ sys-devel/libtool"
+PDEPEND="emacs? ( app-emacs/lua-mode )"
+
+SAN_SLOT="${SLOT//.}"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/lua${SLOT}/luaconf.h
+)
+
+src_prepare() {
+ local PATCH_PV=$(get_version_component_range 1-2)
+
+ epatch "${FILESDIR}"/${PN}-${PATCH_PV}-make-r2.patch
+ epatch "${FILESDIR}"/${PN}-${PATCH_PV}-module_paths.patch
+
+ # use glibtool on Darwin (versus Apple libtool)
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ sed -i -e '/LIBTOOL = /s:libtool:glibtool:' \
+ Makefile src/Makefile || die
+ fi
+
+ #EPATCH_SOURCE="${FILESDIR}/${PV}" EPATCH_SUFFIX="upstream.patch" epatch
+
+ # correct lua versioning
+ sed -i -e 's/\(LIB_VERSION = \)6:1:1/\16:5:1/' src/Makefile
+
+ sed -i -e 's:\(/README\)\("\):\1.gz\2:g' doc/readme.html
+
+ if ! use deprecated ; then
+ # patches from 5.1.4 still apply
+ epatch "${FILESDIR}"/${PN}-5.1.4-deprecated.patch
+ epatch "${FILESDIR}"/${PN}-5.1.4-test.patch
+ fi
+
+ if ! use readline ; then
+ epatch "${FILESDIR}"/${PN}-${PATCH_PV}-readline.patch
+ fi
+
+ # Using dynamic linked lua is not recommended for performance
+ # reasons. http://article.gmane.org/gmane.comp.lang.lua.general/18519
+ # Mainly, this is of concern if your arch is poor with GPRs, like x86
+ # Note that this only affects the interpreter binary (named lua), not the lua
+ # compiler (built statically) nor the lua libraries (both shared and static
+ # are installed)
+ if use static ; then
+ epatch "${FILESDIR}"/${PN}-${PATCH_PV}-make_static-r1.patch
+ fi
+
+ # custom Makefiles
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ # We want packages to find our things...
+ sed -i \
+ -e 's:/usr/local:'${EPREFIX}'/usr:' \
+ -e "s:\([/\"]\)\<lib\>:\1$(get_libdir):g" \
+ etc/lua.pc src/luaconf.h || die
+}
+
+multilib_src_compile() {
+ tc-export CC
+ myflags=
+ # what to link to liblua
+ liblibs="-lm"
+ liblibs="${liblibs} $(dlopen_lib)"
+
+ # what to link to the executables
+ mylibs=
+ if use readline; then
+ mylibs="-lreadline"
+ fi
+
+ cd src
+ emake CC="${CC}" CFLAGS="-DLUA_USE_LINUX ${CFLAGS}" \
+ RPATH="${EPREFIX}/usr/$(get_libdir)/" \
+ LUA_LIBS="${mylibs}" \
+ LIB_LIBS="${liblibs}" \
+ V=$(get_version_component_range 1-2) \
+ gentoo_all
+
+ mv lua_test ../test/lua.static
+}
+
+multilib_src_install() {
+ emake INSTALL_TOP="${ED}/usr" INSTALL_LIB="${ED}/usr/$(get_libdir)" \
+ V=${SLOT} gentoo_install
+
+ insinto /usr/$(get_libdir)/pkgconfig
+ newins etc/lua.pc lua${SLOT}.pc
+}
+
+multilib_src_install_all() {
+ dodoc HISTORY README
+ dohtml doc/*.html doc/*.png doc/*.css doc/*.gif
+
+ doicon etc/lua.ico
+
+ newman doc/lua.1 lua${SLOT}.1
+ newman doc/luac.1 luac${SLOT}.1
+}
+
+multilib_src_test() {
+ local positive="bisect cf echo env factorial fib fibfor hello printf sieve
+ sort trace-calls trace-globals"
+ local negative="readonly"
+ local test
+
+ cd "${BUILD_DIR}" || die
+ for test in ${positive}; do
+ test/lua.static test/${test}.lua || die "test $test failed"
+ done
+
+ for test in ${negative}; do
+ test/lua.static test/${test}.lua && die "test $test failed"
+ done
+}
diff --git a/dev-lang/lua/lua-5.1.5-r101.ebuild b/dev-lang/lua/lua-5.1.5-r101.ebuild
new file mode 100644
index 000000000000..1be902b9441c
--- /dev/null
+++ b/dev-lang/lua/lua-5.1.5-r101.ebuild
@@ -0,0 +1,144 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils multilib multilib-minimal portability toolchain-funcs versionator
+
+DESCRIPTION="A powerful light-weight programming language designed for extending applications"
+HOMEPAGE="http://www.lua.org/"
+SRC_URI="http://www.lua.org/ftp/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="5.1"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="+deprecated emacs readline static"
+
+RDEPEND="readline? ( >=sys-libs/readline-6.2_p5-r1:0=[${MULTILIB_USEDEP}] )
+ app-eselect/eselect-lua
+ !dev-lang/lua:0"
+DEPEND="${RDEPEND}
+ sys-devel/libtool"
+PDEPEND="emacs? ( app-emacs/lua-mode )"
+
+SAN_SLOT="${SLOT//.}"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/lua${SLOT}/luaconf.h
+)
+
+src_prepare() {
+ local PATCH_PV=$(get_version_component_range 1-2)
+
+ epatch "${FILESDIR}"/${PN}-${PATCH_PV}-make-r2.patch
+ epatch "${FILESDIR}"/${PN}-${PATCH_PV}-module_paths.patch
+
+ # use glibtool on Darwin (versus Apple libtool)
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ sed -i -e '/LIBTOOL = /s:libtool:glibtool:' \
+ Makefile src/Makefile || die
+ fi
+
+ #EPATCH_SOURCE="${FILESDIR}/${PV}" EPATCH_SUFFIX="upstream.patch" epatch
+
+ # correct lua versioning
+ sed -i -e 's/\(LIB_VERSION = \)6:1:1/\16:5:1/' src/Makefile
+
+ sed -i -e 's:\(/README\)\("\):\1.gz\2:g' doc/readme.html
+
+ if ! use deprecated ; then
+ # patches from 5.1.4 still apply
+ epatch "${FILESDIR}"/${PN}-5.1.4-deprecated.patch
+ epatch "${FILESDIR}"/${PN}-5.1.4-test.patch
+ fi
+
+ if ! use readline ; then
+ epatch "${FILESDIR}"/${PN}-${PATCH_PV}-readline.patch
+ fi
+
+ # Using dynamic linked lua is not recommended for performance
+ # reasons. http://article.gmane.org/gmane.comp.lang.lua.general/18519
+ # Mainly, this is of concern if your arch is poor with GPRs, like x86
+ # Note that this only affects the interpreter binary (named lua), not the lua
+ # compiler (built statically) nor the lua libraries (both shared and static
+ # are installed)
+ if use static ; then
+ epatch "${FILESDIR}"/${PN}-${PATCH_PV}-make_static-r1.patch
+ fi
+
+ # custom Makefiles
+ multilib_copy_sources
+
+ # A slotted Lua uses different directories for headers & names for
+ # libraries, and pkgconfig should reflect that.
+ sed -r -i \
+ -e "/^Libs:/s,((-llua)($| )),\2${SLOT}\3," \
+ -e "/^Cflags:/s,((-I..includedir.)($| )),\2/lua${SLOT}\3," \
+ "${S}"/etc/lua.pc
+}
+
+multilib_src_configure() {
+ # We want packages to find our things...
+ sed -i \
+ -e 's:/usr/local:'${EPREFIX}'/usr:' \
+ -e "s:\([/\"]\)\<lib\>:\1$(get_libdir):g" \
+ etc/lua.pc src/luaconf.h || die
+}
+
+multilib_src_compile() {
+ tc-export CC
+ myflags=
+ # what to link to liblua
+ liblibs="-lm"
+ liblibs="${liblibs} $(dlopen_lib)"
+
+ # what to link to the executables
+ mylibs=
+ if use readline; then
+ mylibs="-lreadline"
+ fi
+
+ cd src
+ emake CC="${CC}" CFLAGS="-DLUA_USE_LINUX ${CFLAGS}" \
+ RPATH="${EPREFIX}/usr/$(get_libdir)/" \
+ LUA_LIBS="${mylibs}" \
+ LIB_LIBS="${liblibs}" \
+ V=$(get_version_component_range 1-2) \
+ gentoo_all
+
+ mv lua_test ../test/lua.static
+}
+
+multilib_src_install() {
+ emake INSTALL_TOP="${ED}/usr" INSTALL_LIB="${ED}/usr/$(get_libdir)" \
+ V=${SLOT} gentoo_install
+
+ insinto /usr/$(get_libdir)/pkgconfig
+ newins etc/lua.pc lua${SLOT}.pc
+}
+
+multilib_src_install_all() {
+ dodoc HISTORY README
+ dohtml doc/*.html doc/*.png doc/*.css doc/*.gif
+
+ doicon etc/lua.ico
+
+ newman doc/lua.1 lua${SLOT}.1
+ newman doc/luac.1 luac${SLOT}.1
+}
+
+multilib_src_test() {
+ local positive="bisect cf echo env factorial fib fibfor hello printf sieve
+ sort trace-calls trace-globals"
+ local negative="readonly"
+ local test
+
+ cd "${BUILD_DIR}" || die
+ for test in ${positive}; do
+ test/lua.static test/${test}.lua || die "test $test failed"
+ done
+
+ for test in ${negative}; do
+ test/lua.static test/${test}.lua && die "test $test failed"
+ done
+}
diff --git a/dev-lang/lua/lua-5.1.5-r4.ebuild b/dev-lang/lua/lua-5.1.5-r4.ebuild
new file mode 100644
index 000000000000..4271b4c26e2a
--- /dev/null
+++ b/dev-lang/lua/lua-5.1.5-r4.ebuild
@@ -0,0 +1,134 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils multilib multilib-minimal portability toolchain-funcs versionator
+
+DESCRIPTION="A powerful light-weight programming language designed for extending applications"
+HOMEPAGE="http://www.lua.org/"
+SRC_URI="http://www.lua.org/ftp/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="+deprecated emacs readline static"
+
+RDEPEND="readline? ( >=sys-libs/readline-6.2_p5-r1:0=[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+ sys-devel/libtool"
+PDEPEND="emacs? ( app-emacs/lua-mode )"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/luaconf.h
+)
+
+src_prepare() {
+ local PATCH_PV=$(get_version_component_range 1-2)
+
+ epatch "${FILESDIR}/${P}-fix_vararg_calls.patch"
+
+ epatch "${FILESDIR}"/${PN}-${PATCH_PV}-make-r1.patch
+ epatch "${FILESDIR}"/${PN}-${PATCH_PV}-module_paths.patch
+
+ # use glibtool on Darwin (versus Apple libtool)
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ sed -i -e '/LIBTOOL = /s:libtool:glibtool:' \
+ Makefile src/Makefile || die
+ fi
+
+ #EPATCH_SOURCE="${FILESDIR}/${PV}" EPATCH_SUFFIX="upstream.patch" epatch
+
+ # correct lua versioning
+ sed -i -e 's/\(LIB_VERSION = \)6:1:1/\16:5:1/' src/Makefile || die
+
+ sed -i -e 's:\(/README\)\("\):\1.gz\2:g' doc/readme.html || die
+
+ if ! use deprecated ; then
+ # patches from 5.1.4 still apply
+ epatch "${FILESDIR}"/${PN}-5.1.4-deprecated.patch
+ epatch "${FILESDIR}"/${PN}-5.1.4-test.patch
+ fi
+
+ if ! use readline ; then
+ epatch "${FILESDIR}"/${PN}-${PATCH_PV}-readline.patch
+ fi
+
+ # Using dynamic linked lua is not recommended for performance
+ # reasons. http://article.gmane.org/gmane.comp.lang.lua.general/18519
+ # Mainly, this is of concern if your arch is poor with GPRs, like x86
+ # Note that this only affects the interpreter binary (named lua), not the lua
+ # compiler (built statically) nor the lua libraries (both shared and static
+ # are installed)
+ if use static ; then
+ epatch "${FILESDIR}"/${PN}-${PATCH_PV}-make_static-r1.patch
+ fi
+
+ # custom Makefiles
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ # We want packages to find our things...
+ sed -i \
+ -e 's:/usr/local:'${EPREFIX}'/usr:' \
+ -e "s:\([/\"]\)\<lib\>:\1$(get_libdir):g" \
+ etc/lua.pc src/luaconf.h || die
+}
+
+multilib_src_compile() {
+ tc-export CC
+ myflags=
+ # what to link to liblua
+ liblibs="-lm"
+ liblibs="${liblibs} $(dlopen_lib)"
+
+ # what to link to the executables
+ mylibs=
+ if use readline; then
+ mylibs="-lreadline"
+ fi
+
+ cd src
+ emake CC="${CC}" CFLAGS="-DLUA_USE_LINUX ${CFLAGS}" \
+ RPATH="${EPREFIX}/usr/$(get_libdir)/" \
+ LUA_LIBS="${mylibs}" \
+ LIB_LIBS="${liblibs}" \
+ V=${PV} \
+ gentoo_all
+
+ mv lua_test ../test/lua.static
+}
+
+multilib_src_install() {
+ emake INSTALL_TOP="${ED}/usr" INSTALL_LIB="${ED}/usr/$(get_libdir)" \
+ V=${PV} gentoo_install
+
+ insinto /usr/$(get_libdir)/pkgconfig
+ doins etc/lua.pc
+}
+
+multilib_src_install_all() {
+ dodoc HISTORY README
+ dohtml doc/*.html doc/*.png doc/*.css doc/*.gif
+
+ doicon etc/lua.ico
+
+ doman doc/lua.1 doc/luac.1
+}
+
+multilib_src_test() {
+ local positive="bisect cf echo env factorial fib fibfor hello printf sieve
+ sort trace-calls trace-globals"
+ local negative="readonly"
+ local test
+
+ cd "${BUILD_DIR}" || die
+ for test in ${positive}; do
+ test/lua.static test/${test}.lua || die "test $test failed"
+ done
+
+ for test in ${negative}; do
+ test/lua.static test/${test}.lua && die "test $test failed"
+ done
+}
diff --git a/dev-lang/lua/lua-5.2.3-r1.ebuild b/dev-lang/lua/lua-5.2.3-r1.ebuild
new file mode 100644
index 000000000000..a02bb4bc6d9c
--- /dev/null
+++ b/dev-lang/lua/lua-5.2.3-r1.ebuild
@@ -0,0 +1,136 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils autotools multilib multilib-minimal portability toolchain-funcs versionator
+
+DESCRIPTION="A powerful light-weight programming language designed for extending applications"
+HOMEPAGE="http://www.lua.org/"
+SRC_URI="http://www.lua.org/ftp/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="5.2"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="+deprecated emacs readline static"
+
+RDEPEND="readline? ( sys-libs/readline:0= )
+ app-eselect/eselect-lua
+ !dev-lang/lua:0"
+DEPEND="${RDEPEND}
+ sys-devel/libtool"
+PDEPEND="emacs? ( app-emacs/lua-mode )"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/lua${SLOT}/luaconf.h
+)
+
+src_prepare() {
+ local PATCH_PV=$(get_version_component_range 1-2)
+
+ epatch "${FILESDIR}"/${PN}-${PATCH_PV}-make-r1.patch
+
+ # use glibtool on Darwin (versus Apple libtool)
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ sed -i -e '/LIBTOOL = /s:/libtool:/glibtool:' \
+ Makefile src/Makefile || die
+ fi
+
+ [ -d "${FILESDIR}/${PV}" ] && \
+ EPATCH_SOURCE="${FILESDIR}/${PV}" EPATCH_SUFFIX="upstream.patch" epatch
+
+ # correct lua versioning
+ sed -i -e 's/\(LIB_VERSION = \)6:1:1/\10:0:0/' src/Makefile || die
+
+ sed -i -e 's:\(/README\)\("\):\1.gz\2:g' doc/readme.html || die
+
+ if ! use readline ; then
+ sed -i -e '/#define LUA_USE_READLINE/d' src/luaconf.h || die
+ fi
+
+ # Using dynamic linked lua is not recommended for performance
+ # reasons. http://article.gmane.org/gmane.comp.lang.lua.general/18519
+ # Mainly, this is of concern if your arch is poor with GPRs, like x86
+ # Note that this only affects the interpreter binary (named lua), not the lua
+ # compiler (built statically) nor the lua libraries (both shared and static
+ # are installed)
+ if use static ; then
+ sed -i -e 's:\(-export-dynamic\):-static \1:' src/Makefile || die
+ fi
+
+ # upstream does not use libtool, but we do (see bug #336167)
+ cp "${FILESDIR}/configure.in" "${S}"/ || die
+ eautoreconf
+
+ # custom Makefiles
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ sed -i \
+ -e 's:\(define LUA_ROOT\s*\).*:\1"'${EPREFIX}'/usr/":' \
+ -e "s:\(define LUA_CDIR\s*LUA_ROOT \"\)lib:\1$(get_libdir):" \
+ src/luaconf.h \
+ || die "failed patching luaconf.h"
+
+ econf
+}
+
+multilib_src_compile() {
+ tc-export CC
+
+ # what to link to liblua
+ liblibs="-lm"
+ liblibs="${liblibs} $(dlopen_lib)"
+
+ # what to link to the executables
+ mylibs=
+ use readline && mylibs="-lreadline"
+
+ cd src
+
+ local myCFLAGS=""
+ use deprecated && myCFLAGS="-DLUA_COMPAT_ALL"
+
+ case "${CHOST}" in
+ *-mingw*) : ;;
+ *) myCFLAGS+=" -DLUA_USE_LINUX" ;;
+ esac
+
+ emake CC="${CC}" CFLAGS="${myCFLAGS} ${CFLAGS}" \
+ SYSLDFLAGS="${LDFLAGS}" \
+ RPATH="${EPREFIX}/usr/$(get_libdir)/" \
+ LUA_LIBS="${mylibs}" \
+ LIB_LIBS="${liblibs}" \
+ V=$(get_version_component_range 1-2) \
+ gentoo_all
+}
+
+multilib_src_install() {
+ emake INSTALL_TOP="${ED}/usr" INSTALL_LIB="${ED}/usr/$(get_libdir)" \
+ V=${SLOT} gentoo_install
+
+ # We want packages to find our things...
+ cp "${FILESDIR}/lua.pc" "${WORKDIR}"
+ sed -i \
+ -e "s:^prefix= :prefix= ${EPREFIX}:" \
+ -e "s:^V=.*:V= ${PATCH_PV}:" \
+ -e "s:^R=.*:R= ${PV}:" \
+ -e "s:/,lib,:/$(get_libdir):g" \
+ "${WORKDIR}/lua.pc"
+
+ insinto "/usr/$(get_libdir)/pkgconfig"
+ newins "${WORKDIR}/lua.pc" "lua${SLOT}.pc"
+}
+
+multilib_src_install_all() {
+ dodoc README
+ dohtml doc/*.html doc/*.png doc/*.css doc/*.gif
+
+ newman doc/lua.1 lua${SLOT}.1
+ newman doc/luac.1 luac${SLOT}.1
+}
+
+# Makefile contains a dummy target that doesn't do tests
+# but causes issues with slotted lua (bug #510360)
+src_test() { :; }
diff --git a/dev-lang/lua/lua-5.2.3-r2.ebuild b/dev-lang/lua/lua-5.2.3-r2.ebuild
new file mode 100644
index 000000000000..e904f6ab9dae
--- /dev/null
+++ b/dev-lang/lua/lua-5.2.3-r2.ebuild
@@ -0,0 +1,143 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils autotools multilib multilib-minimal portability toolchain-funcs versionator
+
+DESCRIPTION="A powerful light-weight programming language designed for extending applications"
+HOMEPAGE="http://www.lua.org/"
+SRC_URI="http://www.lua.org/ftp/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="5.2"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="+deprecated emacs readline static"
+
+RDEPEND="readline? ( sys-libs/readline:0= )
+ app-eselect/eselect-lua
+ !dev-lang/lua:0"
+DEPEND="${RDEPEND}
+ sys-devel/libtool"
+PDEPEND="emacs? ( app-emacs/lua-mode )"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/lua${SLOT}/luaconf.h
+)
+
+src_prepare() {
+ local PATCH_PV=$(get_version_component_range 1-2)
+
+ epatch "${FILESDIR}"/${PN}-${PATCH_PV}-make-r1.patch
+
+ # use glibtool on Darwin (versus Apple libtool)
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ sed -i -e '/LIBTOOL = /s:/libtool:/glibtool:' \
+ Makefile src/Makefile || die
+ fi
+
+ [ -d "${FILESDIR}/${PV}" ] && \
+ EPATCH_SOURCE="${FILESDIR}/${PV}" EPATCH_SUFFIX="upstream.patch" epatch
+
+ # correct lua versioning
+ sed -i -e 's/\(LIB_VERSION = \)6:1:1/\10:0:0/' src/Makefile || die
+
+ sed -i -e 's:\(/README\)\("\):\1.gz\2:g' doc/readme.html || die
+
+ if ! use readline ; then
+ sed -i -e '/#define LUA_USE_READLINE/d' src/luaconf.h || die
+ fi
+
+ # Using dynamic linked lua is not recommended for performance
+ # reasons. http://article.gmane.org/gmane.comp.lang.lua.general/18519
+ # Mainly, this is of concern if your arch is poor with GPRs, like x86
+ # Note that this only affects the interpreter binary (named lua), not the lua
+ # compiler (built statically) nor the lua libraries (both shared and static
+ # are installed)
+ if use static ; then
+ sed -i -e 's:\(-export-dynamic\):-static \1:' src/Makefile || die
+ fi
+
+ # upstream does not use libtool, but we do (see bug #336167)
+ cp "${FILESDIR}/configure.in" "${S}"/ || die
+ eautoreconf
+
+ # custom Makefiles
+ multilib_copy_sources
+
+ # A slotted Lua uses different directories for headers & names for
+ # libraries, and pkgconfig should reflect that.
+ sed -r -i \
+ -e "/^Libs:/s,((-llua)($| )),\2${SLOT}\3," \
+ -e "/^Cflags:/s,((-I..includedir.)($| )),\2/lua${SLOT}\3," \
+ "${S}"/etc/lua.pc
+}
+
+multilib_src_configure() {
+ sed -i \
+ -e 's:\(define LUA_ROOT\s*\).*:\1"'${EPREFIX}'/usr/":' \
+ -e "s:\(define LUA_CDIR\s*LUA_ROOT \"\)lib:\1$(get_libdir):" \
+ src/luaconf.h \
+ || die "failed patching luaconf.h"
+
+ econf
+}
+
+multilib_src_compile() {
+ tc-export CC
+
+ # what to link to liblua
+ liblibs="-lm"
+ liblibs="${liblibs} $(dlopen_lib)"
+
+ # what to link to the executables
+ mylibs=
+ use readline && mylibs="-lreadline"
+
+ cd src
+
+ local myCFLAGS=""
+ use deprecated && myCFLAGS="-DLUA_COMPAT_ALL"
+
+ case "${CHOST}" in
+ *-mingw*) : ;;
+ *) myCFLAGS+=" -DLUA_USE_LINUX" ;;
+ esac
+
+ emake CC="${CC}" CFLAGS="${myCFLAGS} ${CFLAGS}" \
+ SYSLDFLAGS="${LDFLAGS}" \
+ RPATH="${EPREFIX}/usr/$(get_libdir)/" \
+ LUA_LIBS="${mylibs}" \
+ LIB_LIBS="${liblibs}" \
+ V=$(get_version_component_range 1-2) \
+ gentoo_all
+}
+
+multilib_src_install() {
+ emake INSTALL_TOP="${ED}/usr" INSTALL_LIB="${ED}/usr/$(get_libdir)" \
+ V=${SLOT} gentoo_install
+
+ # We want packages to find our things...
+ cp "${FILESDIR}/lua.pc" "${WORKDIR}"
+ sed -i \
+ -e "s:^prefix= :prefix= ${EPREFIX}:" \
+ -e "s:^V=.*:V= ${PATCH_PV}:" \
+ -e "s:^R=.*:R= ${PV}:" \
+ -e "s:/,lib,:/$(get_libdir):g" \
+ "${WORKDIR}/lua.pc"
+
+ insinto "/usr/$(get_libdir)/pkgconfig"
+ newins "${WORKDIR}/lua.pc" "lua${SLOT}.pc"
+}
+
+multilib_src_install_all() {
+ dodoc README
+ dohtml doc/*.html doc/*.png doc/*.css doc/*.gif
+
+ newman doc/lua.1 lua${SLOT}.1
+ newman doc/luac.1 luac${SLOT}.1
+}
+
+# Makefile contains a dummy target that doesn't do tests
+# but causes issues with slotted lua (bug #510360)
+src_test() { :; }
diff --git a/dev-lang/lua/lua-5.2.3.ebuild b/dev-lang/lua/lua-5.2.3.ebuild
new file mode 100644
index 000000000000..9be8e7d8be85
--- /dev/null
+++ b/dev-lang/lua/lua-5.2.3.ebuild
@@ -0,0 +1,117 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils autotools multilib portability toolchain-funcs versionator
+
+DESCRIPTION="A powerful light-weight programming language designed for extending applications"
+HOMEPAGE="http://www.lua.org/"
+SRC_URI="http://www.lua.org/ftp/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="5.2"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~arm-linux ~x86-linux"
+IUSE="+deprecated emacs readline static"
+
+RDEPEND="readline? ( sys-libs/readline:0= )
+ app-eselect/eselect-lua
+ !dev-lang/lua:0"
+DEPEND="${RDEPEND}
+ sys-devel/libtool"
+PDEPEND="emacs? ( app-emacs/lua-mode )"
+
+src_prepare() {
+ local PATCH_PV=$(get_version_component_range 1-2)
+
+ epatch "${FILESDIR}"/${PN}-${PATCH_PV}-make-r1.patch
+
+ [ -d "${FILESDIR}/${PV}" ] && \
+ EPATCH_SOURCE="${FILESDIR}/${PV}" EPATCH_SUFFIX="upstream.patch" epatch
+
+ sed -i \
+ -e 's:\(define LUA_ROOT\s*\).*:\1"'${EPREFIX}'/usr/":' \
+ -e "s:\(define LUA_CDIR\s*LUA_ROOT \"\)lib:\1$(get_libdir):" \
+ src/luaconf.h \
+ || die "failed patching luaconf.h"
+
+ # correct lua versioning
+ sed -i -e 's/\(LIB_VERSION = \)6:1:1/\10:0:0/' src/Makefile
+
+ sed -i -e 's:\(/README\)\("\):\1.gz\2:g' doc/readme.html
+
+ if ! use readline ; then
+ sed -i -e '/#define LUA_USE_READLINE/d' src/luaconf.h
+ fi
+
+ # Using dynamic linked lua is not recommended for performance
+ # reasons. http://article.gmane.org/gmane.comp.lang.lua.general/18519
+ # Mainly, this is of concern if your arch is poor with GPRs, like x86
+ # Note that this only affects the interpreter binary (named lua), not the lua
+ # compiler (built statically) nor the lua libraries (both shared and static
+ # are installed)
+ if use static ; then
+ sed -i -e 's:\(-export-dynamic\):-static \1:' src/Makefile
+ fi
+
+ # upstream does not use libtool, but we do (see bug #336167)
+ cp "${FILESDIR}/configure.in" "${S}"
+ eautoreconf
+}
+
+src_compile() {
+ tc-export CC
+
+ # what to link to liblua
+ liblibs="-lm"
+ liblibs="${liblibs} $(dlopen_lib)"
+
+ # what to link to the executables
+ mylibs=
+ use readline && mylibs="-lreadline"
+
+ cd src
+
+ local myCFLAGS=""
+ use deprecated && myCFLAGS="-DLUA_COMPAT_ALL"
+
+ case "${CHOST}" in
+ *-mingw*) : ;;
+ *) myCFLAGS+=" -DLUA_USE_LINUX" ;;
+ esac
+
+ emake CC="${CC}" CFLAGS="${myCFLAGS} ${CFLAGS}" \
+ SYSLDFLAGS="${LDFLAGS}" \
+ RPATH="${EPREFIX}/usr/$(get_libdir)/" \
+ LUA_LIBS="${mylibs}" \
+ LIB_LIBS="${liblibs}" \
+ V=$(get_version_component_range 1-2) \
+ gentoo_all || die "emake failed"
+}
+
+src_install() {
+ emake INSTALL_TOP="${ED}/usr" INSTALL_LIB="${ED}/usr/$(get_libdir)" \
+ V=${SLOT} gentoo_install \
+ || die "emake install gentoo_install failed"
+
+ dodoc README
+ dohtml doc/*.html doc/*.png doc/*.css doc/*.gif
+
+ newman doc/lua.1 lua${SLOT}.1
+ newman doc/luac.1 luac${SLOT}.1
+
+ # We want packages to find our things...
+ cp "${FILESDIR}/lua.pc" "${WORKDIR}"
+ sed -i \
+ -e "s:^V=.*:V= ${PATCH_PV}:" \
+ -e "s:^R=.*:R= ${PV}:" \
+ -e "s:/,lib,:/$(get_libdir):g" \
+ "${WORKDIR}/lua.pc"
+
+ insinto "/usr/$(get_libdir)/pkgconfig"
+ newins "${WORKDIR}/lua.pc" "lua${SLOT}.pc"
+}
+
+# Makefile contains a dummy target that doesn't do tests
+# but causes issues with slotted lua (bug #510360)
+src_test() { :; }
diff --git a/dev-lang/lua/lua-5.3.3-r1.ebuild b/dev-lang/lua/lua-5.3.3-r1.ebuild
new file mode 100644
index 000000000000..b40fa29353fb
--- /dev/null
+++ b/dev-lang/lua/lua-5.3.3-r1.ebuild
@@ -0,0 +1,143 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils autotools multilib multilib-minimal portability toolchain-funcs versionator
+
+DESCRIPTION="A powerful light-weight programming language designed for extending applications"
+HOMEPAGE="http://www.lua.org/"
+SRC_URI="http://www.lua.org/ftp/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="5.3"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="+deprecated emacs readline static"
+
+RDEPEND="readline? ( sys-libs/readline:0= )
+ app-eselect/eselect-lua
+ !dev-lang/lua:0"
+DEPEND="${RDEPEND}
+ sys-devel/libtool"
+PDEPEND="emacs? ( app-emacs/lua-mode )"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/lua${SLOT}/luaconf.h
+)
+
+src_prepare() {
+ local PATCH_PV=$(get_version_component_range 1-2)
+
+ epatch "${FILESDIR}"/${PN}-${PATCH_PV}-make-r1.patch
+
+ # use glibtool on Darwin (versus Apple libtool)
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ sed -i -e '/LIBTOOL = /s:/libtool:/glibtool:' \
+ Makefile src/Makefile || die
+ fi
+
+ [ -d "${FILESDIR}/${PV}" ] && \
+ EPATCH_SOURCE="${FILESDIR}/${PV}" EPATCH_SUFFIX="upstream.patch" epatch
+
+ # correct lua versioning
+ sed -i -e 's/\(LIB_VERSION = \)6:1:1/\10:0:0/' src/Makefile || die
+
+ sed -i -e 's:\(/README\)\("\):\1.gz\2:g' doc/readme.html || die
+
+ if ! use readline ; then
+ sed -i -e '/#define LUA_USE_READLINE/d' src/luaconf.h || die
+ fi
+
+ # Using dynamic linked lua is not recommended for performance
+ # reasons. http://article.gmane.org/gmane.comp.lang.lua.general/18519
+ # Mainly, this is of concern if your arch is poor with GPRs, like x86
+ # Note that this only affects the interpreter binary (named lua), not the lua
+ # compiler (built statically) nor the lua libraries (both shared and static
+ # are installed)
+ if use static ; then
+ sed -i -e 's:\(-export-dynamic\):-static \1:' src/Makefile || die
+ fi
+
+ # upstream does not use libtool, but we do (see bug #336167)
+ cp "${FILESDIR}/configure.in" "${S}/configure.ac" || die
+ eautoreconf
+
+ # custom Makefiles
+ multilib_copy_sources
+
+ # A slotted Lua uses different directories for headers & names for
+ # libraries, and pkgconfig should reflect that.
+ sed -r -i \
+ -e "/^Libs:/s,((-llua)($| )),\2${SLOT}\3," \
+ -e "/^Cflags:/s,((-I..includedir.)($| )),\2/lua${SLOT}\3," \
+ "${S}"/etc/lua.pc
+}
+
+multilib_src_configure() {
+ sed -i \
+ -e 's:\(define LUA_ROOT\s*\).*:\1"'${EPREFIX}'/usr/":' \
+ -e "s:\(define LUA_CDIR\s*LUA_ROOT \"\)lib:\1$(get_libdir):" \
+ src/luaconf.h \
+ || die "failed patching luaconf.h"
+
+ econf
+}
+
+multilib_src_compile() {
+ tc-export CC
+
+ # what to link to liblua
+ liblibs="-lm"
+ liblibs="${liblibs} $(dlopen_lib)"
+
+ # what to link to the executables
+ mylibs=
+ use readline && mylibs="-lreadline"
+
+ cd src
+
+ local myCFLAGS=""
+ use deprecated && myCFLAGS="-DLUA_COMPAT_ALL"
+
+ case "${CHOST}" in
+ *-mingw*) : ;;
+ *) myCFLAGS+=" -DLUA_USE_LINUX" ;;
+ esac
+
+ emake CC="${CC}" CFLAGS="${myCFLAGS} ${CFLAGS}" \
+ SYSLDFLAGS="${LDFLAGS}" \
+ RPATH="${EPREFIX}/usr/$(get_libdir)/" \
+ LUA_LIBS="${mylibs}" \
+ LIB_LIBS="${liblibs}" \
+ V=$(get_version_component_range 1-2) \
+ gentoo_all
+}
+
+multilib_src_install() {
+ emake INSTALL_TOP="${ED}/usr" INSTALL_LIB="${ED}/usr/$(get_libdir)" \
+ V=${SLOT} gentoo_install
+
+ # We want packages to find our things...
+ cp "${FILESDIR}/lua.pc" "${WORKDIR}"
+ sed -i \
+ -e "s:^prefix= :prefix= ${EPREFIX}:" \
+ -e "s:^V=.*:V= ${PATCH_PV}:" \
+ -e "s:^R=.*:R= ${PV}:" \
+ -e "s:/,lib,:/$(get_libdir):g" \
+ "${WORKDIR}/lua.pc"
+
+ insinto "/usr/$(get_libdir)/pkgconfig"
+ newins "${WORKDIR}/lua.pc" "lua${SLOT}.pc"
+}
+
+multilib_src_install_all() {
+ dodoc README
+ dohtml doc/*.html doc/*.png doc/*.css doc/*.gif
+
+ newman doc/lua.1 lua${SLOT}.1
+ newman doc/luac.1 luac${SLOT}.1
+}
+
+# Makefile contains a dummy target that doesn't do tests
+# but causes issues with slotted lua (bug #510360)
+src_test() { :; }
diff --git a/dev-lang/lua/lua-5.3.3.ebuild b/dev-lang/lua/lua-5.3.3.ebuild
new file mode 100644
index 000000000000..4a80bd757fcb
--- /dev/null
+++ b/dev-lang/lua/lua-5.3.3.ebuild
@@ -0,0 +1,136 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils autotools multilib multilib-minimal portability toolchain-funcs versionator
+
+DESCRIPTION="A powerful light-weight programming language designed for extending applications"
+HOMEPAGE="http://www.lua.org/"
+SRC_URI="http://www.lua.org/ftp/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="5.3"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="+deprecated emacs readline static"
+
+RDEPEND="readline? ( sys-libs/readline:0= )
+ app-eselect/eselect-lua
+ !dev-lang/lua:0"
+DEPEND="${RDEPEND}
+ sys-devel/libtool"
+PDEPEND="emacs? ( app-emacs/lua-mode )"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/lua${SLOT}/luaconf.h
+)
+
+src_prepare() {
+ local PATCH_PV=$(get_version_component_range 1-2)
+
+ epatch "${FILESDIR}"/${PN}-${PATCH_PV}-make-r1.patch
+
+ # use glibtool on Darwin (versus Apple libtool)
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ sed -i -e '/LIBTOOL = /s:/libtool:/glibtool:' \
+ Makefile src/Makefile || die
+ fi
+
+ [ -d "${FILESDIR}/${PV}" ] && \
+ EPATCH_SOURCE="${FILESDIR}/${PV}" EPATCH_SUFFIX="upstream.patch" epatch
+
+ # correct lua versioning
+ sed -i -e 's/\(LIB_VERSION = \)6:1:1/\10:0:0/' src/Makefile || die
+
+ sed -i -e 's:\(/README\)\("\):\1.gz\2:g' doc/readme.html || die
+
+ if ! use readline ; then
+ sed -i -e '/#define LUA_USE_READLINE/d' src/luaconf.h || die
+ fi
+
+ # Using dynamic linked lua is not recommended for performance
+ # reasons. http://article.gmane.org/gmane.comp.lang.lua.general/18519
+ # Mainly, this is of concern if your arch is poor with GPRs, like x86
+ # Note that this only affects the interpreter binary (named lua), not the lua
+ # compiler (built statically) nor the lua libraries (both shared and static
+ # are installed)
+ if use static ; then
+ sed -i -e 's:\(-export-dynamic\):-static \1:' src/Makefile || die
+ fi
+
+ # upstream does not use libtool, but we do (see bug #336167)
+ cp "${FILESDIR}/configure.in" "${S}/configure.ac" || die
+ eautoreconf
+
+ # custom Makefiles
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ sed -i \
+ -e 's:\(define LUA_ROOT\s*\).*:\1"'${EPREFIX}'/usr/":' \
+ -e "s:\(define LUA_CDIR\s*LUA_ROOT \"\)lib:\1$(get_libdir):" \
+ src/luaconf.h \
+ || die "failed patching luaconf.h"
+
+ econf
+}
+
+multilib_src_compile() {
+ tc-export CC
+
+ # what to link to liblua
+ liblibs="-lm"
+ liblibs="${liblibs} $(dlopen_lib)"
+
+ # what to link to the executables
+ mylibs=
+ use readline && mylibs="-lreadline"
+
+ cd src
+
+ local myCFLAGS=""
+ use deprecated && myCFLAGS="-DLUA_COMPAT_ALL"
+
+ case "${CHOST}" in
+ *-mingw*) : ;;
+ *) myCFLAGS+=" -DLUA_USE_LINUX" ;;
+ esac
+
+ emake CC="${CC}" CFLAGS="${myCFLAGS} ${CFLAGS}" \
+ SYSLDFLAGS="${LDFLAGS}" \
+ RPATH="${EPREFIX}/usr/$(get_libdir)/" \
+ LUA_LIBS="${mylibs}" \
+ LIB_LIBS="${liblibs}" \
+ V=$(get_version_component_range 1-2) \
+ gentoo_all
+}
+
+multilib_src_install() {
+ emake INSTALL_TOP="${ED}/usr" INSTALL_LIB="${ED}/usr/$(get_libdir)" \
+ V=${SLOT} gentoo_install
+
+ # We want packages to find our things...
+ cp "${FILESDIR}/lua.pc" "${WORKDIR}"
+ sed -i \
+ -e "s:^prefix= :prefix= ${EPREFIX}:" \
+ -e "s:^V=.*:V= ${PATCH_PV}:" \
+ -e "s:^R=.*:R= ${PV}:" \
+ -e "s:/,lib,:/$(get_libdir):g" \
+ "${WORKDIR}/lua.pc"
+
+ insinto "/usr/$(get_libdir)/pkgconfig"
+ newins "${WORKDIR}/lua.pc" "lua${SLOT}.pc"
+}
+
+multilib_src_install_all() {
+ dodoc README
+ dohtml doc/*.html doc/*.png doc/*.css doc/*.gif
+
+ newman doc/lua.1 lua${SLOT}.1
+ newman doc/luac.1 luac${SLOT}.1
+}
+
+# Makefile contains a dummy target that doesn't do tests
+# but causes issues with slotted lua (bug #510360)
+src_test() { :; }
diff --git a/dev-lang/lua/metadata.xml b/dev-lang/lua/metadata.xml
new file mode 100644
index 000000000000..0e7b568c3899
--- /dev/null
+++ b/dev-lang/lua/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="person">
+ <email>rafaelmartins@gentoo.org</email>
+ <name>Rafael G. Martins</name>
+</maintainer>
+<maintainer type="person">
+ <email>williamh@gentoo.org</email>
+ <name>William Hubbs</name>
+</maintainer>
+<use><flag name="deprecated">make deprecated data structures/routines available</flag></use>
+</pkgmetadata>