15 stdenv.mkDerivation rec {
20 url = "mirror://samba/talloc/${pname}-${version}.tar.gz";
21 sha256 = "sha256-hez55GXiD5j5lQpS6aQR4UMgvFVfolfYdpe356mx2KY=";
30 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
41 # otherwise the configure script fails with
42 # PYTHONHASHSEED=1 missing! Don't use waf directly, use ./configure and make!
44 export PKGCONFIG="$PKG_CONFIG"
45 export PYTHONHASHSEED=1
48 wafPath = "buildtools/bin/waf";
51 "--enable-talloc-compat1"
52 "--bundled-libraries=NONE"
53 "--builtin-libraries=replace"
54 ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
56 "--cross-execute=${stdenv.hostPlatform.emulator buildPackages}"
59 # python-config from build Python gives incorrect values when cross-compiling.
60 # If python-config is not found, the build falls back to using the sysconfig
61 # module, which works correctly in all cases.
62 PYTHON_CONFIG = "/invalid";
64 # this must not be exported before the ConfigurePhase otherwise waf whines
65 preBuild = lib.optionalString stdenv.hostPlatform.isMusl ''
66 export NIX_CFLAGS_LINK="-no-pie -shared";
70 ${stdenv.cc.targetPrefix}ar q $out/lib/libtalloc.a bin/default/talloc.c.[0-9]*.o
74 description = "Hierarchical pool based memory allocator with destructors";
75 homepage = "https://tdb.samba.org/";
76 license = licenses.gpl3;
77 platforms = platforms.all;
78 maintainers = [ maintainers.matthiasbeyer ];