From 1e194a33f20ce8080da7184c4023a93103fd1b57 Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sun, 12 Jan 2025 18:58:56 +0000 Subject: [PATCH] tdb: fix pkgsLLVM build --- pkgs/by-name/td/tdb/package.nix | 53 ++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/pkgs/by-name/td/tdb/package.nix b/pkgs/by-name/td/tdb/package.nix index 3cf8aabc948e..439256acb8a6 100644 --- a/pkgs/by-name/td/tdb/package.nix +++ b/pkgs/by-name/td/tdb/package.nix @@ -1,14 +1,16 @@ -{ lib, stdenv -, fetchurl -, pkg-config -, wafHook -, buildPackages -, python3 -, readline -, libxslt -, libxcrypt -, docbook-xsl-nons -, docbook_xml_dtd_45 +{ + lib, + stdenv, + fetchurl, + pkg-config, + wafHook, + buildPackages, + python3, + readline, + libxslt, + libxcrypt, + docbook-xsl-nons, + docbook_xml_dtd_45, }: stdenv.mkDerivation rec { @@ -44,23 +46,32 @@ stdenv.mkDerivation rec { wafPath = "buildtools/bin/waf"; - wafConfigureFlags = [ - "--bundled-libraries=NONE" - "--builtin-libraries=replace" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "--cross-compile" - "--cross-execute=${stdenv.hostPlatform.emulator buildPackages}" - ]; + wafConfigureFlags = + [ + "--bundled-libraries=NONE" + "--builtin-libraries=replace" + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "--cross-compile" + "--cross-execute=${stdenv.hostPlatform.emulator buildPackages}" + ]; - postFixup = if stdenv.hostPlatform.isDarwin - then ''install_name_tool -id $out/lib/libtdb.dylib $out/lib/libtdb.dylib'' - else null; + postFixup = + if stdenv.hostPlatform.isDarwin then + ''install_name_tool -id $out/lib/libtdb.dylib $out/lib/libtdb.dylib'' + else + null; # 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"; + # https://reviews.llvm.org/D135402 + NIX_LDFLAGS = lib.optional ( + stdenv.cc.bintools.isLLVM && lib.versionAtLeast stdenv.cc.bintools.version "17" + ) "--undefined-version"; + meta = with lib; { description = "Trivial database"; longDescription = ''