Merge pull request #251414 from GenericNerdyUsername/lief-fix
lief, python3Packages.lief: 0.12.3 -> 0.13.2
This commit is contained in:
commit
237ea988eb
|
@ -3,26 +3,28 @@
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, python
|
, python
|
||||||
, cmake
|
, cmake
|
||||||
|
, ninja
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
pyEnv = python.withPackages (ps: [ ps.setuptools ]);
|
pyEnv = python.withPackages (ps: [ ps.setuptools ps.tomli ps.pip ps.setuptools ]);
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "lief";
|
pname = "lief";
|
||||||
version = "0.12.3";
|
version = "0.13.2";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "lief-project";
|
owner = "lief-project";
|
||||||
repo = "LIEF";
|
repo = "LIEF";
|
||||||
rev = version;
|
rev = version;
|
||||||
sha256 = "sha256-wZgv4AFc7DrMCyxMLKQxO1mUTDAU4klK8aZAySqGJoY=";
|
sha256 = "sha256-lH4SqwPB2Jp/wUI2Cll67PQbHbwMqpNuLy/ei8roiHg=";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = [ "out" "py" ];
|
outputs = [ "out" "py" ];
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
cmake
|
cmake
|
||||||
|
ninja
|
||||||
];
|
];
|
||||||
|
|
||||||
# Not a propagatedBuildInput because only the $py output needs it; $out is
|
# Not a propagatedBuildInput because only the $py output needs it; $out is
|
||||||
|
@ -31,33 +33,16 @@ stdenv.mkDerivation rec {
|
||||||
python
|
python
|
||||||
];
|
];
|
||||||
|
|
||||||
dontUseCmakeConfigure = true;
|
postBuild = ''
|
||||||
|
pushd /build/source/api/python
|
||||||
buildPhase = ''
|
${pyEnv.interpreter} setup.py build --parallel=$NIX_BUILD_CORES
|
||||||
runHook preBuild
|
popd
|
||||||
|
|
||||||
substituteInPlace setup.py \
|
|
||||||
--replace 'cmake_args = []' "cmake_args = [ \"-DCMAKE_INSTALL_PREFIX=$prefix\" ]"
|
|
||||||
${pyEnv.interpreter} setup.py --sdk build --parallel=$NIX_BUILD_CORES
|
|
||||||
|
|
||||||
runHook postBuild
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# I was unable to find a way to build the library itself and have it install
|
postInstall = ''
|
||||||
# to $out, while also installing the Python bindings to $py without building
|
pushd /build/source/api/python
|
||||||
# the project twice (using cmake), so this is the best we've got. It uses
|
|
||||||
# something called CPack to create the tarball, but it's not obvious to me
|
|
||||||
# *how* that happens, or how to intercept it to just get the structured
|
|
||||||
# library output.
|
|
||||||
installPhase = ''
|
|
||||||
runHook preInstall
|
|
||||||
|
|
||||||
mkdir -p $out $py/nix-support
|
|
||||||
echo "${python}" >> $py/nix-support/propagated-build-inputs
|
|
||||||
tar xf build/*.tar.gz --directory $out --strip-components 1
|
|
||||||
${pyEnv.interpreter} setup.py install --skip-build --root=/ --prefix=$py
|
${pyEnv.interpreter} setup.py install --skip-build --root=/ --prefix=$py
|
||||||
|
popd
|
||||||
runHook postInstall
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
|
@ -65,6 +50,6 @@ stdenv.mkDerivation rec {
|
||||||
homepage = "https://lief.quarkslab.com/";
|
homepage = "https://lief.quarkslab.com/";
|
||||||
license = [ licenses.asl20 ];
|
license = [ licenses.asl20 ];
|
||||||
platforms = with platforms; linux ++ darwin;
|
platforms = with platforms; linux ++ darwin;
|
||||||
maintainers = [ maintainers.lassulus ];
|
maintainers = with maintainers; [ lassulus genericnerdyusername ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue