nixpkgs/pkgs/by-name/ta/talloc/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

81 lines
1.9 KiB
Nix
Raw Normal View History

{ lib, stdenv
, fetchurl
, python3
, pkg-config
, readline
, libxslt
2022-09-27 03:30:17 +01:00
, libxcrypt
, docbook-xsl-nons
, docbook_xml_dtd_42
, fixDarwinDylibNames
2023-09-03 01:24:44 +01:00
, wafHook
, buildPackages
2014-04-29 20:26:09 +01:00
}:
stdenv.mkDerivation rec {
pname = "talloc";
2024-01-30 05:07:22 +00:00
version = "2.4.2";
src = fetchurl {
url = "mirror://samba/talloc/${pname}-${version}.tar.gz";
2024-01-30 05:07:22 +00:00
sha256 = "sha256-hez55GXiD5j5lQpS6aQR4UMgvFVfolfYdpe356mx2KY=";
};
nativeBuildInputs = [
pkg-config
python3
2023-09-03 01:24:44 +01:00
wafHook
docbook-xsl-nons
docbook_xml_dtd_42
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
fixDarwinDylibNames
];
buildInputs = [
python3
readline
libxslt
2022-09-27 03:30:17 +01:00
libxcrypt
];
2023-01-02 19:08:29 +00:00
# otherwise the configure script fails with
# PYTHONHASHSEED=1 missing! Don't use waf directly, use ./configure and make!
preConfigure = ''
export PKGCONFIG="$PKG_CONFIG"
export PYTHONHASHSEED=1
'';
wafPath = "buildtools/bin/waf";
2014-04-29 20:26:09 +01:00
wafConfigureFlags = [
2014-04-29 20:26:09 +01:00
"--enable-talloc-compat1"
"--bundled-libraries=NONE"
"--builtin-libraries=replace"
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"--cross-compile"
"--cross-execute=${stdenv.hostPlatform.emulator buildPackages}"
2014-04-29 20:26:09 +01: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 in all cases.
PYTHON_CONFIG = "/invalid";
# this must not be exported before the ConfigurePhase otherwise waf whines
preBuild = lib.optionalString stdenv.hostPlatform.isMusl ''
export NIX_CFLAGS_LINK="-no-pie -shared";
'';
2014-04-29 20:26:09 +01:00
2016-10-15 03:51:15 +01:00
postInstall = ''
2020-02-27 09:20:00 +00:00
${stdenv.cc.targetPrefix}ar q $out/lib/libtalloc.a bin/default/talloc.c.[0-9]*.o
'';
meta = with lib; {
description = "Hierarchical pool based memory allocator with destructors";
2020-03-03 19:10:15 +00:00
homepage = "https://tdb.samba.org/";
2014-04-29 20:26:09 +01:00
license = licenses.gpl3;
platforms = platforms.all;
maintainers = [ maintainers.matthiasbeyer ];
};
}