Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Yershov <yershov@corp.mail.ru>2017-08-03 17:02:09 +0300
committerRoman Kuznetsov <r.kuznetsow@gmail.com>2017-08-03 17:14:33 +0300
commita02c0339b4a7c1658af44d193356d33455bde9dc (patch)
tree39511799c92d83b21da0f24b71ab8ada65fc83cd
parent0f63abb4d0ccba8d3366661fbb19e4840df16e4a (diff)
Fix build pymodules on Linuxpy-modules-0.2.3
-rw-r--r--CMakeLists.txt15
-rw-r--r--generator/mwm_diff/pymwm_diff/bindings.cpp13
-rw-r--r--local_ads/pylocal_ads/bindings.cpp13
-rwxr-xr-xpyhelpers/specs/build.sh30
-rw-r--r--pyhelpers/specs/python35-mapsme-modules.spec14
5 files changed, 73 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4e61922cba..74563bf50a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -125,19 +125,22 @@ if (PYBINDINGS)
endif()
find_package(PythonLibs ${PYTHON_VERSION} REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})
+ set(SKIP_DESKTOP ON)
endif()
-if (NOT PLATFORM_IPHONE AND NOT PLATFORM_ANDROID AND NOT PYBINDINGS)
+if (NOT PLATFORM_IPHONE AND NOT PLATFORM_ANDROID)
find_package(Qt5Core)
if (NOT Qt5Core_FOUND)
message(FATAL_ERROR "Qt5 cmake files were not found, please set QT_PATH environment variable")
endif()
find_package(Qt5Network REQUIRED)
- find_package(Qt5Gui REQUIRED)
- find_package(Qt5OpenGL REQUIRED)
- find_package(Qt5Widgets REQUIRED)
- find_package(Qt5Xml REQUIRED)
- find_package(Qt5Svg REQUIRED)
+ if(NOT SKIP_DESKTOP)
+ find_package(Qt5Gui REQUIRED)
+ find_package(Qt5OpenGL REQUIRED)
+ find_package(Qt5Widgets REQUIRED)
+ find_package(Qt5Xml REQUIRED)
+ find_package(Qt5Svg REQUIRED)
+ endif()
endif()
if (PLATFORM_LINUX)
diff --git a/generator/mwm_diff/pymwm_diff/bindings.cpp b/generator/mwm_diff/pymwm_diff/bindings.cpp
index 4302e2a0e9..0c6baacbbd 100644
--- a/generator/mwm_diff/pymwm_diff/bindings.cpp
+++ b/generator/mwm_diff/pymwm_diff/bindings.cpp
@@ -1,7 +1,20 @@
#include "generator/mwm_diff/diff.hpp"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wreorder"
+#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunused-local-typedef"
+#endif
+
#include <boost/python.hpp>
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
+#pragma GCC diagnostic pop
+
using namespace std;
BOOST_PYTHON_MODULE(pymwm_diff)
diff --git a/local_ads/pylocal_ads/bindings.cpp b/local_ads/pylocal_ads/bindings.cpp
index db693f3798..d2cfaaccd4 100644
--- a/local_ads/pylocal_ads/bindings.cpp
+++ b/local_ads/pylocal_ads/bindings.cpp
@@ -7,6 +7,14 @@
// hence the error. See https://bugs.python.org/issue10910
#include <locale>
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wreorder"
+#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunused-local-typedef"
+#endif
+
#include "pyhelpers/vector_uint8.hpp"
#include "pyhelpers/vector_list_conversion.hpp"
@@ -14,6 +22,11 @@
#include <boost/python/enum.hpp>
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
+#pragma GCC diagnostic pop
+
using namespace local_ads;
namespace
diff --git a/pyhelpers/specs/build.sh b/pyhelpers/specs/build.sh
new file mode 100755
index 0000000000..e357e713f4
--- /dev/null
+++ b/pyhelpers/specs/build.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+PROJECT=$1
+VERSION=$2
+RELEASE=$3
+if [ -z "$PROJECT" ]; then
+ echo "Specify project as first parameter"
+ exit 1
+fi
+if [ -z "$VERSION" ]; then
+ echo "Specify version as second parameter"
+ exit 1
+fi
+if [ -z "$RELEASE" ]; then
+ RELEASE=1
+fi
+
+basedir=`dirname $0`
+PROJECT=$PROJECT VERSION=$VERSION RELEASE=$RELEASE rpmbuild -ba python35-mapsme-modules.spec
+if [ $? -ne 0 ]; then
+ echo "Build failed!"
+ exit
+fi
+
+#rsync -av $HOME/rpmbuild/RPMS/noarch/$PROJECT.maps.me-{meta,front,devel}-$VERSION-$RELEASE.el6.noarch.rpm mapsme-team@pkg.corp.mail.ru::c6-mapsme-noarch
+#rsync -av $HOME/rpmbuild/RPMS/x86_64/$PROJECT.maps.me-$VERSION-$RELEASE.el6.x86_64.rpm mapsme-team@pkg.corp.mail.ru::c6-mapsme-x64
+
+#echo "c6-mapsme-noarch" | nc pkg.corp.mail.ru 12222 | grep -v '^* c'
+#echo "c6-mapsme-x64" | nc pkg.corp.mail.ru 12222 | grep -v '^* c'
+#echo
+echo "$PROJECT packages version $VERSION-$RELEASE build done, ready to deploy"
diff --git a/pyhelpers/specs/python35-mapsme-modules.spec b/pyhelpers/specs/python35-mapsme-modules.spec
index 328a3ba643..c8afaf730f 100644
--- a/pyhelpers/specs/python35-mapsme-modules.spec
+++ b/pyhelpers/specs/python35-mapsme-modules.spec
@@ -21,10 +21,9 @@
%{!?__jar_repack:/usr/lib/rpm/redhat/brp-java-repack-jars} \
%{nil}
-%define unmangled_version 0.1.7
-%define version %{unmangled_version}
-%define release 1
-%define tag py-modules-%{unmangled_version}
+%define version %(echo $VERSION)
+%define release %(echo $RELEASE)
+%define tag py-modules-%{version}
Name: python35-mapsme-modules
Version: %{version}
@@ -35,7 +34,7 @@ Vendor: Mail.Ru Group
Group: Development/Languages/Python
URL: https://github.com/mapsme/omim
-Source: omim-py-modules-%{unmangled_version}.tar.gz
+Source: omim-py-modules-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Prefix: %{_prefix}
@@ -82,11 +81,13 @@ cd ..
%{__mkdir_p} build && cd build
# TODO(mgergio, yershov): Why should we stills specify PYTHON_LIBRARY and
# PYTHON_INCLUDE_DIR manually?
-%{__cmake3} -DPYTHON_LIBRARY=/usr/local/python35/lib/libpython3.so -DPYTHON_INCLUDE_DIR=/usr/local/python35/include/python3.5m/ -DPYTHON_VERSION=3.5 -DBOOST_INCLUDEDIR=/usr/local/boost_1.54.0/include/ -DPYBINDINGS=ON ../omim
+%{__cmake3} -DPYTHON_LIBRARY=/usr/local/python35/lib/libpython3.so -DPYTHON_INCLUDE_DIR=/usr/local/python35/include/python3.5m/ -DPYTHON_VERSION=3.5 -DBOOST_INCLUDEDIR=/usr/local/boost_1.54.0/include/ -DPYBINDINGS=ON -DSKIP_DESKTOP=ON ../omim
%{__make} %{?_smp_mflags} pylocal_ads
+%{__make} %{?_smp_mflags} pymwm_diff
%install
%{__install} -m 755 -D %{_builddir}/%{name}-%{version}/build/pylocal_ads.so %{buildroot}/%{python_sitelib}/pylocal_ads.so
+%{__install} -m 755 -D %{_builddir}/%{name}-%{version}/build/pymwm_diff.so %{buildroot}/%{python_sitelib}/pymwm_diff.so
%clean
rm -rf %{buildroot}
@@ -94,6 +95,7 @@ rm -rf %{buildroot}
%files -n python35-pylocal_ads
%defattr(-,root,root)
%{python_sitelib}/pylocal_ads.so
+%{python_sitelib}/pymwm_diff.so
%changelog
* Wed Apr 26 2017 Magidovich Sergey <s.magidovich@corp.mail.ru> - 0.1b-1