push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
--- a/buildtools/wafsamba/samba_utils.py 2019-04-08 01:13:47.525306574 +0000
+++ b/buildtools/wafsamba/samba_utils.py 2019-04-08 01:14:34.805245676 +0000
@@ -495,7 +495,7 @@
Logs.zones = ['runner']
if Logs.verbose > 2:
Logs.zones = ['*']
- elif opt[0].isupper() and opt.find('=') != -1:
+ elif opt[0] and opt.find('=') != -1:
# this allows us to set waf options on the make command line
# for example, if you do "make FOO=blah", then we set the
# option 'FOO' in Options.options, to blah. If you look in wafsamba/wscript

View File

@@ -0,0 +1,18 @@
--- a/dynconfig/wscript 2018-12-23 20:28:42.908832206 -0800
+++ b/dynconfig/wscript 2018-12-23 20:31:55.568835627 -0800
@@ -419,15 +419,3 @@
public_headers=os_path_relpath(os.path.join(Options.launch_dir, version_header), bld.curdir),
header_path='samba',
cflags=cflags)
-
- # install some extra empty directories
- bld.INSTALL_DIR("${CONFIGDIR}")
- bld.INSTALL_DIR("${LOGFILEBASE}")
- bld.INSTALL_DIR("${PRIVILEGED_SOCKET_DIR}")
- bld.INSTALL_DIR("${PRIVATE_DIR}", 0o700)
- bld.INSTALL_DIR("${BINDDNS_DIR}", 0o770)
- bld.INSTALL_DIR("${STATEDIR}")
- bld.INSTALL_DIR("${CACHEDIR}")
-
- # these might be on non persistent storage
- bld.INSTALL_DIRS("", "${LOCKDIR} ${PIDDIR} ${SOCKET_DIR}")

View File

@@ -0,0 +1,33 @@
diff --git a/ctdb/wscript b/ctdb/wscript
index e9cd89436a3..893b9a4c59e 100644
--- a/ctdb/wscript
+++ b/ctdb/wscript
@@ -862,7 +862,7 @@ def build(bld):
for t in etc_subdirs:
files = SUBDIR_MODE('%s/%s' % (configdir, t), trim_path=configdir)
for fmode in files:
- bld.INSTALL_FILES(bld.env.CTDB_ETCDIR, 'config/%s' % fmode[0],
+ bld.INSTALL_FILES('${EXEC_PREFIX}${CTDB_ETCDIR}', 'config/%s' % fmode[0],
destname=fmode[0], chmod=fmode[1])
# If this is a direct install and there are no event scripts
@@ -901,17 +901,13 @@ def build(bld):
]
for t in etc_scripts:
- bld.INSTALL_FILES(bld.env.CTDB_ETCDIR, 'config/%s' % t,
+ bld.INSTALL_FILES('${EXEC_PREFIX}${CTDB_ETCDIR}', 'config/%s' % t,
destname=t, chmod=MODE_755)
- bld.INSTALL_FILES('${CTDB_ETCDIR}/events/notification',
+ bld.INSTALL_FILES('${EXEC_PREFIX}$${CTDB_ETCDIR}/events/notification',
'config/notification.README',
destname='README')
- bld.INSTALL_DIR(bld.env.CTDB_LOGDIR)
- bld.INSTALL_DIR(bld.env.CTDB_RUNDIR)
- bld.INSTALL_DIR(bld.env.CTDB_VARDIR)
-
for d in ['volatile', 'persistent', 'state']:
bld.INSTALL_DIR(os.path.join(bld.env.CTDB_VARDIR, d))

351
pkgs/servers/samba/4.x.nix Normal file
View File

@@ -0,0 +1,351 @@
{
lib,
stdenv,
buildPackages,
fetchurl,
fetchpatch,
wafHook,
pkg-config,
bison,
flex,
perl,
libxslt,
docbook_xsl,
fixDarwinDylibNames,
docbook_xml_dtd_45,
readline,
popt,
dbus,
libbsd,
libarchive,
zlib,
liburing,
gnutls,
systemd,
samba,
talloc,
jansson,
ldb,
lmdb,
libtasn1,
tdb,
tevent,
libxcrypt,
cmocka,
rpcsvc-proto,
bash,
python3Packages,
nixosTests,
libiconv,
testers,
pkgsCross,
enableLDAP ? false,
openldap,
enablePrinting ? false,
cups,
enableProfiling ? true,
enableMDNS ? false,
avahi,
enableDomainController ? false,
gpgme,
enableRegedit ? true,
ncurses,
enableCephFS ? false,
ceph,
enableGlusterFS ? false,
glusterfs,
libuuid,
enableAcl ? stdenv.hostPlatform.isLinux,
acl,
enableLibunwind ? (!stdenv.hostPlatform.isDarwin),
libunwind,
enablePam ? (!stdenv.hostPlatform.isDarwin),
pam,
}:
let
inherit (lib) optional optionals;
needsAnswers =
stdenv.hostPlatform != stdenv.buildPlatform
&& !(stdenv.hostPlatform.emulatorAvailable buildPackages);
answers =
{
x86_64-freebsd = ./answers-x86_64-freebsd;
}
.${stdenv.hostPlatform.system}
or (throw "Need pre-generated answers file to compile for ${stdenv.hostPlatform.system}");
in
stdenv.mkDerivation (finalAttrs: {
pname = "samba";
version = "4.22.3";
src = fetchurl {
url = "https://download.samba.org/pub/samba/stable/samba-${finalAttrs.version}.tar.gz";
hash = "sha256-j9cJJimjWW2TXNdWfZNJeflCcpGOw6/9DMgHk07PIro=";
};
outputs = [
"out"
"dev"
"man"
];
patches = [
./4.x-no-persistent-install.patch
./4.x-no-persistent-install-dynconfig.patch
./4.x-fix-makeflags-parsing.patch
./build-find-pre-built-heimdal-build-tools-in-case-of-.patch
(fetchpatch {
# workaround for https://github.com/NixOS/nixpkgs/issues/303436
name = "samba-reproducible-builds.patch";
url = "https://gitlab.com/raboof/samba/-/commit/9995c5c234ece6888544cdbe6578d47e83dea0b5.patch";
hash = "sha256-TVKK/7wGsfP1pVf8o1NwazobiR8jVJCCMj/FWji3f2A=";
})
(fetchpatch {
name = "cross-compile.patch";
url = "https://gitlab.com/samba-team/samba/-/merge_requests/3990/diffs.patch?commit_id=52af20db81f24cbfaa6fef8233584fc40fc72d34";
hash = "sha256-GMPxM6KMtMPRljhRI+dDD2fOp+y5kpRqbjqkj19Du4Q=";
})
];
nativeBuildInputs = [
python3Packages.python
python3Packages.wrapPython
wafHook
pkg-config
bison
flex
perl
perl.pkgs.ParseYapp
perl.pkgs.JSON
libxslt
docbook_xsl
docbook_xml_dtd_45
cmocka
rpcsvc-proto
]
++ optionals stdenv.hostPlatform.isLinux [
buildPackages.stdenv.cc
]
++ optional (stdenv.buildPlatform != stdenv.hostPlatform) samba # asn1_compile/compile_et
++ optionals stdenv.hostPlatform.isDarwin [
fixDarwinDylibNames
];
wafPath = "buildtools/bin/waf";
buildInputs = [
bash
python3Packages.python
readline
popt
dbus
jansson
libarchive
zlib
gnutls
libtasn1
lmdb
tdb
libxcrypt
]
++ optionals (!stdenv.hostPlatform.isBSD) [
libbsd
]
++ optionals stdenv.hostPlatform.isLinux [
liburing
systemd
]
++ optionals stdenv.hostPlatform.isDarwin [ libiconv ]
++ optionals enableLDAP [
openldap.dev
python3Packages.markdown
]
++ optionals (!enableLDAP && stdenv.hostPlatform.isLinux) [
ldb
talloc
tevent
]
++ optional enablePrinting cups
++ optional enableMDNS avahi
++ optionals enableDomainController [
gpgme
python3Packages.dnspython
]
++ optional enableRegedit ncurses
++ optional (enableCephFS && stdenv.hostPlatform.isLinux) (lib.getDev ceph)
++ optionals (enableGlusterFS && stdenv.hostPlatform.isLinux) [
glusterfs
libuuid
]
++ optional enableAcl acl
++ optional enableLibunwind libunwind
++ optional enablePam pam;
postPatch = ''
# Removes absolute paths in scripts
sed -i 's,/sbin/,,g' ctdb/config/functions
# Fix the XML Catalog Paths
sed -i "s,\(XML_CATALOG_FILES=\"\),\1$XML_CATALOG_FILES ,g" buildtools/wafsamba/wafsamba.py
patchShebangs ./buildtools/bin
''
+ lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
substituteInPlace wscript source3/wscript nsswitch/wscript_build lib/replace/wscript source4/ntvfs/sysdep/wscript_configure --replace-fail 'sys.platform' '"${stdenv.hostPlatform.parsed.kernel.name}"'
'';
preConfigure = ''
export PKGCONFIG="$PKG_CONFIG"
export PYTHONHASHSEED=1
''
+ lib.optionalString needsAnswers ''
cp ${answers} answers
chmod +w answers
'';
env.NIX_LDFLAGS = lib.optionalString (
stdenv.cc.bintools.isLLVM && lib.versionAtLeast stdenv.cc.bintools.version "17"
) "--undefined-version";
wafConfigureFlags = [
"--with-static-modules=NONE"
"--with-shared-modules=ALL"
"--enable-fhs"
"--sysconfdir=/etc"
"--localstatedir=/var"
"--disable-rpath"
# otherwise third_party/waf/waflib/Tools/python.py would
# get the wrong pythondir from build platform python
"--pythondir=${placeholder "out"}/${python3Packages.python.sitePackages}"
(lib.enableFeature enablePrinting "cups")
]
++ optional (!enableDomainController) "--without-ad-dc"
++ optionals (!enableLDAP) [
"--without-ldap"
"--without-ads"
]
++ optionals (!enableLDAP && stdenv.hostPlatform.isLinux) [
"--bundled-libraries=!ldb,!pyldb-util!talloc,!pytalloc-util,!tevent,!tdb,!pytdb"
]
++ optional enableLibunwind "--with-libunwind"
++ optional enableProfiling "--with-profiling-data"
++ optional (!enableAcl) "--without-acl-support"
++ optional (!enablePam) "--without-pam"
++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"--bundled-libraries=!asn1_compile,!compile_et"
"--cross-compile"
(
if (stdenv.hostPlatform.emulatorAvailable buildPackages) then
"--cross-execute=${stdenv.hostPlatform.emulator buildPackages}"
else
"--cross-answers=answers"
)
]
++ optionals stdenv.buildPlatform.is32bit [
# By default `waf configure` spawns as many as available CPUs. On
# 32-bit systems with many CPUs (like `i686` chroot on `x86_64`
# kernel) it can easily exhaust 32-bit address space and hang up:
# https://github.com/NixOS/nixpkgs/issues/287339#issuecomment-1949462057
# https://bugs.gentoo.org/683148
# Limit the job count down to the minimal on system with limited address
# space.
"--jobs 1"
];
# python-config from build Python gives incorrect values when cross-compiling.
# If python-config is not found, the build falls back to using the sysconfig
# module, which works correctly in all cases.
PYTHON_CONFIG = "/invalid";
pythonPath = [
python3Packages.dnspython
python3Packages.markdown
tdb
];
preBuild = ''
export MAKEFLAGS="-j $NIX_BUILD_CORES"
'';
# Save asn1_compile and compile_et so they are available to run on the build
# platform when cross-compiling
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
mkdir -p "$dev/bin"
cp bin/asn1_compile bin/compile_et "$dev/bin"
'';
# Some libraries don't have /lib/samba in RPATH but need it.
# Use find -type f -executable -exec echo {} \; -exec sh -c 'ldd {} | grep "not found"' \;
# Looks like a bug in installer scripts.
postFixup = ''
export SAMBA_LIBS="$(find $out -type f -regex '.*\${stdenv.hostPlatform.extensions.sharedLibrary}\(\..*\)?' -exec dirname {} \; | sort | uniq)"
read -r -d "" SCRIPT << EOF || true
[ -z "\$SAMBA_LIBS" ] && exit 1;
BIN='{}';
''
+ lib.optionalString stdenv.hostPlatform.isLinux ''
OLD_LIBS="\$(patchelf --print-rpath "\$BIN" 2>/dev/null | tr ':' '\n')";
ALL_LIBS="\$(echo -e "\$SAMBA_LIBS\n\$OLD_LIBS" | sort | uniq | tr '\n' ':')";
patchelf --set-rpath "\$ALL_LIBS" "\$BIN" 2>/dev/null || exit $?;
patchelf --shrink-rpath "\$BIN";
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
install_name_tool -id \$BIN \$BIN
for old_rpath in \$(otool -L \$BIN | grep /private/tmp/ | awk '{print \$1}'); do
new_rpath=\$(find \$SAMBA_LIBS -name \$(basename \$old_rpath) | head -n 1)
install_name_tool -change \$old_rpath \$new_rpath \$BIN
done
''
+ ''
EOF
find $out -type f -regex '.*\${stdenv.hostPlatform.extensions.sharedLibrary}\(\..*\)?' -exec $SHELL -c "$SCRIPT" \;
find $out/bin -type f -exec $SHELL -c "$SCRIPT" \;
# Fix PYTHONPATH for some tools
wrapPythonPrograms
# Samba does its own shebang patching, but uses build Python
find $out/bin -type f -executable | while read file; do
isScript "$file" || continue
sed -i 's^${lib.getBin buildPackages.python3Packages.python}^${lib.getBin python3Packages.python}^' "$file"
done
'';
disallowedReferences = lib.optionals (
buildPackages.python3Packages.python != python3Packages.python
) [ buildPackages.python3Packages.python ];
passthru.tests = {
samba = nixosTests.samba;
cross = pkgsCross.aarch64-multiplatform.samba;
pkg-config = testers.hasPkgConfigModules {
package = finalAttrs.finalPackage;
};
version = testers.testVersion {
command = "${finalAttrs.finalPackage}/bin/smbd -V";
package = finalAttrs.finalPackage;
};
};
meta = with lib; {
homepage = "https://www.samba.org";
description = "Standard Windows interoperability suite of programs for Linux and Unix";
license = licenses.gpl3;
platforms = platforms.unix;
broken = enableGlusterFS;
maintainers = with maintainers; [ aneeshusa ];
pkgConfigModules = [
"ndr_krb5pac"
"ndr_nbt"
"ndr_standard"
"ndr"
"netapi"
"samba-util"
"smbclient"
"wbclient"
];
};
})

View File

@@ -0,0 +1,33 @@
Checking uname sysname type: "FreeBSD"
Checking uname machine type: "amd64"
Checking uname release type: "14.0-RELEASE"
Checking uname version type: "FreeBSD 14.0-RELEASE #0 releng/14.0-n265380-f9716eee8ab4: Fri Nov 10 05:57:23 UTC 2023 root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC"
rpath library support: OK
-Wl,--version-script support: OK
Checking getconf LFS_CFLAGS: (64, "")
Checking for large file support without additional flags: OK
Checking correct behavior of strtoll: OK
Checking for working strptime: NO
Checking for C99 vsnprintf: "1"
Checking for HAVE_SHARED_MMAP: OK
Checking for HAVE_INCOHERENT_MMAP: NO
Checking for HAVE_SECURE_MKSTEMP: OK
Checking for gnutls fips mode support: NO
Checking value of NSIG: "32"
Checking value of SIGRTMAX: "126"
Checking value of SIGRTMIN: "65"
Checking for a 64-bit host to support lmdb: OK
Checking for *bsd style statfs with statfs.f_iosize: OK
Checking errno of iconv for illegal multibyte sequence: OK
Checking if can we convert from CP850 to UCS-2LE: OK
Checking if can we convert from UTF-8 to UCS-2LE: OK
Checking whether we can use Linux thread-specific credentials: NO
Checking whether setreuid is available: OK
Checking whether fcntl locking is available: OK
Checking for the maximum value of the 'time_t' type: OK
Checking whether the realpath function allows a NULL argument: OK
Checking for ftruncate extend: OK
Checking for readlink breakage: NO
getcwd takes a NULL argument: OK
checking for clnt_create(): OK
for QUOTACTL_4B; int quotactl(const char *path, int cmd, int id, char *addr): OK

View File

@@ -0,0 +1,63 @@
From 475ec75a34002aafabc92659f693cf705c96aff4 Mon Sep 17 00:00:00 2001
From: Nick Cao <nickcao@nichi.co>
Date: Thu, 21 Nov 2024 15:30:00 -0500
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]
[Mats: rebased for version 4.18.5]
[hexa: rebased for version 4.22.3]
---
wscript_configure_embedded_heimdal | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/wscript_configure_embedded_heimdal b/wscript_configure_embedded_heimdal
index c1488e5506e..ede28ba7fc3 100644
--- a/wscript_configure_embedded_heimdal
+++ b/wscript_configure_embedded_heimdal
@@ -15,3 +15,14 @@ conf.RECURSE('third_party/heimdal_build')
conf.define('HAVE_CLIENT_GSS_C_CHANNEL_BOUND_FLAG', 1)
conf.define('HAVE_KRB5_INIT_CREDS_STEP', 1)
+
+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")
--
2.50.1