From: "Florian Schmaus" <flow@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/proj/guru:master commit in: dev-util/lua-language-server/files/, dev-util/lua-language-server/
Date: Wed, 4 Jan 2023 08:51:19 +0000 (UTC) [thread overview]
Message-ID: <1672614407.08285c8c5a479dce78ca70dfac51828aee4c59e9.flow@gentoo> (raw)
commit: 08285c8c5a479dce78ca70dfac51828aee4c59e9
Author: Mathis Winterer <mrmagic223325 <AT> fedora <DOT> email>
AuthorDate: Sun Jan 1 23:06:47 2023 +0000
Commit: Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Sun Jan 1 23:06:47 2023 +0000
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=08285c8c
dev-util/lua-language-server: Stop prestripping binaries, Remove direct calls to gcc, patch build scripts to respect CFLAGS/CXXFLAGS/LDFLAGS
Closes: https://bugs.gentoo.org/889302
Closes: https://bugs.gentoo.org/889308
Closes: https://bugs.gentoo.org/889306
Closes: https://bugs.gentoo.org/889304
Signed-off-by: Mathis Winterer <mrmagic223325 <AT> fedora.email>
.../lua-language-server/files/build.ninja.patch | 142 +++++++++++++++++++++
.../lua-language-server/files/linux.ninja.patch | 94 ++++++++++++++
.../lua-language-server-3.6.4.ebuild | 35 ++++-
3 files changed, 269 insertions(+), 2 deletions(-)
diff --git a/dev-util/lua-language-server/files/build.ninja.patch b/dev-util/lua-language-server/files/build.ninja.patch
new file mode 100644
index 000000000..49111813b
--- /dev/null
+++ b/dev-util/lua-language-server/files/build.ninja.patch
@@ -0,0 +1,142 @@
+--- a/build/build.ninja 2023-01-01 23:53:30.813718024 +0100
++++ b/build/build.ninja 2023-01-01 23:04:59.011627739 +0100
+@@ -2,7 +2,7 @@
+ builddir = build
+ bin = bin
+ obj = $builddir/obj
+-cc = x86_64-pc-linux-gnu-gcc
++cc = REPLACE_ME
+ luamake = $
+ /var/tmp/portage/dev-util/lua-language-server-3.6.4/work/3rd/luamake/luamake
+ rule configure
+@@ -13,17 +13,17 @@
+ 3rd/bee.lua/compile/config.lua 3rd/bee.lua/compile/common.lua $
+ make/code_format.lua
+ rule c_source_bee
+- command = $cc -MMD -MT $out -MF $out.d -std=c11 -O2 -Wall -Werror $
+- -fvisibility=hidden -I3rd/bee.lua/3rd/lua-seri -I$builddir/lua54 $
+- -DNDEBUG -fPIC -o $out -c $in
++ command = $cc -MMD -MT $out -MF $out.d -std=c11 $
++ -I3rd/bee.lua/3rd/lua-seri -I$builddir/lua54 $
++ -DNDEBUG -o $out -c $in CFLAGS
+ description = Compile C $out
+ deps = gcc
+ depfile = $out.d
+ build $obj/source_bee/lua-seri.obj: c_source_bee $
+ 3rd/bee.lua/3rd/lua-seri/lua-seri.c
+ rule cxx_source_bee
+- command = $cc -MMD -MT $out -MF $out.d -std=c++17 -O2 -Wall -Werror $
+- -fvisibility=hidden -I3rd/bee.lua/bee/nonstd -DNDEBUG -fPIC -o $out -c $in
++ command = $cc -MMD -MT $out -MF $out.d -std=c++17 $
++ -I3rd/bee.lua/bee/nonstd -DNDEBUG -o $out -c $in CXXFLAGS
+ description = Compile C++ $out
+ deps = gcc
+ depfile = $out.d
+@@ -31,8 +31,8 @@
+ 3rd/bee.lua/bee/nonstd/fmt/format.cc
+ build $obj/source_bee/os.obj: cxx_source_bee 3rd/bee.lua/bee/nonstd/fmt/os.cc
+ rule cxx_source_bee_1
+- command = $cc -MMD -MT $out -MF $out.d -std=c++17 -O2 -Wall -Werror $
+- -fvisibility=hidden -I3rd/bee.lua -DNDEBUG -fPIC -o $out -c $in
++ command = $cc -MMD -MT $out -MF $out.d -std=c++17 $
++ -I3rd/bee.lua -DNDEBUG -o $out -c $in CXXFLAGS
+ description = Compile C++ $out
+ deps = gcc
+ depfile = $out.d
+@@ -56,9 +56,9 @@
+ build $obj/source_bee/path_helper.obj: cxx_source_bee_1 $
+ 3rd/bee.lua/bee/utility/path_helper.cpp
+ rule cxx_source_bee_2
+- command = $cc -MMD -MT $out -MF $out.d -std=c++17 -O2 -Wall -Werror $
+- -fvisibility=hidden -I3rd/bee.lua/3rd/lua-seri -I3rd/bee.lua $
+- -I$builddir/lua54 -DBEE_STATIC -DNDEBUG -fPIC -o $out -c $in
++ command = $cc -MMD -MT $out -MF $out.d -std=c++17 $
++ -I3rd/bee.lua/3rd/lua-seri -I3rd/bee.lua $
++ -I$builddir/lua54 -DBEE_STATIC -DNDEBUG -o $out -c $in CXXFLAGS
+ description = Compile C++ $out
+ deps = gcc
+ depfile = $out.d
+@@ -79,26 +79,26 @@
+ build $obj/source_bee/lua_time.obj: cxx_source_bee_2 $
+ 3rd/bee.lua/binding/lua_time.cpp
+ rule c_source_lua
+- command = $cc -MMD -MT $out -MF $out.d -std=c11 -O2 -Wall -Werror $
+- -fvisibility=hidden -DNDEBUG -fPIC -o $out -c $in
++ command = $cc -MMD -MT $out -MF $out.d -std=c11 $
++ -DNDEBUG -o $out -c $in CFLAGS
+ description = Compile C $out
+ deps = gcc
+ depfile = $out.d
+ build $obj/source_lua/utf8_crt.obj: c_source_lua $
+ 3rd/bee.lua/3rd/lua/utf8_crt.c
+ rule c_source_lua_1
+- command = $cc -MMD -MT $out -MF $out.d -std=c11 -O2 -Wall -Werror $
+- -DMAKE_LIB -DLUA_USE_LINUX -DNDEBUG -fPIC -Wno-maybe-uninitialized -o $
+- $out -c $in
++ command = $cc -MMD -MT $out -MF $out.d -std=c11 $
++ -DMAKE_LIB -DLUA_USE_LINUX -DNDEBUG -o $
++ $out -c $in CFLAGS
+ description = Compile C $out
+ deps = gcc
+ depfile = $out.d
+ build $obj/source_lua/linit.obj: c_source_lua_1 3rd/bee.lua/3rd/lua/linit.c
+ build $obj/source_lua/onelua.obj: c_source_lua_1 3rd/bee.lua/3rd/lua/onelua.c
+ rule cxx_source_bootstrap
+- command = $cc -MMD -MT $out -MF $out.d -std=c++17 -O2 -Wall -Werror $
+- -fvisibility=hidden -I3rd/bee.lua/3rd/lua -I3rd/bee.lua -DLUA_USE_LINUX $
+- -DNDEBUG -fPIC -o $out -c $in
++ command = $cc -MMD -MT $out -MF $out.d -std=c++17 $
++ -I3rd/bee.lua/3rd/lua -I3rd/bee.lua -DLUA_USE_LINUX $
++ -DNDEBUG -o $out -c $in CXXFLAGS
+ description = Compile C++ $out
+ deps = gcc
+ depfile = $out.d
+@@ -108,7 +108,7 @@
+ 3rd/bee.lua/bootstrap/progdir.cpp
+ rule link_bootstrap
+ command = $cc $in -o $out -lm -ldl -Wl,-E -lstdc++fs -pthread $
+- -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic -static-libgcc -s
++ -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic -static-libgcc LDFLAGS
+ description = Link Exe $out
+ build /bootstrap: link_bootstrap $obj/source_bootstrap/main.obj $
+ $obj/source_bootstrap/progdir.obj $obj/source_bee/lua-seri.obj $
+@@ -146,10 +146,10 @@
+ 3rd/bee.lua/test/test_thread.lua 3rd/bee.lua/test/test_time.lua | $
+ /bootstrap copy_script
+ rule cxx_code_format
+- command = $cc -MMD -MT $out -MF $out.d -std=c++17 -O2 -Wall $
+- -fvisibility=hidden -I3rd/EmmyLuaCodeStyle/include $
++ command = $cc -MMD -MT $out -MF $out.d -std=c++17 $
++ -I3rd/EmmyLuaCodeStyle/include $
+ -I3rd/bee.lua/3rd/lua -I3rd/EmmyLuaCodeStyle/3rd/wildcards/include $
+- -DNDEBUG -march=native -O2 -pipe -o $out -c $in
++ -DNDEBUG -o $out -c $in CXXFLAGS
+ description = Compile C++ $out
+ deps = gcc
+ depfile = $out.d
+@@ -274,9 +274,9 @@
+ build $obj/code_format/Utf8.obj: cxx_code_format $
+ 3rd/EmmyLuaCodeStyle/Util/src/Utf8.cpp
+ rule c_lpeglabel
+- command = $cc -MMD -MT $out -MF $out.d -std=c11 -O2 -Wall $
+- -fvisibility=hidden -I3rd/bee.lua/3rd/lua -DMAXRECLEVEL=1000 -DNDEBUG $
+- -o $out -c $in
++ command = $cc -MMD -MT $out -MF $out.d -std=c11 $
++ -I3rd/bee.lua/3rd/lua -DMAXRECLEVEL=1000 -DNDEBUG $
++ -o $out -c $in CFLAGS
+ description = Compile C $out
+ deps = gcc
+ depfile = $out.d
+@@ -286,9 +286,9 @@
+ build $obj/lpeglabel/lpltree.obj: c_lpeglabel 3rd/lpeglabel/lpltree.c
+ build $obj/lpeglabel/lplvm.obj: c_lpeglabel 3rd/lpeglabel/lplvm.c
+ rule cxx_lua_language_server
+- command = $cc -MMD -MT $out -MF $out.d -std=c++17 -O2 -Wall $
+- -fvisibility=hidden -I3rd/bee.lua -I3rd/bee.lua/3rd/lua -DCODE_FORMAT $
+- -DNDEBUG -o $out -c $in
++ command = $cc -MMD -MT $out -MF $out.d -std=c++17 $
++ -I3rd/bee.lua -I3rd/bee.lua/3rd/lua -DCODE_FORMAT $
++ -DNDEBUG -o $out -c $in CXXFLAGS
+ description = Compile C++ $out
+ deps = gcc
+ depfile = $out.d
diff --git a/dev-util/lua-language-server/files/linux.ninja.patch b/dev-util/lua-language-server/files/linux.ninja.patch
new file mode 100644
index 000000000..a9a853ed7
--- /dev/null
+++ b/dev-util/lua-language-server/files/linux.ninja.patch
@@ -0,0 +1,94 @@
+--- a/3rd/luamake/compile/ninja/linux.ninja 2022-11-29 13:53:05.000000000 +0100
++++ b/3rd/luamake/compile/ninja/linux.ninja 2023-01-01 22:40:43.690777107 +0100
+@@ -2,20 +2,20 @@
+ builddir = build/linux
+ bin = $builddir/bin
+ obj = $builddir/obj
+-cc = gcc
++cc = REPLACE_ME
+ luamake = luamake
+ rule c_source_bee
+- command = $cc -MMD -MT $out -MF $out.d -O2 -Wall -Werror $
+- -fvisibility=hidden -I3rd/bee.lua/3rd/lua-seri -Itools/lua54 -DNDEBUG $
+- -fPIC -o $out -c $in
++ command = $cc -MMD -MT $out -MF $out.d $
++ -I3rd/bee.lua/3rd/lua-seri -Itools/lua54 -DNDEBUG $
++ -o $out -c $in CFLAGS
+ description = Compile C $out
+ deps = gcc
+ depfile = $out.d
+ build $obj/source_bee/lua-seri.obj: c_source_bee $
+ 3rd/bee.lua/3rd/lua-seri/lua-seri.c
+ rule cxx_source_bee
+- command = $cc -MMD -MT $out -MF $out.d -std=c++17 -O2 -Wall -Werror $
+- -fvisibility=hidden -I3rd/bee.lua/bee/nonstd -DNDEBUG -fPIC -o $out -c $in
++ command = $cc -MMD -MT $out -MF $out.d -std=c++17 $
++ -I3rd/bee.lua/bee/nonstd -DNDEBUG -o $out -c $in CXXFLAGS
+ description = Compile C++ $out
+ deps = gcc
+ depfile = $out.d
+@@ -23,8 +23,8 @@
+ 3rd/bee.lua/bee/nonstd/fmt/format.cc
+ build $obj/source_bee/os.obj: cxx_source_bee 3rd/bee.lua/bee/nonstd/fmt/os.cc
+ rule cxx_source_bee_1
+- command = $cc -MMD -MT $out -MF $out.d -std=c++17 -O2 -Wall -Werror $
+- -fvisibility=hidden -I3rd/bee.lua -DNDEBUG -fPIC -o $out -c $in
++ command = $cc -MMD -MT $out -MF $out.d -std=c++17 $
++ -I3rd/bee.lua -DNDEBUG -o $out -c $in CXXFLAGS
+ description = Compile C++ $out
+ deps = gcc
+ depfile = $out.d
+@@ -48,9 +48,9 @@
+ build $obj/source_bee/path_helper.obj: cxx_source_bee_1 $
+ 3rd/bee.lua/bee/utility/path_helper.cpp
+ rule cxx_source_bee_2
+- command = $cc -MMD -MT $out -MF $out.d -std=c++17 -O2 -Wall -Werror $
+- -fvisibility=hidden -I3rd/bee.lua/3rd/lua-seri -I3rd/bee.lua $
+- -Itools/lua54 -DBEE_STATIC -DNDEBUG -fPIC -o $out -c $in
++ command = $cc -MMD -MT $out -MF $out.d -std=c++17 $
++ -I3rd/bee.lua/3rd/lua-seri -I3rd/bee.lua $
++ -Itools/lua54 -DBEE_STATIC -DNDEBUG -o $out -c $in CXXFLAGS
+ description = Compile C++ $out
+ deps = gcc
+ depfile = $out.d
+@@ -71,24 +71,24 @@
+ build $obj/source_bee/lua_time.obj: cxx_source_bee_2 $
+ 3rd/bee.lua/binding/lua_time.cpp
+ rule c_source_lua
+- command = $cc -MMD -MT $out -MF $out.d -O2 -Wall -Werror $
+- -fvisibility=hidden -DNDEBUG -fPIC -o $out -c $in
++ command = $cc -MMD -MT $out -MF $out.d $
++ -DNDEBUG -o $out -c $in CFLAGS
+ description = Compile C $out
+ deps = gcc
+ depfile = $out.d
+ build $obj/source_lua/utf8_crt.obj: c_source_lua $
+ 3rd/bee.lua/3rd/lua/utf8_crt.c
+ rule c_source_lua_1
+- command = $cc -MMD -MT $out -MF $out.d -O2 -Wall -Werror -DMAKE_LIB $
+- -DLUA_USE_LINUX -DNDEBUG -fPIC -Wno-maybe-uninitialized -o $out -c $in
++ command = $cc -MMD -MT $out -MF $out.d -DMAKE_LIB $
++ -DLUA_USE_LINUX -DNDEBUG -o $out -c $in CFLAGS
+ description = Compile C $out
+ deps = gcc
+ depfile = $out.d
+ build $obj/source_lua/onelua.obj: c_source_lua_1 3rd/bee.lua/3rd/lua/onelua.c
+ rule cxx_source_bootstrap
+- command = $cc -MMD -MT $out -MF $out.d -std=c++17 -O2 -Wall -Werror $
+- -fvisibility=hidden -I3rd/bee.lua/3rd/lua -I3rd/bee.lua -DLUA_USE_LINUX $
+- -DNDEBUG -fPIC -o $out -c $in
++ command = $cc -MMD -MT $out -MF $out.d -std=c++17 $
++ -I3rd/bee.lua/3rd/lua -I3rd/bee.lua -DLUA_USE_LINUX $
++ -DNDEBUG -o $out -c $in CXXFLAGS
+ description = Compile C++ $out
+ deps = gcc
+ depfile = $out.d
+@@ -98,7 +98,7 @@
+ 3rd/bee.lua/bootstrap/progdir.cpp
+ rule link_luamake
+ command = $cc $in -o $out -lm -ldl -Wl,-E -lstdc++fs -pthread $
+- -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic -static-libgcc -s
++ -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic -static-libgcc LDFLAGS
+ description = Link Exe $out
+ build $bin/luamake: link_luamake $obj/source_bootstrap/main.obj $
+ $obj/source_bootstrap/progdir.obj $obj/source_bee/lua-seri.obj $
diff --git a/dev-util/lua-language-server/lua-language-server-3.6.4.ebuild b/dev-util/lua-language-server/lua-language-server-3.6.4.ebuild
index bd99b8d38..f0cf3d9c3 100644
--- a/dev-util/lua-language-server/lua-language-server-3.6.4.ebuild
+++ b/dev-util/lua-language-server/lua-language-server-3.6.4.ebuild
@@ -3,7 +3,7 @@
EAPI=8
-inherit ninja-utils
+inherit ninja-utils toolchain-funcs
DESCRIPTION="Lua language server"
HOMEPAGE="https://github.com/sumneko/lua-language-server"
@@ -18,14 +18,45 @@ BDPEND="
${NINJA_DEPEND}
app-arch/unzip
dev-util/ninja
- sys-devel/gcc
"
RESTRICT="!test? ( test )"
+PATCHES=( "${FILESDIR}/linux.ninja.patch" )
+
+src_prepare() {
+ # Remove hardcoded gcc references
+ sed -i "/lm.cxx/a lm.cc = '$(tc-getCC)'" \
+ make.lua || die
+ sed -i "s/CC = gcc/ CC = ${tc-getCC}/" \
+ 3rd/lpeglabel/makefile || die
+ sed -i "s/flags = \"-Wall -Werror\"/flags =\"${CXXFLAGS}\"/" \
+ make/code_format.lua || die
+ # Patch
+ default
+ # Shipped file doesn't respect CFLAGS/CXXFLAGS
+ sed -i -e "s/^cc = REPLACE_ME/cc = $(tc-getCC)/" \
+ -e "s/CFLAGS/${CFLAGS}/" \
+ -e "s/CXXFLAGS/${CXXFLAGS}/" \
+ -e "s/LDFLAGS/${LDFLAGS}/" \
+ 3rd/luamake/compile/ninja/linux.ninja || die
+}
src_compile() {
eninja -C 3rd/luamake -f compile/ninja/linux.ninja "$(usex test "test" "luamake")"
use test && eninja -C 3rd/luamake -f compile/ninja/linux.ninja luamake
./3rd/luamake/luamake init || die
+
+ eapply "${FILESDIR}/build.ninja.patch"
+
+ sed -i "s/^cc = gcc/cc = $(tc-getCC)/" \
+ build/build.ninja || die
+
+ # Generated file doesn't respect CFLAGS/CXXFLAGS
+ sed -i -e "s/^cc = REPLACE_ME/cc = $(tc-getCC)/" \
+ -e "s/CFLAGS/${CFLAGS}/" \
+ -e "s/CXXFLAGS/${CXXFLAGS}/" \
+ -e "s/LDFLAGS/${LDFLAGS}/" \
+ build/build.ninja || die
+
# Tests are broken
eninja -f build/build.ninja all
}
next reply other threads:[~2023-01-04 8:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-04 8:51 Florian Schmaus [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-01-04 8:51 [gentoo-commits] repo/proj/guru:master commit in: dev-util/lua-language-server/files/, dev-util/lua-language-server/ Florian Schmaus
2023-03-14 6:00 Viorel Munteanu
2023-03-29 6:56 Florian Schmaus
2023-04-28 17:52 Arthur Zamarin
2024-08-20 20:46 David Roman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1672614407.08285c8c5a479dce78ca70dfac51828aee4c59e9.flow@gentoo \
--to=flow@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox