lgi-devs / lgi

Dynamic Lua binding to GObject libraries using GObject-Introspection
MIT License
440 stars 70 forks source link

Export functions to append to the gi paths #309

Closed dagle closed 1 year ago

dagle commented 1 year ago

A user might want to load gi objects not loaded global to the system. This exposes g_irepository_prepend_search_path and g_irepository_prepend_library_path which makes it easier to deal with local libraries.

ntd commented 1 year ago

I think this can be easily accomplished by directly using GIRepository, e.g.:

local lgi = require 'lgi'
lgi.GIRepository.Repository.prepend_library_path('/prepend/library/path')
lgi.GIRepository.Repository.add_search_path('/add/search/path')
psychon commented 1 year ago

Thanks! I am convinced. @dagle Do you see anything wrong with this?

dagle commented 1 year ago

Seems correct. I missed the fact that lgi exposes the gi functions. Haven't tested it yet but I'm fairly certain that it will work.