14 stdenv.mkDerivation rec {
19 url = "mirror://samba/talloc/${pname}-${version}.tar.gz";
20 sha256 = "sha256-a+lbI2i9CvHEzXqIFG62zuoY5Gw//JMwv2JitA0diqo=";
29 ] ++ lib.optionals stdenv.isDarwin [
40 wafPath = "buildtools/bin/waf";
43 "--enable-talloc-compat1"
44 "--bundled-libraries=NONE"
45 "--builtin-libraries=replace"
48 # python-config from build Python gives incorrect values when cross-compiling.
49 # If python-config is not found, the build falls back to using the sysconfig
50 # module, which works correctly in all cases.
51 PYTHON_CONFIG = "/invalid";
53 # this must not be exported before the ConfigurePhase otherwise waf whines
54 preBuild = lib.optionalString stdenv.hostPlatform.isMusl ''
55 export NIX_CFLAGS_LINK="-no-pie -shared";
59 ${stdenv.cc.targetPrefix}ar q $out/lib/libtalloc.a bin/default/talloc.c.[0-9]*.o
63 description = "Hierarchical pool based memory allocator with destructors";
64 homepage = "https://tdb.samba.org/";
65 license = licenses.gpl3;
66 platforms = platforms.all;