Stratus3D / asdf-lua

Lua plugin for asdf version manager. https://github.com/asdf-vm/asdf
MIT License
62 stars 12 forks source link

Support pkg-config #39

Open tyrro opened 2 months ago

tyrro commented 2 months ago

While installing the ruby-lua gem, I found out that the plugin doesn't support pkg-config. Other plugins such as asdf-ruby support pkg-config. Homebrew's Lua package supports it as well. Is it possible to include the support in this plugin?

In case you're interested in the error message due to the absence of pkg-config, I have included it here. Thank you for creating this plugin.

Error due to the absence of pkg-config ```sh Installing ruby-lua 0.6.0 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /Users/human/.asdf/installs/ruby/2.6.8/lib/ruby/gems/2.6.0/gems/ruby-lua-0.6.0/ext /Users/human/.asdf/installs/ruby/2.6.8/bin/ruby -I /Users/human/.asdf/installs/ruby/2.6.8/lib/ruby/2.6.0 -r ./siteconf20240706-11547-1pxuoc6.rb extconf.rb checking for lua-config... no checking for pkg-config... yes Package lua was not found in the pkg-config search path. Perhaps you should add the directory containing `lua.pc' to the PKG_CONFIG_PATH environment variable No package 'lua' found Package lua was not found in the pkg-config search path. Perhaps you should add the directory containing `lua.pc' to the PKG_CONFIG_PATH environment variable No package 'lua' found Package lua5.1 was not found in the pkg-config search path. Perhaps you should add the directory containing `lua5.1.pc' to the PKG_CONFIG_PATH environment variable No package 'lua5.1' found Package lua5.1 was not found in the pkg-config search path. Perhaps you should add the directory containing `lua5.1.pc' to the PKG_CONFIG_PATH environment variable No package 'lua5.1' found Package lua5.2 was not found in the pkg-config search path. Perhaps you should add the directory containing `lua5.2.pc' to the PKG_CONFIG_PATH environment variable No package 'lua5.2' found Package lua5.2 was not found in the pkg-config search path. Perhaps you should add the directory containing `lua5.2.pc' to the PKG_CONFIG_PATH environment variable No package 'lua5.2' found Package lua5.3 was not found in the pkg-config search path. Perhaps you should add the directory containing `lua5.3.pc' to the PKG_CONFIG_PATH environment variable No package 'lua5.3' found Package lua5.3 was not found in the pkg-config search path. Perhaps you should add the directory containing `lua5.3.pc' to the PKG_CONFIG_PATH environment variable No package 'lua5.3' found checking for lua.h... no *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-lua50-dir --without-lua50-dir --with-lua50-include --without-lua50-include=${lua50-dir}/include --with-lua50-lib --without-lua50-lib=${lua50-dir}/lib --with-lua-dir --without-lua-dir --with-lua-include --without-lua-include=${lua-dir}/include --with-lua-lib --without-lua-lib=${lua-dir}/lib --with-lua51-dir --without-lua51-dir --with-lua51-include --without-lua51-include=${lua51-dir}/include --with-lua51-lib --without-lua51-lib=${lua51-dir}/lib --with-lua52-dir --without-lua52-dir --with-lua52-include --without-lua52-include=${lua52-dir}/include --with-lua52-lib --without-lua52-lib=${lua52-dir}/lib --with-lua53-dir --without-lua53-dir --with-lua53-include --without-lua53-include=${lua53-dir}/include --with-lua53-lib --without-lua53-lib=${lua53-dir}/lib extconf failure: need liblua50 (headers not found) Install the library or try one of the following options to extconf.rb: --with-lua-lib=/path/to/liblua/lib --with-lua-include=/path/to/liblua/include or --with-lua50-lib=/path/to/liblua/lib --with-lua50-include=/path/to/liblua/include To see why this extension failed to compile, please check the mkmf.log which can be found here: /Users/human/.asdf/installs/ruby/2.6.8/lib/ruby/gems/2.6.0/extensions/arm64-darwin-23/2.6.0/ruby-lua-0.6.0/mkmf.log extconf failed, exit code 1 ```
Stratus3D commented 2 months ago

Hi @tyrro ! I'm not familiar with pkg-config, can you provide a rough example of how I'd add support to asdf-lua, and how it'd be used once support is added? Happy to add it if I can.

Also, PR is welcome if you want to try implementing support for it!