Skip to content

Commit 871a887

Browse files
authored
tdb, talloc, tevent, ldb: fix pkgsLLVM build (take 2) (#384637)
2 parents 981199b + 23b4e3f commit 871a887

File tree

4 files changed

+85
-48
lines changed

4 files changed

+85
-48
lines changed

pkgs/by-name/ld/ldb/package.nix

Lines changed: 43 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
1-
{ lib, stdenv
2-
, fetchurl
3-
, python3
4-
, pkg-config
5-
, readline
6-
, tdb
7-
, talloc
8-
, tevent
9-
, popt
10-
, libxslt
11-
, docbook-xsl-nons
12-
, docbook_xml_dtd_42
13-
, cmocka
14-
, wafHook
15-
, buildPackages
16-
, libxcrypt
17-
, testers
1+
{
2+
lib,
3+
stdenv,
4+
fetchurl,
5+
python3,
6+
pkg-config,
7+
readline,
8+
tdb,
9+
talloc,
10+
tevent,
11+
popt,
12+
libxslt,
13+
docbook-xsl-nons,
14+
docbook_xml_dtd_42,
15+
cmocka,
16+
wafHook,
17+
buildPackages,
18+
libxcrypt,
19+
testers,
1820
}:
1921

2022
stdenv.mkDerivation (finalAttrs: {
@@ -26,7 +28,10 @@ stdenv.mkDerivation (finalAttrs: {
2628
hash = "sha256-0VWIQALHnbscPYZC+LEBPy5SCzru/W6WQSrexbjWy8A=";
2729
};
2830

29-
outputs = [ "out" "dev" ];
31+
outputs = [
32+
"out"
33+
"dev"
34+
];
3035

3136
nativeBuildInputs = [
3237
pkg-config
@@ -59,21 +64,32 @@ stdenv.mkDerivation (finalAttrs: {
5964

6065
wafPath = "buildtools/bin/waf";
6166

62-
wafConfigureFlags = [
63-
"--bundled-libraries=NONE"
64-
"--builtin-libraries=replace"
65-
"--without-ldb-lmdb"
66-
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
67-
"--cross-compile"
68-
"--cross-execute=${stdenv.hostPlatform.emulator buildPackages}"
69-
];
67+
wafConfigureFlags =
68+
[
69+
"--bundled-libraries=NONE"
70+
"--builtin-libraries=replace"
71+
"--without-ldb-lmdb"
72+
]
73+
++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
74+
"--cross-compile"
75+
"--cross-execute=${stdenv.hostPlatform.emulator buildPackages}"
76+
];
7077

7178
# python-config from build Python gives incorrect values when cross-compiling.
7279
# If python-config is not found, the build falls back to using the sysconfig
7380
# module, which works correctly in all cases.
7481
PYTHON_CONFIG = "/invalid";
7582

76-
stripDebugList = [ "bin" "lib" "modules" ];
83+
# https://reviews.llvm.org/D135402
84+
NIX_LDFLAGS = lib.optional (
85+
stdenv.cc.bintools.isLLVM && lib.versionAtLeast stdenv.cc.bintools.version "17"
86+
) "--undefined-version";
87+
88+
stripDebugList = [
89+
"bin"
90+
"lib"
91+
"modules"
92+
];
7793

7894
passthru.tests.pkg-config = testers.hasPkgConfigModules {
7995
package = finalAttrs.finalPackage;

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ stdenv.mkDerivation rec {
6767
# module, which works correctly in all cases.
6868
PYTHON_CONFIG = "/invalid";
6969

70+
# https://reviews.llvm.org/D135402
71+
NIX_LDFLAGS = lib.optional (
72+
stdenv.cc.bintools.isLLVM && lib.versionAtLeast stdenv.cc.bintools.version "17"
73+
) "--undefined-version";
74+
7075
# this must not be exported before the ConfigurePhase otherwise waf whines
7176
preBuild = lib.optionalString stdenv.hostPlatform.isMusl ''
7277
export NIX_CFLAGS_LINK="-no-pie -shared";

pkgs/by-name/td/tdb/package.nix

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
{ lib, stdenv
2-
, fetchurl
3-
, pkg-config
4-
, wafHook
5-
, buildPackages
6-
, python3
7-
, readline
8-
, libxslt
9-
, libxcrypt
10-
, docbook-xsl-nons
11-
, docbook_xml_dtd_45
1+
{
2+
lib,
3+
stdenv,
4+
fetchurl,
5+
pkg-config,
6+
wafHook,
7+
buildPackages,
8+
python3,
9+
readline,
10+
libxslt,
11+
libxcrypt,
12+
docbook-xsl-nons,
13+
docbook_xml_dtd_45,
1214
}:
1315

1416
stdenv.mkDerivation rec {
@@ -44,23 +46,32 @@ stdenv.mkDerivation rec {
4446

4547
wafPath = "buildtools/bin/waf";
4648

47-
wafConfigureFlags = [
48-
"--bundled-libraries=NONE"
49-
"--builtin-libraries=replace"
50-
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
51-
"--cross-compile"
52-
"--cross-execute=${stdenv.hostPlatform.emulator buildPackages}"
53-
];
49+
wafConfigureFlags =
50+
[
51+
"--bundled-libraries=NONE"
52+
"--builtin-libraries=replace"
53+
]
54+
++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
55+
"--cross-compile"
56+
"--cross-execute=${stdenv.hostPlatform.emulator buildPackages}"
57+
];
5458

55-
postFixup = if stdenv.hostPlatform.isDarwin
56-
then ''install_name_tool -id $out/lib/libtdb.dylib $out/lib/libtdb.dylib''
57-
else null;
59+
postFixup =
60+
if stdenv.hostPlatform.isDarwin then
61+
''install_name_tool -id $out/lib/libtdb.dylib $out/lib/libtdb.dylib''
62+
else
63+
null;
5864

5965
# python-config from build Python gives incorrect values when cross-compiling.
6066
# If python-config is not found, the build falls back to using the sysconfig
6167
# module, which works correctly in all cases.
6268
PYTHON_CONFIG = "/invalid";
6369

70+
# https://reviews.llvm.org/D135402
71+
NIX_LDFLAGS = lib.optional (
72+
stdenv.cc.bintools.isLLVM && lib.versionAtLeast stdenv.cc.bintools.version "17"
73+
) "--undefined-version";
74+
6475
meta = with lib; {
6576
description = "Trivial database";
6677
longDescription = ''

pkgs/by-name/te/tevent/package.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ stdenv.mkDerivation rec {
6767
# module, which works correctly in all cases.
6868
PYTHON_CONFIG = "/invalid";
6969

70+
# https://reviews.llvm.org/D135402
71+
NIX_LDFLAGS = lib.optional (
72+
stdenv.cc.bintools.isLLVM && lib.versionAtLeast stdenv.cc.bintools.version "17"
73+
) "--undefined-version";
74+
7075
meta = with lib; {
7176
description = "Event system based on the talloc memory management library";
7277
homepage = "https://tevent.samba.org/";

0 commit comments

Comments
 (0)