summaryrefslogtreecommitdiff
path: root/dev-lang/lua
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-01-25 11:50:47 +0000
committerV3n3RiX <venerix@redcorelinux.org>2020-01-25 11:50:47 +0000
commitd42200bec37eef2a7478d88988ff00addd0a9202 (patch)
tree10394660b3cbe4b50173c06950b31302cd25d0d1 /dev-lang/lua
parent580f05ea8f512d11e23e8da80177d27835cbdbbc (diff)
gentoo resync : 25.01.2020
Diffstat (limited to 'dev-lang/lua')
-rw-r--r--dev-lang/lua/Manifest7
-rw-r--r--dev-lang/lua/files/lua-5.1.5-disable-deprecated.patch59
-rw-r--r--dev-lang/lua/files/lua-5.1.5-gentoo-build.patch118
-rw-r--r--dev-lang/lua/files/lua-5.1.5-readline.patch17
-rw-r--r--dev-lang/lua/lua-5.1.5-r103.ebuild145
-rw-r--r--dev-lang/lua/lua-5.1.5-r5.ebuild113
-rw-r--r--dev-lang/lua/lua-5.2.4-r2.ebuild194
-rw-r--r--dev-lang/lua/lua-5.3.5-r2.ebuild194
8 files changed, 847 insertions, 0 deletions
diff --git a/dev-lang/lua/Manifest b/dev-lang/lua/Manifest
index 38764ddd7d59..fdaf0a329661 100644
--- a/dev-lang/lua/Manifest
+++ b/dev-lang/lua/Manifest
@@ -17,7 +17,10 @@ AUX lua-5.1-module_paths.patch 1078 BLAKE2B c8c6def6f3099f61cc750657df1609a0a26b
AUX lua-5.1-readline.patch 360 BLAKE2B b528a3566aa59fb1cccb22417b01e86ee0cd3b77a3e278a20d5b476949daf47f0a656c7493a137594f1cf3136d327530ac97833cf584956b35b6a88a808535b9 SHA512 a99154258419dc2e582804eae97517687e5b8b5f731dc91722193d1ff470b8522af6ff4e7142c9258afe4734cd52e6987d3c2108ac52b1487a262f1e89f2f332
AUX lua-5.1.4-deprecated.patch 1417 BLAKE2B 993dd3169ebeaf8abbf5bf34e39f85b5d429c49bb534cbb0351c217705f36d7048d847241e05b3181c0cf0d4e54d449351b27947cea45b7bb880f4f62d8ebaeb SHA512 5b82058ece2cde2a720f9cdae727be0a68895438f90e24f2e37adb1cd79cf637ce20bb283918e44f4f561aa87a9b4f19d3305d71537671f61438962d48970f39
AUX lua-5.1.4-test.patch 340 BLAKE2B fb1e93293d60d85e6ba6ef1d07c34d329a1db4368e7e1e7307822cabf3082c802a5d7c3449caaf0e71759d09b6e41d4b8a04220b54dbb980991a10d0d64c77b6 SHA512 720135cc9d4c224717c2718b5709b43a1d66340fbdc3826037db672ef92014b6145f50263198d7641525194e6f9f9fdf16b78bdc6fb832dd7d13a89f06af67d9
+AUX lua-5.1.5-disable-deprecated.patch 1823 BLAKE2B 82d9e7c12d98606b29960182d8e069704683e136e06f422d6109a3c2ade165bc12e151d9e1c7933c65be3b441f1363db4f054866c0c7a894e9282a82b01a435d SHA512 1dc8f8a789bc8374137adce70c6614afe383255b5a2e59e36fdddf5a8fb9c7458b42e7b4483f09635d0ec38f8ed7925f8d1f12ce0fe0fdf0373a8e59b6f84322
AUX lua-5.1.5-fix_vararg_calls.patch 470 BLAKE2B fa5863445dbca630dbe00fd03a09f752dc27d0106cb7a5cc8bddf51dc9bd01ae843ad29219ed2ba29dd3088b933bcbf91fc87d5c58a972f4bac99fe112f05aff SHA512 630e8537bd80771fecc4c8216ec96e243654bd0b7bd006b6867baca4effab90bab4a922951661d4fc3ac2700c3bd7c0c40227b9eeee7dd5a87c07a6382055b04
+AUX lua-5.1.5-gentoo-build.patch 3108 BLAKE2B fae72673638387311749949840ce3df6f56763af6f5027c9f71c2262abdf3ed1cc2fe49fccb3ceef110584ac5034b1dceef03c773b68c12558b30c33ea6a10d4 SHA512 85165a0cae5f951d53741a7a07bc291bf16a4e575d82262b744ba177dfee54a91acc37000e17299f4f6a13acf8b611aac618e257b45e4f65012a9cf632ab4ab7
+AUX lua-5.1.5-readline.patch 638 BLAKE2B 9f15fc99ae7abaa6b99ed0e1daf45bc6c8d2980159e3f721d3ec415108c0b612091822c56177804a333dc0abe038229d5adcd8982e50712dcee4b493d8ff04e1 SHA512 0167466adde2827455587001c02ab1cedd3845b6646cd3ce58f85d808157c0d9320106a8055319c338640b4494152e0b494fe92943070d4cdbdfcc1cfd44c82e
AUX lua-5.2-make-r1.patch 2442 BLAKE2B 7f281a96b602b992099869648cc7229312578890644e9241f249c7335e04dd70573df6673a2baf19a7d985bc0c30d0821af4cb830bbed55cf7d2a8f83037add2 SHA512 e51b6fd7c77906a918f3987379e134d7423cc9683efdf6cdd2992b187ab0fed99732523b0f2819816a8789e4ed176c6f62774237f036e09e0c9d56582e0c3be0
AUX lua-5.3-make-r1.patch 2854 BLAKE2B d60d1656a5f411b218b4f1f861f150759e6331ffadf28fde50cf219cbe01b5f1e6be4a3872b3c27a9ed561e80f91983e024124ca5c5871c6c63252cf0ac1c11d SHA512 80c2930bbd204551545cdd6793ec8dcd7d753fffc29710786b3662dde13b1af3a9825c95118e23bc98149f316f12f008223b675df929a244ef29c8a2a773560a
AUX lua.pc 658 BLAKE2B 580504c8162c9cbde35b4a817c688b955cad1a35b1c21ed527488eda6e7cf78dfa81fa8b100737cf9ad620d34d94eceec01ba09e4fab0b121c5e4c673677cd3f SHA512 cb476ea6dd004a9aa0094cfc219d1888c5f578b44968a960acf1f2f32783a8e4d770bb033fb1ab4851f225188bbdd434b5d239718cae2c2c35f5b5f124a722ca
@@ -31,16 +34,20 @@ DIST lua-5.3.5.tar.gz 303543 BLAKE2B 8890fa70fcfb869296bc74c754dc30621a3786d4b38
EBUILD lua-5.1.5-r100.ebuild 3734 BLAKE2B ded64ec91b07eed80ea425e1a6dcb71a3f89f1bad5698f71e6db04090bbb6ade8cc37ac9adf4d31011e71719a28f215f9a54c6c6e142b8064e9449bed8acbb2f SHA512 3d43c51fdf791a825b4e38dc9ac1632971b97b474556cabb2a3d418ded939e1497a3b8c11cac0240149d4964d7199c40cf0e26b87a5cde2a8123ba5c87ce7372
EBUILD lua-5.1.5-r101.ebuild 3995 BLAKE2B 605130d313f4a07d425ba50b751e03960bcff5271a112c795a10f500776ca98dd7dbb5ad24c4ccc1d93d5341583dec97e45e8fe4e9475b7cb3a92ccde882f105 SHA512 097760baea6eab1c2de9cec35be5c229dc31df8488e2f67499488930be458e02f0992a08e5b8b3c669908146133dda42a3108ae2829a73c888913a40409c1e0f
EBUILD lua-5.1.5-r102.ebuild 3995 BLAKE2B df7d3f828e39e793885f1a093fa760864c55aaff42cabe7c8fb8b28cbd2de064c09cb9570cd3cc5c1d6d0d5a71698f45fac9fef05b3d40c418416665a5966cb2 SHA512 b663a7e0394aea6ac45a0657f123e41199d8078506b8cc1f02930f780bfac7c957a5912b2064417a660c2a134ea4051e4db6484412addf5ec9b09bfc9a649280
+EBUILD lua-5.1.5-r103.ebuild 4048 BLAKE2B ea54e0bbae2d2990cd5fd5a1eee8c6c0ed712a5e1bc8e9b9f00ad5bd1503c25106bb81cf3ca148c38a473c50c0d5b0e2bda455d0c32f6d80c11987b83bf1ca1c SHA512 1354a215d230af63032b475ccc3fa00f1d5d6f81f1e98bcfc8e5178c532ff628816503bfb9635e68212edea828ac82adcc9027cde512d5e8b735c1d7f08a1119
EBUILD lua-5.1.5-r4.ebuild 3628 BLAKE2B 60ba36135eadff3b9933a3ae9db84e75225860d6a320255d9214037d4d9bde2cabfa8bc3ab94f33c823cf2da8e12767edcea26958dabd8ddd67864b0ca9eb2a1 SHA512 1016a8b52ccfb553a7c3bb2c2abb995ef8df0a6a03ee15aa2819a12908213988c8d28aa1e13725eb746ad95bd149062d09e6df6e1b3584e701ce946ec6daba17
+EBUILD lua-5.1.5-r5.ebuild 3185 BLAKE2B 7736220189af143cbeaa248edc3c6b927490a317ce9be73c87c9c0d47fc43147f238c0eb0a7f6175394a8e0b56e75f0890d0d6ca9be6190df9aede91b4a1149d SHA512 062fd0b3c34581c78279753ca50f8e88cce4339bb76025411cfed80a13db6a2e4b1d8b55d47bed041d3b92fb7c9ae31774b3e37b4a7c64cf8d7db897d3c2d4af
EBUILD lua-5.2.3-r1.ebuild 3757 BLAKE2B f4e8e0c040421db6b212289be1781ea4291c9a468b35f0398307596b14ef3d2d9e65f3df5db466da9c29537d71fa6ca5937e86a2e5c16109f2bab7054c9784e8 SHA512 f2ef9c741bd74c5f0d88845b15c94f604f4c3253a16fc9d4fc819d3f25f6cb46a3bae465bf99b559f498c23eed06143b9747f9800b91f6f68fd5ea9dc661e684
EBUILD lua-5.2.3-r2.ebuild 4018 BLAKE2B bc094822587e7607bf81c3214da9b1eef8d2eb466ba81523dc5088b0c08b4dea67743822223156ec22e9d70ca658e8133de8e15f26094478997addccbcf3c774 SHA512 28c7644f7cec9dcc912bd1f14be0e89929242a7746e7f4ab75fb305b4bdb7355cf6e3235ee5d96a1257a79ef369395e600dec506d19d960567f5fd7a0c6ba109
EBUILD lua-5.2.3-r3.ebuild 4018 BLAKE2B 5cd8714a0c6387f00b038f542ab8368facec9475a05b6e53b81f079db3e599dd55b394435fb26ff3d72cac32a9a45459bd4a4631e38415a83c3f757547e21628 SHA512 a80f15e84a00197c87195fab15063f734612e995826b59bfdf656eeab70fd3b89ea8553d276134301f78c8c344f9bd35a8ae299966eaed18f875307163d40a1d
EBUILD lua-5.2.3.ebuild 3173 BLAKE2B 16e2fbb99a6b2c4a4f59351aab457aecfe219d45fded839956ae7121fb723259040626219c26cedb84778535f5b6d82f02fa8020cc242f4cdc31874eecde260e SHA512 15e82292b3b76aa58033548f0f49f778643d7ec2d0b22b30ef9aeb633c8b36e7fc6d4eefac95291f1b324354fc935f9aca0754c332b75fcc5120415fa433ce00
EBUILD lua-5.2.4-r1.ebuild 5766 BLAKE2B 5a97ccab82df592f84449202547298afa36293482e7fbcfd654b58c12ecdd7fd248a18e6b4e2d616a74b148ce9657558585c5e4067c7fcfd9ab46b071a4be1c2 SHA512 e95748a60f8254f7bf2db3bb4ac4d7b096d0f48102862857b643bb2fec3e18524c3162bfa20609a6b4210882c0a8e8f13bfab87edb57288bd1f659c327e3ac9f
+EBUILD lua-5.2.4-r2.ebuild 5819 BLAKE2B 2a7d8906e87ee6b71081938148f61edd56c51f6fdc46852dabc47fe79cc887fe8d6663484f4593b2bbcf4427cc338e1839d015ac34df6497b5aa8d06049d5532 SHA512 f63741a23b79a4dd542c3cdf138d92239ed7e98517db2b98d0262c07c9c9b37deb1c7baee621241e53ea7c833bace34b215f3ad0044712cabe4230ddbf7218a0
EBUILD lua-5.2.4.ebuild 5245 BLAKE2B 59e535668459e64d4124fc631e76ad42e577ca457188d1a34d53fa0dc7e53429f30488f6da07f1821a9f9136042679772221af849efc511a036d6bc8d7d50045 SHA512 6c80a2af0f847d070fea48c4dc907dcdb04abc3d27fee9f36cf954c13169400e2c6a985f1da4da14596ccf0fdc3979ef5a8b68f9dc8d785f537bd0ca71f6fc9c
EBUILD lua-5.3.3-r1.ebuild 4030 BLAKE2B 5f269701d580cb55915514e3443c53e3d8c225549ce2cca2d93d17b49d716af3eed4f9812898250dfbec3e6b77241e98d2a4f8ebfaa90a03ac0d9319c7c0f95a SHA512 cc5dc832884b3a84612dc46e339a9d634a363cd8a7e003daf61edfda9e64d99fef9906d3cd809abd9fe33b816a0c3510a1d43e83ffcdc2cf142a797961fdbf02
EBUILD lua-5.3.3-r2.ebuild 4030 BLAKE2B 0052a221f158347b006bb57b24c41f138a28da18d43ae42d641bea072cdad8d7bf45d3d25c0017b94a12d33362505244bc8ff06cdfeab67203b86161231ba736 SHA512 427ea47bc7b91579af1b4e9407bac5ed948992b7191856c0f76718a84dffa2290d22f073035720fcb3b877a583a521c99d1ad68f2acc4237d077bb150f58485d
EBUILD lua-5.3.3.ebuild 3769 BLAKE2B 2aa484858b240d3b6d3a4054e23e97693dc3f4598e2d6a9c8de18dcfc5f8c4301f10e5e5cf811c6658c18dacd9a181a6315915c22bb426091da3d2ddc841678d SHA512 708a65843b6fdb1192c4ee16e6e322d54c2c7fe1eae7fed3009bb9a1c2f81d09418888024aa17f43303bdce50e1d99e0cbd889dc3e781ec9a18e5075d7e90bbe
EBUILD lua-5.3.5-r1.ebuild 5766 BLAKE2B 0bc3f2fecf2f60d0f5b6ff735d72463a7451c0f1944019ee4d4e13a1a8594a440044c5e677979a2388e0d6a41095c806107d2725896d1e5d649b95f09c8fc60c SHA512 3d2e2438a638751aad6b015d5afb68c5a06aa995fc3dd09b29c4a5ca1916f6e5fda69afff3d559c26cc3744b7f9057cdd76df1ba22a7eabb0b19fc1a760b312e
+EBUILD lua-5.3.5-r2.ebuild 5819 BLAKE2B 6edf2a0906f720e6a538b0dc59b1b9d044f1b6fd4ba83d802e75fbb697504e0c839fcdf622aed56adbadc9e0a3bf5f3ddc2a2911b43f9f5a8dd8dc942f857032 SHA512 cdceeffca0047e6a5e8c709186ef1810c88e5b991fefafd2a1a52f37fa66db0bd12bf6a81afbf0fffadd4ff1b826c8373c43a172c7f3e41bd0fc4e077c29e96f
EBUILD lua-5.3.5.ebuild 5257 BLAKE2B 1ebffbe512ed4eb31f79c48b744bc5ea323a42fd8a9eb7b96bfb934d54c065758f6f6da87c7cc161804f6105b01c1988c0fb29c4c0da0367ef78a95cba4d4c08 SHA512 30b93526f3b62478b306936665de93468fe236e7785f2b75c52d9c0222fe4dc32706e2e475bff5abad4f9c6f413942644d6662adeb1d21a4a251a1ca8de55a4c
MISC metadata.xml 524 BLAKE2B 688341a9dfa433bbc2e3fc1edb8a44d53dcee036afeb5b2c7c8fbfa0f81d1e53a6c7910b32bec637ad1cd518e48afdd0806a286dadbb6c7a88853a93aa7f3545 SHA512 92ee6e13c3fcc5ba1d2cf3ec58a54b051f1fae8646b64fae25923108a78abc77b05992abbed5a04afbc2043ea0b47749544e348506ab554d57b19bcf3b435e52
diff --git a/dev-lang/lua/files/lua-5.1.5-disable-deprecated.patch b/dev-lang/lua/files/lua-5.1.5-disable-deprecated.patch
new file mode 100644
index 000000000000..d1d7fb10115f
--- /dev/null
+++ b/dev-lang/lua/files/lua-5.1.5-disable-deprecated.patch
@@ -0,0 +1,59 @@
+diff -rdu old/src/luaconf.h new/src/luaconf.h
+--- old/src/luaconf.h 2008-02-12 17:00:03.000000000 +0000
++++ new/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 -rdu old/test/sieve.lua new/test/sieve.lua
+Rename deprecated functions in test scripts
+--- old/test/sieve.lua~ 2002-10-31 03:52:58.000000000 +0100
++++ new/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-gentoo-build.patch b/dev-lang/lua/files/lua-5.1.5-gentoo-build.patch
new file mode 100644
index 000000000000..62c4ed33648d
--- /dev/null
+++ b/dev-lang/lua/files/lua-5.1.5-gentoo-build.patch
@@ -0,0 +1,118 @@
+--- old/Makefile 2012-02-10 10:50:23.000000000 +0100
++++ new/Makefile 2019-07-12 12:00:30.807725876 +0200
+@@ -22,7 +22,8 @@
+
+ # How to install. If your install program does not support "-p", then you
+ # may have to run ranlib on the installed liblua.a (do "make ranlib").
+-INSTALL= install -p
++INSTALL?= install -p
++INSTALL_LINK= ln -s
+ INSTALL_EXEC= $(INSTALL) -m 0755
+ INSTALL_DATA= $(INSTALL) -m 0644
+ #
+@@ -33,7 +34,7 @@
+
+ # Utilities.
+ MKDIR= mkdir -p
+-RANLIB= ranlib
++RANLIB?= ranlib
+
+ # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
+
+@@ -47,13 +48,17 @@
+ TO_MAN= lua.1 luac.1
+
+ # Lua version and release.
++M= 5
+ V= 5.1
+ R= 5.1.5
+
++# Export to sub-make
++export M R
++
+ all: $(PLAT)
+
+ $(PLATS) clean:
+- cd src && $(MAKE) $@
++ cd src && $(MKDIR) .libs && $(MAKE) $@
+
+ test: dummy
+ src/lua test/hello.lua
+@@ -61,6 +66,8 @@
+ install: dummy
+ cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
+ cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
++ cd src && $(INSTALL_EXEC) $(TO_LIB:.a=.so.$(R)) $(INSTALL_LIB)
++ cd src && $(INSTALL_LINK) $(TO_LIB:.a=.so.$(R)) $(INSTALL_LIB)/$(TO_LIB:.a=.so.$(M))
+ cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
+ cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
+ cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
+--- old/src/Makefile 2012-02-13 21:41:22.000000000 +0100
++++ new/src/Makefile 2019-07-12 11:31:02.945290602 +0200
+@@ -7,12 +7,14 @@
+ # Your platform. See PLATS for possible values.
+ PLAT= none
+
+-CC= gcc
+-CFLAGS= -O2 -Wall $(MYCFLAGS)
+-AR= ar rcu
+-RANLIB= ranlib
++CC?= gcc
++CFLAGS?= -O2 -Wall $(MYCFLAGS)
++SOFLAGS= -shared -fPIC -DPIC -Wl,-O1 -Wl,--as-needed -Wl,-soname -Wl,$(LUA_A:.a=.so.$(M)) $(MYLDFLAGS)
++AR?= ar
++ARFLAGS?= rcu
++RANLIB?= ranlib
+ RM= rm -f
+-LIBS= -lm $(MYLIBS)
++LIBS?= -lm $(MYLIBS)
+
+ MYCFLAGS=
+ MYLDFLAGS=
+@@ -35,8 +37,11 @@
+ LUAC_T= luac
+ LUAC_O= luac.o print.o
+
+-ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O)
+-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
++LUAS_T= $(LUA_A:.a=.so.$(R))
++LUAS_O= $(addprefix .libs/,$(CORE_O) $(LIB_O) $(LUA_O))
++
++ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O) $(LUAS_O)
++ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUAS_T)
+ ALL_A= $(LUA_A)
+
+ default: $(PLAT)
+@@ -48,9 +53,12 @@
+ a: $(ALL_A)
+
+ $(LUA_A): $(CORE_O) $(LIB_O)
+- $(AR) $@ $(CORE_O) $(LIB_O) # DLL needs all object files
++ $(AR) $(ARFLAGS) $@ $(CORE_O) $(LIB_O) # DLL needs all object files
+ $(RANLIB) $@
+
++$(LUAS_T): $(LUAS_O)
++ $(CC) -o $@ $(SOFLAGS) $(LUAS_O) $(LIBS)
++
+ $(LUA_T): $(LUA_O) $(LUA_A)
+ $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
+
+@@ -67,7 +75,7 @@
+ @echo "PLAT = $(PLAT)"
+ @echo "CC = $(CC)"
+ @echo "CFLAGS = $(CFLAGS)"
+- @echo "AR = $(AR)"
++ @echo "AR = $(AR) $(ARFLAGS)"
+ @echo "RANLIB = $(RANLIB)"
+ @echo "RM = $(RM)"
+ @echo "MYCFLAGS = $(MYCFLAGS)"
+@@ -120,6 +128,9 @@
+
+ # DO NOT DELETE
+
++.libs/%o: %c
++ $(CC) $(CFLAGS) -fPIC -DPIC -c -o $@ $<
++
+ lapi.o: lapi.c lua.h luaconf.h lapi.h lobject.h llimits.h ldebug.h \
+ lstate.h ltm.h lzio.h lmem.h ldo.h lfunc.h lgc.h lstring.h ltable.h \
+ lundump.h lvm.h
diff --git a/dev-lang/lua/files/lua-5.1.5-readline.patch b/dev-lang/lua/files/lua-5.1.5-readline.patch
new file mode 100644
index 000000000000..2b5221a8ab48
--- /dev/null
+++ b/dev-lang/lua/files/lua-5.1.5-readline.patch
@@ -0,0 +1,17 @@
+--- old/src/luaconf.h 2006-04-10 20:27:23.000000000 +0200
++++ new/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)
+--- old/src/Makefile 2012-02-13 21:41:22.000000000 +0100
++++ old/src/Makefile 2019-07-09 09:53:00.000000000 +0100
+@@ -98,3 +98,3 @@
+ linux:
+- $(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
++ $(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl"
+
diff --git a/dev-lang/lua/lua-5.1.5-r103.ebuild b/dev-lang/lua/lua-5.1.5-r103.ebuild
new file mode 100644
index 000000000000..c8f27b3b2b5e
--- /dev/null
+++ b/dev-lang/lua/lua-5.1.5-r103.ebuild
@@ -0,0 +1,145 @@
+# Copyright 1999-2019 Gentoo Authors
+# 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-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
+
+ # A slotted Lua uses different directories for headers & names for
+ # libraries, and pkgconfig should reflect that.
+ sed -r -i \
+ -e "/^INSTALL_INC=/s,(/include)$,\1/lua${SLOT}," \
+ -e "/^Libs:/s,((-llua)($| )),\2${SLOT}\3," \
+ -e "/^Cflags:/s,((-I..includedir.)($| )),\2/lua${SLOT}\3," \
+ "${S}"/etc/lua.pc
+
+ # 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-r5.ebuild b/dev-lang/lua/lua-5.1.5-r5.ebuild
new file mode 100644
index 000000000000..f6bb7d48bff9
--- /dev/null
+++ b/dev-lang/lua/lua-5.1.5-r5.ebuild
@@ -0,0 +1,113 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils multilib multilib-minimal portability toolchain-funcs versionator flag-o-matic
+
+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-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="+deprecated emacs readline doc"
+
+RDEPEND="readline? ( >=sys-libs/readline-6.2_p5-r1:0=[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}"
+PDEPEND="emacs? ( app-emacs/lua-mode )"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/luaconf.h
+)
+
+src_prepare() {
+ # Correct documentation link
+ sed -i -e 's:\(/README\)\("\):\1.gz\2:g' doc/readme.html || die
+
+ # 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.
+
+ # Therefore both lua interpreter and compiler are statically linked to
+ # the core library modules.
+
+ # Note: This patch only adds the required targets to the makefiles
+ # instead of relying upon libtool, which fails cross-compiling. Both
+ # shared and static versions of lua libraries are installed.
+ epatch "${FILESDIR}"/${P}-gentoo-build.patch
+
+ # Rename deprecated functions in scripts
+ use deprecated || epatch "${FILESDIR}"/${P}-disable-deprecated.patch
+
+ # Remove readline dependency if not requested
+ use readline || epatch "${FILESDIR}"/${P}-disable-readline.patch
+
+ epatch "${FILESDIR}/${P}-fix_vararg_calls.patch"
+
+ # Required by EAPI >= 6
+ eapply_user
+
+ # Add documentation URIs if needed
+ use doc && \
+ HTML_DOCS=( doc/*.{html,css,png,gif} ) && \
+ DOCS="HISTORY README"
+
+ # custom Makefiles
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ # Fix directories according to FHS/Gentoo policy paths and ABI
+ sed -i \
+ -e 's:/usr/local:'${EPREFIX}'/usr:' \
+ -e 's:/man/:/share/man/:' \
+ -e "s:\([/\"]\)\<lib\>:\1$(get_libdir):g" \
+ Makefile etc/lua.pc src/luaconf.h doc/manual.html || die
+}
+
+multilib_src_compile() {
+ append-cflags "-DLUA_USE_LINUX"
+ append-ldflags "-Wl,-E"
+ tc-export AR CC CPP LD RANLIB
+ emake \
+ MYLDFLAGS="${LDFLAGS}" \
+ MYCFLAGS="${CFLAGS}" \
+ linux
+}
+
+multilib_src_install() {
+ emake -j1 install INSTALL_TOP="${ED}/usr"
+
+ insinto usr/$(get_libdir)/pkgconfig
+ doins etc/lua.pc
+}
+
+multilib_src_install_all() {
+ einstalldocs -r
+
+ doicon etc/lua.ico
+
+ doman doc/lua.1 doc/luac.1
+}
+
+multilib_src_test() {
+ # These tests MUST succeed for the ebuild to succeed
+ local MUST_SUCCEED="bisect cf echo env factorial fib fibfor hello printf sieve
+ sort trace-calls trace-globals"
+
+ # These tests MUST fail for the ebuild to succeed
+ local MUST_FAIL="readonly"
+
+ cd "${BUILD_DIR}" || die
+
+ local test
+ for test in ${MUST_SUCCEED}; do
+ src/lua test/${test}.lua || die "test $test failed"
+ done
+
+ for test in ${MUST_FAIL}; do
+ src/lua test/${test}.lua && die "test $test failed"
+ done
+}
diff --git a/dev-lang/lua/lua-5.2.4-r2.ebuild b/dev-lang/lua/lua-5.2.4-r2.ebuild
new file mode 100644
index 000000000000..b6eeb0be94de
--- /dev/null
+++ b/dev-lang/lua/lua-5.2.4-r2.ebuild
@@ -0,0 +1,194 @@
+# Copyright 1999-2019 Gentoo Authors
+# 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/"
+TEST_PV="5.2.2" # no 5.2.3-specific release yet
+TEST_A="${PN}-${TEST_PV}-tests.tar.gz"
+PKG_A="${P}.tar.gz"
+SRC_URI="
+ http://www.lua.org/ftp/${PKG_A}
+ test? ( https://www.lua.org/tests/${TEST_A} )"
+
+LICENSE="MIT"
+SLOT="5.2"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="+deprecated emacs readline static test test-complete"
+RESTRICT="!test? ( test )"
+
+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
+
+ case $SLOT in
+ 0)
+ LIBNAME="lua"
+ INCLUDEDIR_SUFFIX=''
+ ;;
+ *) LIBNAME="lua${SLOT}"
+ INCLUDEDIR_SUFFIX="/lua${SLOT}"
+ ;;
+ esac
+
+ # We want packages to find our things...
+ # A slotted Lua uses different directories for headers & names for
+ # libraries, and pkgconfig should reflect that.
+ local PATCH_PV=$(get_version_component_range 1-2)
+ cp "${FILESDIR}/lua.pc" "${WORKDIR}" || die
+ sed -r -i \
+ -e "/^INSTALL_INC=/s,(/include)$,\1/lua${SLOT}," \
+ -e "s:^prefix= :prefix= ${EPREFIX}:" \
+ -e "s:^V=.*:V= ${PATCH_PV}:" \
+ -e "s:^R=.*:R= ${PV}:" \
+ -e "s:/,lib,:/$(get_libdir):g" \
+ -e "/^Libs:/s:( )(-llua)($| ):\1-l${LIBNAME}\3:" \
+ -e "/^includedir=/s:include$:include${INCLUDEDIR_SUFFIX}:" \
+ "${WORKDIR}/lua.pc" || die
+
+ insinto "/usr/$(get_libdir)/pkgconfig"
+ newins "${WORKDIR}/lua.pc" "lua${SLOT}.pc"
+ # Copy Debian's symlink support:
+ # https://salsa.debian.org/lua-team/lua5.3/blob/master/debian/rules#L19
+ # FreeBSD calls the pkgconfig 'lua-5.3.pc'
+ # Older systems called it 'lua53.pc'
+ dosym "lua${SLOT}.pc" "/usr/$(get_libdir)/pkgconfig/lua-${SLOT}.pc"
+ dosym "lua${SLOT}.pc" "/usr/$(get_libdir)/pkgconfig/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() {
+ debug-print-function ${FUNCNAME} "$@"
+ cd "${WORKDIR}/lua-${TEST_PV}-tests" || die
+ # https://www.lua.org/tests/
+ # There are two sets:
+ # basic
+ # complete.
+ #
+ # The basic subset is selected by passing -e'_U=true'
+ # The complete set is noted to contain tests that may consume too much memory or have non-portable tests.
+ # attrib.lua for example needs some multilib customization (have to compile the stuff in libs/ for each ABI)
+ use test-complete || TEST_OPTS="-e_U=true"
+ TEST_MARKER="${T}/test.failed"
+ rm -f "${TEST_MARKER}"
+
+ # If we are failing, set the marker file, and only check it after done all ABIs
+ abi_src_test() {
+ debug-print-function ${FUNCNAME} "$@"
+ TEST_LOG="${T}/test.${MULTIBUILD_ID}.log"
+ eval "${BUILD_DIR}"/src/lua${SLOT} ${TEST_OPTS} all.lua 2>&1 | tee "${TEST_LOG}" || die
+ grep -sq -e "final OK" "${TEST_LOG}" || echo "FAIL ${MULTIBUILD_ID}" >>"${TEST_MARKER}"
+ return 0
+ }
+
+ multilib_foreach_abi abi_src_test
+
+ if [ -e "${TEST_MARKER}" ]; then
+ cat "${TEST_MARKER}"
+ die "Tests failed"
+ fi
+}
diff --git a/dev-lang/lua/lua-5.3.5-r2.ebuild b/dev-lang/lua/lua-5.3.5-r2.ebuild
new file mode 100644
index 000000000000..d67a457d16da
--- /dev/null
+++ b/dev-lang/lua/lua-5.3.5-r2.ebuild
@@ -0,0 +1,194 @@
+# Copyright 1999-2019 Gentoo Authors
+# 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/"
+TEST_PV="5.3.4" # no 5.3.5-specific release yet
+TEST_A="${PN}-${TEST_PV}-tests.tar.gz"
+PKG_A="${P}.tar.gz"
+SRC_URI="
+ http://www.lua.org/ftp/${PKG_A}
+ test? ( https://www.lua.org/tests/${TEST_A} )"
+
+LICENSE="MIT"
+SLOT="5.3"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="+deprecated emacs readline static test test-complete"
+RESTRICT="!test? ( test )"
+
+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
+
+ case $SLOT in
+ 0)
+ LIBNAME="lua"
+ INCLUDEDIR_SUFFIX=''
+ ;;
+ *) LIBNAME="lua${SLOT}"
+ INCLUDEDIR_SUFFIX="/lua${SLOT}"
+ ;;
+ esac
+
+ # We want packages to find our things...
+ # A slotted Lua uses different directories for headers & names for
+ # libraries, and pkgconfig should reflect that.
+ local PATCH_PV=$(get_version_component_range 1-2)
+ cp "${FILESDIR}/lua.pc" "${WORKDIR}" || die
+ sed -r -i \
+ -e "/^INSTALL_INC=/s,(/include)$,\1/lua${SLOT}," \
+ -e "s:^prefix= :prefix= ${EPREFIX}:" \
+ -e "s:^V=.*:V= ${PATCH_PV}:" \
+ -e "s:^R=.*:R= ${PV}:" \
+ -e "s:/,lib,:/$(get_libdir):g" \
+ -e "/^Libs:/s:( )(-llua)($| ):\1-l${LIBNAME}\3:" \
+ -e "/^includedir=/s:include$:include${INCLUDEDIR_SUFFIX}:" \
+ "${WORKDIR}/lua.pc" || die
+
+ insinto "/usr/$(get_libdir)/pkgconfig"
+ newins "${WORKDIR}/lua.pc" "lua${SLOT}.pc"
+ # Copy Debian's symlink support:
+ # https://salsa.debian.org/lua-team/lua5.3/blob/master/debian/rules#L19
+ # FreeBSD calls the pkgconfig 'lua-5.3.pc'
+ # Older systems called it 'lua53.pc'
+ dosym "lua${SLOT}.pc" "/usr/$(get_libdir)/pkgconfig/lua-${SLOT}.pc"
+ dosym "lua${SLOT}.pc" "/usr/$(get_libdir)/pkgconfig/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() {
+ debug-print-function ${FUNCNAME} "$@"
+ cd "${WORKDIR}/lua-${TEST_PV}-tests" || die
+ # https://www.lua.org/tests/
+ # There are two sets:
+ # basic
+ # complete.
+ #
+ # The basic subset is selected by passing -e'_U=true'
+ # The complete set is noted to contain tests that may consume too much memory or have non-portable tests.
+ # attrib.lua for example needs some multilib customization (have to compile the stuff in libs/ for each ABI)
+ use test-complete || TEST_OPTS="-e_U=true"
+ TEST_MARKER="${T}/test.failed"
+ rm -f "${TEST_MARKER}"
+
+ # If we are failing, set the marker file, and only check it after done all ABIs
+ abi_src_test() {
+ debug-print-function ${FUNCNAME} "$@"
+ TEST_LOG="${T}/test.${MULTIBUILD_ID}.log"
+ eval "${BUILD_DIR}"/src/lua${SLOT} ${TEST_OPTS} all.lua 2>&1 | tee "${TEST_LOG}" || die
+ grep -sq -e "final OK" "${TEST_LOG}" || echo "FAIL ${MULTIBUILD_ID}" >>"${TEST_MARKER}"
+ return 0
+ }
+
+ multilib_foreach_abi abi_src_test
+
+ if [ -e "${TEST_MARKER}" ]; then
+ cat "${TEST_MARKER}"
+ die "Tests failed"
+ fi
+}