Skip to content

Commit

Permalink
Merge pull request #690 from onekey-sec/update_flake_lock_action
Browse files Browse the repository at this point in the history
Update flake.lock
  • Loading branch information
qkaiser authored Dec 20, 2023
2 parents 2b48fc2 + 345ec5e commit 10263b5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 77 deletions.
36 changes: 18 additions & 18 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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 10263b5

Please sign in to comment.