From: Michael Tokarev <mjt@tls.msk.ru>
Subject: force talloc to be standalone
Date: Tue, 26 Nov 2024 17:28:51 +0300
Forwarded: not-needed

Upstream ships contents of lib/talloc/ as a separate
source of talloc.  Since we build samba anyway, there's
no need to have separate talloc source package, it's
enough to build it during samba build.

Always build talloc as stand-alone library
(instead of being samba-private if in a subdir).

When building as a sub-library within samba, where
libreplace is a private library, libtalloc.so will
have rpath pointing to the private samba dir.  Since
talloc actually does not use anything from libreplace,
just remove the dependency.

diff --git a/lib/talloc/wscript b/lib/talloc/wscript
index 8b5e02d36c5..503b4fbf29e 100644
--- a/lib/talloc/wscript
+++ b/lib/talloc/wscript
@@ -29,3 +29,3 @@ def options(opt):
     opt.RECURSE('lib/replace')
-    if opt.IN_LAUNCH_DIR():
+    if opt.IN_LAUNCH_DIR() or True:
         opt.add_option('--enable-talloc-compat1',
@@ -38,3 +38,3 @@ def configure(conf):
 
-    conf.env.standalone_talloc = conf.IN_LAUNCH_DIR()
+    conf.env.standalone_talloc = conf.IN_LAUNCH_DIR() or True
 
diff --git a/lib/talloc/wscript b/lib/talloc/wscript
index 8b5e02d36c5..92255dc2575 100644
--- a/lib/talloc/wscript
+++ b/lib/talloc/wscript
@@ -115,3 +115,3 @@ def build(bld):
                           'talloc.c',
-                          deps='replace',
+                          deps='', # 'replace',
                           provide_builtin_linking=True,
