nixpkgs/pkgs/servers/samba/build-find-pre-built-heimdal-build-tools-in-case-of-.patch
2021-09-22 10:02:16 +02:00

96 lines
3.7 KiB
Diff

From f3f98c6ecc6febd8e79696672668e33d11fc19cb Mon Sep 17 00:00:00 2001
From: Pascal Bach <pascal.bach@nextrem.ch>
Date: Wed, 22 Sep 2021 09:42:42 +0200
Subject: [PATCH] build: find pre-built heimdal build tools in case of embedded
heimdal
This patch fixes the case of finding asn1_compile and compile_et for
building embedded heimdal, by setting
--bundled-libraries='!asn1_compile,!compile_et' as configure flags.
The Heimdal build tools compile_et and asn1_compile are needed *only*
if we use the embedded heimdal (otherwise we don't build heimdal and
use headers that have been generated by those tools elsewhere).
For cross-compilation with embedded heimdal, it is vital to use host build
tools, and so asn1_compile and compile_et must be supplied and not
built. One way of doing this would be to set the COMPILE_ET and
ASN1_COMPILE env vars to the location of supplied binaries. Another way,
which is more commonly used, is to exclude asn1_compile and compile_et
from bundled packages via the switch
-bundled-libraries='!asn1_compile,!compile_et'. When this is done,
the build script searches the path for those tools and sets the
ASN1_COMPILE and COMPILE_ET vars accordingly. (this is admittedly
kind of a round-about way of doing things but this has become the
de-facto standard amongst embedded distro builders).
In commit 8061983d4882f3ba3f12da71443b035d7b672eec, this process of
finding the binaris has been moved to be carried out only in the
system heimdal case. As explained above, we only need these tools,
and hence the check, in bundled mode.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14164
Signed-off-by: Uri Simchoni <uri@samba.org>
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
[Bachp: rebased for version 4.15.0]
# Conflicts:
# wscript_configure_system_heimdal
---
wscript_configure_embedded_heimdal | 11 +++++++++++
wscript_configure_system_heimdal | 11 -----------
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/wscript_configure_embedded_heimdal b/wscript_configure_embedded_heimdal
index 1c7801f705e..edcab15a88e 100644
--- a/wscript_configure_embedded_heimdal
+++ b/wscript_configure_embedded_heimdal
@@ -6,3 +6,14 @@ if not conf.env['BISON']:
conf.define('USING_EMBEDDED_HEIMDAL', 1)
conf.RECURSE('source4/heimdal_build')
+
+def check_system_heimdal_binary(name):
+ if conf.LIB_MAY_BE_BUNDLED(name):
+ return False
+ if not conf.find_program(name, var=name.upper()):
+ return False
+ conf.define('USING_SYSTEM_%s' % name.upper(), 1)
+ return True
+
+check_system_heimdal_binary("compile_et")
+check_system_heimdal_binary("asn1_compile")
diff --git a/wscript_configure_system_heimdal b/wscript_configure_system_heimdal
index 67d8804d0ff..20aee31aac7 100644
--- a/wscript_configure_system_heimdal
+++ b/wscript_configure_system_heimdal
@@ -37,14 +37,6 @@ def check_system_heimdal_lib(name, functions='', headers='', onlyif=None):
conf.define('USING_SYSTEM_%s' % name.upper(), 1)
return True
-def check_system_heimdal_binary(name):
- if conf.LIB_MAY_BE_BUNDLED(name):
- return False
- if not conf.find_program(name, var=name.upper()):
- return False
- conf.define('USING_SYSTEM_%s' % name.upper(), 1)
- return True
-
check_system_heimdal_lib("com_err", "com_right_r com_err", "com_err.h")
if check_system_heimdal_lib("roken", "rk_socket_set_reuseaddr", "roken.h"):
@@ -96,9 +88,6 @@ finally:
#if conf.CHECK_BUNDLED_SYSTEM('tommath', checkfunctions='mp_init', headers='tommath.h'):
# conf.define('USING_SYSTEM_TOMMATH', 1)
-check_system_heimdal_binary("compile_et")
-check_system_heimdal_binary("asn1_compile")
-
conf.env.KRB5_VENDOR = 'heimdal'
conf.define('USING_SYSTEM_KRB5', 1)
conf.define('USING_SYSTEM_HEIMDAL', 1)
--
2.33.0