Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

with-bdb build args not quite working for building with macports #1909

Closed
trodemaster opened this issue Jan 23, 2025 · 10 comments · Fixed by #1911
Closed

with-bdb build args not quite working for building with macports #1909

trodemaster opened this issue Jan 23, 2025 · 10 comments · Fixed by #1911
Assignees

Comments

@trodemaster
Copy link

Describe the bug
With #1908 landing in 4.1.1 I have made a new attempt to get netatalk 4 to build correctly with the MacPorts packaging system for macOS. However, when building with the new arguments, meson is finding the include dir headers but not the libraries. It seems like either the file name patterns need to be expanded in the meson.build file or I'm getting the path specifications wrong somehow.

To Reproduce
Use macports to attempt to build netatalk 4.1.1. Not sure repro is realistic. I'm just looking for advice on the how the meson config file works.

Expected behavior
When building on macos with macports and using the following meson config options the needed headers and libraries are found.

-Dwith-bdb-include-path=${prefix}/include/db48 \
 -Dwith-bdb-path=${prefix}/lib/db48/lib \

Environment

  • Server OS: macOS 15.2 24C101 arm64
  • Client OS: Mac OS 9.2.2 PPC
  • Netatalk Version 4.1.1

Logs
Error from the meson build

Message: Berkeley DB header found at /opt/local/include/db48/db.h
Library db-4.8 found: NO
Library db4.8 found: NO
Library db48 found: NO
Library db-4 found: NO
Library db4 found: NO
Library db found: NO

meson.build:588:4: ERROR: Problem encountered: Berkeley DB library required but not found! Please specify an installation path using the -Dwith-bdb-path= configure option (must include lib and include dirs)

Additional context
Details about macports..
Above ${prefix} typically expands to /opt/local

db48 is the only viable version of berkley db on macports and the newer one currently does not build for arm64.

path structure

ls  /opt/local/include/db48
db.h
db_cxx.h
ls /opt/local/bin/db48*
 /opt/local/bin/db48_archive
 /opt/local/bin/db48_checkpoint
 /opt/local/bin/db48_deadlock
 /opt/local/bin/db48_dump
 /opt/local/bin/db48_hotbackup
 /opt/local/bin/db48_load
/opt/local/bin/db48_printlog
/opt/local/bin/db48_recover
/opt/local/bin/db48_sql
 /opt/local/bin/db48_stat
 /opt/local/bin/db48_upgrade
/opt/local/bin/db48_verify
ls /opt/local/lib/db48/
libdb-4.8.a
libdb-4.8.dylib
libdb-4.dylib -> libdb-4.8.dylib
libdb.a
libdb.dylib -> libdb-4.8.dylib
libdb_cxx-4.8.a
libdb_cxx-4.8.dylib
libdb_cxx-4.dylib -> libdb_cxx-4.8.dylib
libdb_cxx.a
libdb_cxx.dylib -> libdb_cxx-4.8.dylib
@rdmark
Copy link
Member

rdmark commented Jan 23, 2025

Can you try passing this to Meson and see if you get better results:

-Dwith-bdb-path=${prefix} \

Thanks for working on the MacPorts port, BTW!

@NJRoadfan
Copy link
Contributor

It looks like Homebrew (yes, I know, the "competition") had to patch both db5.3 and db4.8 to properly compile on macOS.

@trodemaster
Copy link
Author

I have tried with just the prefix
-Dwith-bdb-path=${prefix}
My suspicion is that it's the deeper part of this path that is not matching correctly. The library names themselves are different than on my Linux test vm.

@rdmark
Copy link
Member

rdmark commented Jan 24, 2025

Depending a little bit on how meson's find_library() works, the solution might be to prepend subdir to bdb_libdir at

libdb = cc.find_library(name, dirs: bdb_libdir, required: false)

Or, to make sure we don't break anything for other environments: First try without subdir, check if found, and if not try with subdir.

@rdmark
Copy link
Member

rdmark commented Feb 7, 2025

@trodemaster is packaging of netatalk v4 with MacPorts fully unblocked now, or are there other complications that we can assist with?

@trodemaster
Copy link
Author

It's building now with this PR. I have an AppleTalk variant that builds atalkd. A minor release that includes this PR is all that's needed. I'm traveling this weekend so should have time to get things tested and submitted this week.

@rdmark
Copy link
Member

rdmark commented Feb 9, 2025

I can cook up a 4.1 bugfix release later this week for you if it helps.

Just out of curiosity, MacPorts doesn't support local patches for cases like this?

@trodemaster
Copy link
Author

trodemaster commented Feb 10, 2025 via email

@rdmark
Copy link
Member

rdmark commented Feb 10, 2025

@trodemaster Here you go: https://github.com/Netatalk/netatalk/releases/tag/netatalk-4-1-2

Enjoy :)

@trodemaster
Copy link
Author

Here we go!
Usually, there is a bit of back and forth if I miss any details. Will see how it goes this time.
macports/macports-ports#27663

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants