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