Merge pull request #11106 from marcelotduarte/lief

LIEF 0.12.0
This commit is contained in:
Christoph Reiter
2022-03-28 08:51:30 +02:00
committed by GitHub
2 changed files with 11 additions and 23 deletions

View File

@@ -4,8 +4,8 @@ _realname=lief
pkgbase=mingw-w64-python-${_realname}
pkgname=${MINGW_PACKAGE_PREFIX}-python-${_realname}
pkgdesc="LIEF - Library to Instrument Executable Formats (mingw-w64)"
pkgver=0.11.5
pkgrel=2
pkgver=0.12.0
pkgrel=1
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
url="https://github.com/lief-project/LIEF/"
@@ -20,8 +20,8 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
options=('staticlibs' '!strip' '!debug')
source=(https://github.com/lief-project/LIEF/archive/${pkgver}.tar.gz
lief.patch)
sha256sums=('6d6d57304a56850958e4ce54f3da2ea2b9eb856ccbab61c6cde9cba15d7c9da5'
'c3734f00930a3ad5942367eb69fe8b6db9652205eebe1936b8ca5596cd4ff926')
sha256sums=('4a5b893f514b03092885ef4dc0760ac8dd61860bee991e5af7f31bb33f12fc13'
'a85f8ae0cc72dd675bc6a9a5276f65c1136d07969976888b2609d378b4e81479')
prepare() {
cd "${srcdir}/LIEF-${pkgver}"
@@ -72,11 +72,12 @@ package() {
done
# Install egg-info and .pyd
_pythonpath=`${MINGW_PREFIX}/bin/python -c "from sysconfig import get_path; print(get_path('platlib'))"`
_pythonpath=`${MINGW_PREFIX}/bin/python -c "import sysconfig; print(sysconfig.get_path('platlib'))"`
_site_packages=${pkgdir}$(cygpath ${_pythonpath})
_ext_suffix=`${MINGW_PREFIX}/bin/python -c "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))"`
mkdir -p $_site_packages
cp -r ${_realname}.egg-info $_site_packages/${_realname}-${pkgver}.egg-info
cp build-${MSYSTEM}/api/python/lief.pyd $_site_packages/lief.pyd
cp build-${MSYSTEM}/api/python/lief.pyd $_site_packages/lief$_ext_suffix
install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
}

View File

@@ -1,21 +1,8 @@
diff --git a/cmake/FindPythonLibsNew.cmake b/cmake/FindPythonLibsNew.cmake
index 919a384..931d49e 100644
--- a/cmake/FindPythonLibsNew.cmake
+++ b/cmake/FindPythonLibsNew.cmake
@@ -141,7 +141,7 @@ string(REGEX REPLACE "\\\\" "/" PYTHON_PREFIX ${PYTHON_PREFIX})
string(REGEX REPLACE "\\\\" "/" PYTHON_INCLUDE_DIR ${PYTHON_INCLUDE_DIR})
string(REGEX REPLACE "\\\\" "/" PYTHON_SITE_PACKAGES ${PYTHON_SITE_PACKAGES})
-if(CMAKE_HOST_WIN32)
+if(CMAKE_HOST_WIN32 AND NOT (MSYS OR MINGW))
set(PYTHON_LIBRARY
"${PYTHON_PREFIX}/libs/Python${PYTHON_LIBRARY_SUFFIX}.lib")
diff --git a/setup.py b/setup.py
index 79e91b6..1f32d2f 100644
index 89ddd252..950dd8bc 100644
--- a/setup.py
+++ b/setup.py
@@ -201,7 +201,7 @@ class BuildLibrary(build_ext):
@@ -220,7 +220,7 @@ class BuildLibrary(build_ext):
]
@@ -24,7 +11,7 @@ index 79e91b6..1f32d2f 100644
from setuptools import msvc
cmake_args += [
@@ -241,7 +241,7 @@ class BuildLibrary(build_ext):
@@ -260,7 +260,7 @@ class BuildLibrary(build_ext):
if self.distribution.doc:
targets['doc'] = "lief-doc"
@@ -33,7 +20,7 @@ index 79e91b6..1f32d2f 100644
build_cmd = ['cmake', '--build', '.', '--target', "lief_samples"] + build_args
#log.info(" ".join(build_cmd))
@@ -299,7 +299,7 @@ class BuildLibrary(build_ext):
@@ -318,7 +318,7 @@ class BuildLibrary(build_ext):
libsuffix = pylief_dst.split(".")[-1]
pylief_path = os.path.join(cmake_library_output_directory, "{}.{}".format(PACKAGE_NAME, libsuffix))