Skip to content

Commit

Permalink
(Cherry-pick) fix pybin11 build error (#2836) (#2855)
Browse files Browse the repository at this point in the history
* fix pybin11 build error (#2836)

* fix pybin11 build error

Signed-off-by: anandaravuri <ananda.ravuri@intel>
Co-authored-by: anandaravuri <ananda.ravuri@intel>

Signed-off-by: anandaravuri <ananda.ravuri@intel>
Signed-off-by: anandaravuri <ananda.ravuri@intel.com>
Co-authored-by: anandaravuri <ananda.ravuri@intel>
  • Loading branch information
anandaravuri and anandaravuri committed Feb 28, 2023
1 parent 6c4978d commit ca17f74
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
19 changes: 15 additions & 4 deletions libraries/pyopaeuio/CMakeLists.txt
Expand Up @@ -24,18 +24,29 @@
## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
## POSSIBILITY OF SUCH DAMAGE.


if (OPAE_WITH_PYBIND11)
set(INCLUDE_DIRS "${OPAE_INCLUDE_PATH}:${pybind11_ROOT}/include")
set(LINK_DIRS "${LIBRARY_OUTPUT_PATH}")
set(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/timestamp)

set(SETUP_PY "setup.py")
set(PYOPAEUIO_DIST_STAGE_DIR ${CMAKE_CURRENT_BINARY_DIR}/stage)

foreach(pyfile ${SETUP_PY})
configure_file(${pyfile} ${PYOPAEUIO_DIST_STAGE_DIR}/${pyfile} @ONLY)
endforeach(pyfile ${SETUP_PY})

file(COPY pyopaeuio.cpp DESTINATION ${PYOPAEUIO_DIST_STAGE_DIR})
file(COPY pyopaeuio.h DESTINATION ${PYOPAEUIO_DIST_STAGE_DIR})

add_custom_command(
OUTPUT ${OUTPUT}
COMMAND ${PYTHON_EXECUTABLE} setup.py build_ext -I ${INCLUDE_DIRS} -L ${LINK_DIRS}
COMMAND ${PYTHON_EXECUTABLE} setup.py build_ext -I ${INCLUDE_DIRS} -L ${LINK_DIRS}
COMMAND ${PYTHON_EXECUTABLE} setup.py build
COMMAND ${CMAKE_COMMAND} -E touch ${OUTPUT}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS setup.py ${PKG_FILES}
WORKING_DIRECTORY ${PYOPAEUIO_DIST_STAGE_DIR}
DEPENDS ${SETUP_PY} ${PKG_FILES}
)
set_property(DIRECTORY PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES
Expand All @@ -50,6 +61,6 @@ if (OPAE_WITH_PYBIND11)
opae_python_install(
COMPONENT pyopaeuio
RECORD_FILE pyopaeuio-install.txt
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
SOURCE_DIR ${PYOPAEUIO_DIST_STAGE_DIR}
RPM_PACKAGE devel)
endif(OPAE_WITH_PYBIND11)
2 changes: 1 addition & 1 deletion libraries/pyopaeuio/setup.py
Expand Up @@ -73,7 +73,7 @@ def __str__(self):
]
},
ext_modules=extensions,
install_requires=['pybind11>=@PYOPAE_PYBIND11_VERSION@'],
install_requires=['pybind11>=@PYBIND11_VERSION@'],
description="pyopaeuio provides Python bindings around the "
"opaeuio",
license="BSD3",
Expand Down
2 changes: 1 addition & 1 deletion opae.spec.fedora
Expand Up @@ -167,7 +167,7 @@ pushd %{_topdir}/BUILD/%{name}-%{version}-%{opae_release}/%__cmake_builddir/libr
%{__python3} setup.py install --single-version-externally-managed --root=%{buildroot}
popd

pushd %{_topdir}/BUILD/%{name}-%{version}-%{opae_release}/libraries/pyopaeuio
pushd %{_topdir}/BUILD/%{name}-%{version}-%{opae_release}/%__cmake_builddir/libraries/pyopaeuio/stage
%{__python3} setup.py install --single-version-externally-managed --root=%{buildroot}
popd

Expand Down
2 changes: 1 addition & 1 deletion packaging/opae/deb/rules
Expand Up @@ -32,7 +32,7 @@ override_dh_auto_install:
cd $(CURDIR)/binaries/ofs.uio && python3 setup.py install --single-version-externally-managed --root=$(CURDIR)/debian/tmp --install-layout=deb && cd $(CURDIR)
cd $(CURDIR)/binaries/fpgadiag && python3 setup.py install --single-version-externally-managed --root=$(CURDIR)/debian/tmp --install-layout=deb && cd $(CURDIR)
cd $(CURDIR)/obj-x86_64-linux-gnu/libraries/pyopae/stage && python3 setup.py install --single-version-externally-managed --root=$(CURDIR)/debian/tmp --install-layout=deb && cd $(CURDIR)
cd $(CURDIR)/libraries/pyopaeuio && python3 setup.py install --single-version-externally-managed --root=$(CURDIR)/debian/tmp --install-layout=deb && cd $(CURDIR)
cd $(CURDIR)/obj-x86_64-linux-gnu/libraries/pyopaeuio/stage && python3 setup.py install --single-version-externally-managed --root=$(CURDIR)/debian/tmp --install-layout=deb && cd $(CURDIR)
cd $(CURDIR)/python/opae.admin && python3 setup.py install --single-version-externally-managed --root=$(CURDIR)/debian/tmp --install-layout=deb && cd $(CURDIR)
cd $(CURDIR)/python/pacsign && python3 setup.py install --single-version-externally-managed --root=$(CURDIR)/debian/tmp --install-layout=deb && cd $(CURDIR)
cd $(CURDIR)/python/packager && python3 setup.py install --single-version-externally-managed --root=$(CURDIR)/debian/tmp --install-layout=deb && cd $(CURDIR)
Expand Down

0 comments on commit ca17f74

Please sign in to comment.