ports/databases/ldb28/files/patch-buildtools_wafsamba_samba__autoconf.py
Mateusz Piotrowski 1aa6d61564 databases/ldb28: Add a new version of ldb
This port is based on ldb25. The changes are:

- Fix checks for Python support

  The bsd.port.pre.mk was included too early and USES=python wasn't
  processed as expected. As a result, the checks for Python support were
  broken.

- Switch from waf to configure and make.

  Upstream wants us to do it this way. Otherwise, the build system
  produces the following error message:

  > ===>  Configuring for ldb28-2.8.1
  > PYTHONHASHSEED=1 missing! Don't use waf directly, use ./configure and make!

  So, set HAS_CONFIGURE and BINARY_ALIAS to make the port build without
  waf.

- Clean up the makefile (sort variables and fix indentation)

- Drop the NO_PYTHON variable. It complicates the makefile
  unnecessarily. It is still possible to disable Python support by
  configuring the PYTHON3 option.

- Use WITH_DEBUG instead of option DEBUG.

- Enable PYTHON3 by default.

  The PYTHON3 option is required by net/samba419 to build without the
  bundled dependencies. The primary purpose of databases/ldb28 is to
  make it possible, so enable Python support by default.

PR:		280510
Sponsored by:	Klara, Inc.
2024-07-31 10:59:42 +02:00

50 lines
2.2 KiB
Python

--- buildtools/wafsamba/samba_autoconf.py.orig 2022-12-15 13:35:50 UTC
+++ buildtools/wafsamba/samba_autoconf.py
@@ -595,7 +595,7 @@ def library_flags(self, libs):
@conf
-def CHECK_LIB(conf, libs, mandatory=False, empty_decl=True, set_target=True, shlib=False):
+def CHECK_LIB(conf, libs, mandatory=False, empty_decl=True, set_target=True, shlib=False, msg=None):
'''check if a set of libraries exist as system libraries
returns the sublist of libs that do exist as a syslib or []
@@ -615,11 +615,29 @@ int foo()
ret.append(lib)
continue
+ if msg is None:
+ msg = 'Checking for library %s' % lib
+
(ccflags, ldflags, cpppath) = library_flags(conf, lib)
+
if shlib:
- res = conf.check(features='c cshlib', fragment=fragment, lib=lib, uselib_store=lib, cflags=ccflags, ldflags=ldflags, uselib=lib.upper(), mandatory=False)
+ res = conf.check(features='c cshlib',
+ fragment=fragment,
+ lib=lib,
+ uselib_store=lib,
+ cflags=ccflags,
+ ldflags=ldflags,
+ uselib=lib.upper(),
+ mandatory=False,
+ msg=msg)
else:
- res = conf.check(lib=lib, uselib_store=lib, cflags=ccflags, ldflags=ldflags, uselib=lib.upper(), mandatory=False)
+ res = conf.check(lib=lib,
+ uselib_store=lib,
+ cflags=ccflags,
+ ldflags=ldflags,
+ uselib=lib.upper(),
+ mandatory=False,
+ msg=msg)
if not res:
if mandatory:
@@ -989,5 +1007,5 @@ def SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS(conf):
conf.env.undefined_ldflags = conf.ADD_LDFLAGS('-Wl,-no-undefined', testflags=True)
if (conf.env.undefined_ignore_ldflags == [] and
- conf.CHECK_LDFLAGS(['-undefined', 'dynamic_lookup'])):
+ conf.CHECK_LDFLAGS(['-undefined', 'dynamic_lookup'] + conf.env.WERROR_CFLAGS)):
conf.env.undefined_ignore_ldflags = ['-undefined', 'dynamic_lookup']