Closed wimstefan closed 2 years ago
Hi, lua-c++ pkgconfig module should be provided by Lua package, because it is Lua compiled with C++ instead of C compiler. This is necessary, because Lua error handling changes depending on used compiler: http://lua-users.org/wiki/ErrorHandlingBetweenLuaAndCplusplus
Unfortunately Gentoo dev-lang/lua package does not build C++ variant. It should be possible to improve Lua ebuild file to build both variants simultaneously, but I have zero experience with Gentoo.
You can build C++ Lua variant manually by running the following commands:
wget https://www.lua.org/ftp/lua-5.4.4.tar.gz
tar -xf lua-5.4.4.tar.gz
cd lua-5.4.4
make generic CC="g++"
make generic CC="g++" --silent pc > lua5.4-c++.pc
My Gentoo overlay repository with improved Lua package: thezbyg/gentoo-overlay You can use this overlay for now, but it would be much better to ask dev-lang/lua package maintainer to improve official package.
Thank you so much for your efforts!!! Sadly enough the ebuild from your overlay doesn't compile and I'm not so sure how to create the .pc file manually as you've described above. The result is quite minimal compared to lua5.4.pc:
diff /usr/local/lib/pkgconfig/lua5.4-c++.pc /usr/lib64/pkgconfig/lua5.4.pc ⊙
1,4c1,31
< version=5.4.4
< prefix=/usr/local
< libdir=/usr/local/lib
< includedir=/usr/local/include
---
> # lua.pc -- pkg-config data for Lua
>
> # vars from install Makefile
>
> # grep '^V=' ../Makefile
> V= 5.4
> # grep '^R=' ../Makefile
> R= 5.4.4
>
> # grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/'
> prefix= /usr
> INSTALL_BIN= ${prefix}/bin
> INSTALL_INC= ${prefix}/include/lua5.4
> INSTALL_LIB= ${prefix}/lib64
> INSTALL_MAN= ${prefix}/man/man1
> INSTALL_LMOD= ${prefix}/share/lua/${V}
> INSTALL_CMOD= ${prefix}/lib64/lua/${V}
>
> # canonical vars
> exec_prefix=${prefix}
> libdir=${exec_prefix}/lib64
> includedir=${prefix}/include/lua5.4
>
> Name: Lua
> Description: An Extensible Extension Language
> Version: ${R}
> Requires:
> Libs: -L${libdir} -llua5.4 -lm
> Cflags: -I${includedir}
>
> # (end of lua.pc)
Here is the logfile of the failing ebuild compilation: dev-lang:lua-5.4.4:20220529-093832.log
I have found and fixed some issues in ebuild. Please update and try again. Also check if the following files exist on your system:
/usr/lib64/crti.o
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/crtbeginS.o
If these files are missing then something may be wrong with your compiler installation.
C++ variant pkgconfig files are almost the same as C variant ones, and only have a single different line:
--- /usr/lib64/pkgconfig/lua54.pc 2022-05-30 16:00:20.864000000 -0000
+++ /usr/lib64/pkgconfig/lua54-c++.pc 2022-05-30 16:00:21.048000000 -0000
@@ -25,7 +25,7 @@
Description: An Extensible Extension Language
Version: ${R}
Requires:
-Libs: -L${libdir} -llua5.4 -lm
+Libs: -L${libdir} -llua5.4-c++ -lm
Cflags: -I${includedir}
# (end of lua.pc)
Thanks again for you efforts!
Despite having the files you mentioned above I can't get the ebuild working. It's bailing out complaining about exactly those files missing. Not sure what's going on here ...
dev-lang:lua-5.4.4:20220601-074925.log
Here some more info about the files and the gcc version:
9:51:14 [swimmer] ~ » locate crti.o
/usr/lib/crti.o
/usr/lib64/crti.o
9:51:24 [swimmer] ~ » locate crtbeginS.o
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.1/crtbeginS.o
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.1/32/crtbeginS.o
/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/crtbeginS.o
/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/32/crtbeginS.o
9:52:29 [swimmer] ~ » gcc-config -l
[1] x86_64-pc-linux-gnu-10.3.1
[2] x86_64-pc-linux-gnu-11.3.0 *
Found a very similar bug report: https://bugs.gentoo.org/88596
Libtool captures some environment information when it is built and fails once the compiler is updated. Rebuilding libtool should help, because from your attached log I can see that it is trying to use GCC 11.2.1, which is not available in your system.
Running emerge libtool
should fix this issue.
Oh that's a good find! Lua was compiling fine now. Still no dice with gpick though:
/usr/local/src/Tools/x11/gpick.git » mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=/usr/local
mkdir: created directory 'build'
-- The C compiler identification is GNU 11.3.0
-- The CXX compiler identification is GNU 11.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at cmake/Version.cmake:20 (list):
list index: 1 out of range (-1, 0)
Call Stack (most recent call first):
CMakeLists.txt:23 (include)
-- Found Boost: /usr/lib64/cmake/Boost-1.79.0/BoostConfig.cmake (found suitable version "1.79.0", minimum required is "1.58") found components: unit_test_framework
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.0")
-- Checking for module 'gtk+-3.0>=3.0'
-- Found gtk+-3.0, version 3.24.34
-- Checking for one of the modules 'lua5.4-c++>=5.4;lua5-c++>=5.4;lua5.3-c++>=5.3;lua5-c++>=5.3;lua-c++>=5.3;lua5.2-c++>=5.2;lua-c++>=5.2'
-- Checking for module 'expat>=1.0'
-- Found expat, version 2.4.8
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found Ragel: /usr/bin/ragel (found suitable version "7.0.4", minimum required is "6.9")
-- Configuring incomplete, errors occurred!
See also "/usr/local/src/Tools/x11/gpick.git/build/CMakeFiles/CMakeOutput.log".
Something wrong with version information returned from git describe command. Please run git describe "--match=gpick-*" "--match=v*" --always --long
in Gpick directory. Returned line should look similar to this:
v0.3-20-g997df3b
If it does not look like that, then annotated tags are most probably missing in your cloned git repository. This happens when using shallow clone and can be fixed by running git fetch --depth=100
command to download last 100 commits and their associated tags.
Now we're talking!
I'm always cloning repositories by habit with --depth 1
not realizing it might have this kind of impact ;)
Thanks for your patience and help all the way until everything works 👍🙏
You're welcome. I'm glad I was able to help.
That's the error that I'm getting when I try to run
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local
I'm on a Gentoo ~amd64 system with lua & luajit installed.
Not sure what's providing this lua c++ module. I was reading the info in the lua users wiki but I don't see which of those modules/bindings I should install ...