Skip to content

Commit

Permalink
nix: custom lief override is no longer needed
Browse files Browse the repository at this point in the history
  • Loading branch information
vlaci authored and qkaiser committed Dec 20, 2023
1 parent e54611e commit 918e00f
Showing 1 changed file with 0 additions and 59 deletions.
59 changes: 0 additions & 59 deletions overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,65 +15,6 @@ final: prev:
# Own package updated independently of nixpkgs
jefferson = final.callPackage ./nix/jefferson { };

lief = prev.lief.overrideAttrs (super: with final; {

outputs = [ "out" "py" ];

nativeBuildInputs = [
cmake
ninja
];

# Not a propagatedBuildInput because only the $py output needs it; $out is
# just the library itself (e.g. C/C++ headers).
buildInputs = with python3.pkgs; [
python3
setuptools
tomli
];

env.CXXFLAGS = toString (lib.optional stdenv.isLinux [ "-ffunction-sections" "-fdata-sections" "-fvisibility-inlines-hidden" "-static-libstdc++" "-static-libgcc" ]
++ lib.optional stdenv.isDarwin [ "-faligned-allocation" "-fno-aligned-new" "-fvisibility=hidden" ]);

env.CFLAGS = toString (lib.optional stdenv.isLinux [ "-ffunction-sections" "-fdata-sections" "-static-libstdc++" "-static-libgcc" ]);
env.LDFLAGS = toString (lib.optional stdenv.isLinux [ "-Wl,--gc-sections" "-Wl,--exclude-libs,ALL" ]);


dontUseCmakeConfigure = true;

buildPhase = ''
runHook preBuild
mkdir -p build
cmake -S . -B build -GNinja -DCMAKE_LINK_WHAT_YOU_USE=on -DBUILD_SHARED_LIBS=on -DLIEF_INSTALL_COMPILED_EXAMPLES=off -DCMAKE_INSTALL_PREFIX=$out -DCMAKE_BUILD_TYPE=Release
cmake --build build --target all
runHook postBuild
'';

postBuild = ''
pushd api/python
${python3.interpreter} setup.py build --parallel=$NIX_BUILD_CORES
popd
'';

installPhase = ''
runHook preInstall
cmake --build build --target install
runHook postInstall
'';

postInstall = ''
pushd api/python
${python3.interpreter} setup.py install --skip-build --root=/ --prefix=$py
popd
'';

});

pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
(python-final: python-prev: {
# Missing from nixpkgs
Expand Down

0 comments on commit 918e00f

Please sign in to comment.