2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchurl
|
2020-12-03 08:41:04 +00:00
|
|
|
, python3
|
2020-04-24 23:36:52 +00:00
|
|
|
, pkg-config
|
|
|
|
, readline
|
|
|
|
, libxslt
|
|
|
|
, docbook-xsl-nons
|
|
|
|
, docbook_xml_dtd_42
|
|
|
|
, fixDarwinDylibNames
|
|
|
|
, wafHook
|
|
|
|
}:
|
|
|
|
|
2020-12-03 08:41:04 +00:00
|
|
|
stdenv.mkDerivation (rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "talloc";
|
2021-03-20 04:20:00 +00:00
|
|
|
version = "2.3.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://samba/talloc/${pname}-${version}.tar.gz";
|
2021-03-20 04:20:00 +00:00
|
|
|
sha256 = "sha256-J6A++Z44TXeRJN91XesinNF2H5Reym0gDoz9m/Upe9c=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
fixDarwinDylibNames
|
2020-12-03 08:41:04 +00:00
|
|
|
python3
|
2020-04-24 23:36:52 +00:00
|
|
|
wafHook
|
|
|
|
docbook-xsl-nons
|
|
|
|
docbook_xml_dtd_42
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2020-12-03 08:41:04 +00:00
|
|
|
python3
|
2020-04-24 23:36:52 +00:00
|
|
|
readline
|
|
|
|
libxslt
|
|
|
|
];
|
|
|
|
|
|
|
|
wafPath = "buildtools/bin/waf";
|
|
|
|
|
|
|
|
wafConfigureFlags = [
|
|
|
|
"--enable-talloc-compat1"
|
|
|
|
"--bundled-libraries=NONE"
|
|
|
|
"--builtin-libraries=replace"
|
|
|
|
];
|
|
|
|
|
|
|
|
# this must not be exported before the ConfigurePhase otherwise waf whines
|
2021-02-05 17:12:51 +00:00
|
|
|
preBuild = lib.optionalString stdenv.hostPlatform.isMusl ''
|
2020-04-24 23:36:52 +00:00
|
|
|
export NIX_CFLAGS_LINK="-no-pie -shared";
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
${stdenv.cc.targetPrefix}ar q $out/lib/libtalloc.a bin/default/talloc.c.[0-9]*.o
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Hierarchical pool based memory allocator with destructors";
|
|
|
|
homepage = "https://tdb.samba.org/";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
2021-02-05 17:12:51 +00:00
|
|
|
} // lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) {
|
2020-12-03 08:41:04 +00:00
|
|
|
# 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 when cross-compiling.
|
|
|
|
PYTHON_CONFIG = "/invalid";
|
|
|
|
})
|