q66 / cffi-lua

A portable C FFI for Lua 5.1+
MIT License
176 stars 24 forks source link

Create a meson subproject wrap file for libffi #34

Closed clitic closed 1 year ago

clitic commented 1 year ago

I was compiling libffi on windows and I wasn't able to compile it. After searching through some issues and pull requests I found out that there is a PR which adds meson build support to libffi. You may consider it adding to cffi-lua.

subprojects/libffi.wrap

I think this is more stable.

[wrap-git]
url = https://gitlab.freedesktop.org/gstreamer/meson-ports/libffi.git
revision = meson
depth = 1

[provide]
ffi = ffi_dep

Or add gitlab rebased version with latest libffi.

[wrap-git]
url = https://github.com/xclaesse/libffi.git
revision = meson-port
depth = 1

[provide]
ffi = ffi_dep

https://github.com/q66/cffi-lua/blob/master/meson.build#L78-L85

ffi_dep = subproject('libffi').get_variable('ffi_dep')
q66 commented 1 year ago

you can look at the CI scripts for how libffi is compiled on windows

if i add a wrap thing i'll wait for how the upstream PR turns out

xclaesse commented 1 year ago

ffi_dep = subproject('libffi').get_variable('ffi_dep')

If you add libffi.wrap, ffi_dep = dependency('libffi') will automatically fallback to the subproject in case it's not found with pkg-config. No need to call subproject().

xclaesse commented 1 year ago

if i add a wrap thing i'll wait for how the upstream PR turns out

Review and feedback is welcome on the PR. It is currently blocked on getting a review and approval from a maintainer.