romgrk / fzy-lua-native

Luajit FFI bindings to FZY
118 stars 16 forks source link

FreeBSD support #21

Closed gicmo closed 2 weeks ago

gicmo commented 1 year ago

Manually compiling the binary with GNU Make works:

 gmake
echo amd64
amd64
cc  -Ofast -c -Wall -static -fpic -o ./src/match.o ./src/match.c
cc  -shared -o ./static/libfzy-freebsd-amd64.so ./src/match.o

Which results in a libfzy-freebsd-amd64.so but the plugin is looking for a libfzy-bsd-x86_64.so, resulting in an error:

Error detected while processing /usr/home/gicmo/.homesick/repos/files/nvim/init.lua:
E5113: Error while calling lua chunk: .../start/telescope.nvim/lua/telescope/_extensions/init.lua:10: 'fzy_native' extension doesn't exist or isn't installed: ...scope-fzy-nat
ive.nvim/deps/fzy-lua-native/lua/native.lua:34: Cannot open "/usr/home/gicmo/.local/share/nvim/site/pack/packer/start/telescope-fzy-native.nvim/deps/fzy-lua-native/lua/../stat
ic/libfzy-bsd-x86_64.so"
stack traceback:
        [C]: in function 'error'
        .../start/telescope.nvim/lua/telescope/_extensions/init.lua:10: in function 'load_extension'
        .../start/telescope.nvim/lua/telescope/_extensions/init.lua:62: in function 'load_extension'
        /usr/home/gicmo/.homesick/repos/files/nvim/init.lua:153: in main chunk
uname -a 
FreeBSD hal.xatom.net 12.3-RELEASE-p6 FreeBSD 12.3-RELEASE-p6 GENERIC  amd64
LuaJIT 2.1.0-beta3 -- Copyright (C) 2005-2022 Mike Pall. https://luajit.org/
JIT: ON SSE3 SSE4.1 BMI2 fold cse dce fwd dse narrow loop abc sink fuse
> x = jit.os
> print(x)
BSD
romgrk commented 1 year ago

Can't test this so I don't feel confident enough to implement it, but if you want to adjust the configuration & open a PR here is the relevant section: https://github.com/romgrk/fzy-lua-native/blob/master/lua/native.lua#L10-L27