From 201aeaabb4a26ee034c67888216c1088f1d07f96 Mon Sep 17 00:00:00 2001 From: Quentin Kaiser Date: Tue, 31 Oct 2023 11:31:19 +0100 Subject: [PATCH] lief: fix darwin support The '/build/source' symlink does not seem to exist on Darwin targets. Properly set CXXFLAGS to limit compilation errors and warnings on Darwin targets. --- pkgs/development/libraries/lief/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/lief/default.nix b/pkgs/development/libraries/lief/default.nix index 44f82f15852a..4b691ba3d888 100644 --- a/pkgs/development/libraries/lief/default.nix +++ b/pkgs/development/libraries/lief/default.nix @@ -33,14 +33,16 @@ stdenv.mkDerivation rec { python ]; + env.CXXFLAGS = toString (lib.optional stdenv.isDarwin [ "-faligned-allocation" "-fno-aligned-new" "-fvisibility=hidden" ]); + postBuild = '' - pushd /build/source/api/python + pushd ../api/python ${pyEnv.interpreter} setup.py build --parallel=$NIX_BUILD_CORES popd ''; postInstall = '' - pushd /build/source/api/python + pushd ../api/python ${pyEnv.interpreter} setup.py install --skip-build --root=/ --prefix=$py popd '';