Closed carlocab closed 2 years ago
@ebmmy was kind enough to work on packaging Rizin for Homebrew. See Homebrew/homebrew-core#89709.
Amazing!! <3 Thanks a lot for this, it's much appreciated.
I will work through the rest of your report to find the best solution.
xxhash is found using Meson's dependency, which uses pkg-config. Unfortunately, pkg-config looks for an xxhash.pc, but a default xxhash build installs only libxxhash.pc. We worked around this by creating a symlink, but it would be nice if this were not needed.
Nice catch, I think indeed I should replace dependency('xxhash'..)
with dependency('libxxhash')
because also on Ubuntu, Fedora and Arch linux the file is called libxxhash.pc. I guess this was a mistake on my side and with this change the find_library fallback should not be needed.
That makes sense. Maybe a dependency('libmagic'...)
would work for our libmagic
issue too? We have a libmagic.pc
. Is there any reason libmagic
doesn't use the dependency
-with-fallback-to-find_library
pattern for the other dependencies?
libmagic is found via Meson's find_library. Unfortunately, find_library doesn't seem to know how to find Homebrew-installed libraries by default, so we worked around this by adding a dirs argument to the find_library call.
Same for this. We should probably just use dependency('libmagic'...
).
Is there any reason libmagic doesn't use the dependency-with-fallback-to-find_library pattern for the other dependencies?
From the top of my head I think I did it that way because I couldn't find the .pc files, but I could be wrong as well and I could have just missed those files. The safest approach is probably to use the dependency + find_library fallback approach for both libs.
I couldn't find the .pc files
libmagic
's .pc
file is also called libmagic.pc
, so that might also be why dependency('magic'...)
doesn't work.
@carlocab is it ok if we reference homebrew in our INSTALL section as a way to install Rizin on Mac after the formula will be mergd?
Of course; that's more than okay. :)
Thanks!
@carlocab the fix is now included in the 0.3.3 release: https://github.com/rizinorg/rizin/releases/tag/v0.3.3
Yep, I noticed. Thanks for the update!
Is your feature request related to a problem? Please describe. @ebmmy was kind enough to work on packaging Rizin for Homebrew. See Homebrew/homebrew-core#89709.
While trying to get the build to pass in Homebrew CI, we encountered issues in
meson
being able to find Homebrewxxhash
andlibmagic
.libmagic
is found via Meson'sfind_library
. Unfortunately,find_library
doesn't seem to know how to find Homebrew-installed libraries by default, so we worked around this by adding adirs
argument to thefind_library
call.xxhash
is found using Meson'sdependency
, which usespkg-config
. Unfortunately,pkg-config
looks for anxxhash.pc
, but a defaultxxhash
build installs onlylibxxhash.pc
. We worked around this by creating a symlink, but it would be nice if this were not needed.Describe the solution you'd like For
libmagic
, it might help if there were additional options inmeson_options.txt
that allow passing the path to the directory containinglibmagic
, which is then passed to thedirs
argument offind_library
. This would allow us to pass this as a flag tomeson
rather than modifying your build script (which can be a bit fragile).I'm not sure if a similar fix would work for
xxhash
, but sincemeson.build
seems to fall back tofind_library
whendependency
doesn't work, this might too.Describe alternatives you've considered We could keep carrying around our workarounds, but it would be nice if we didn't have to. Finding fixes here would also ensure that your users who encounter the same problems we did (outside of Homebrew) wouldn't have to discover our workarounds for themselves.
Additional context As mentioned above, this is related to Homebrew/homebrew-core#89709.