Skip to content

Commit

Permalink
more changes after tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaszklim committed Apr 6, 2020
1 parent cc39581 commit 3f70daa
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 12 deletions.
17 changes: 8 additions & 9 deletions opencv/4-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ cmake \
-DENABLE_VFPV3=$arm \
-DENABLE_PRECOMPILED_HEADERS=OFF \
-DBUILD_opencv_java=OFF \
-DBUILD_opencv_python=$pyth \
-DBUILD_opencv_python2=ON \
-DBUILD_opencv_python3=$pyth \
-DCMAKE_INSTALL_PREFIX=/usr/local/opencv-$version \
-DOPENCV_ENABLE_NONFREE=ON \
-DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules \
Expand All @@ -44,15 +45,13 @@ echo "############################################################"

make -k -j2

if [ "$pyth" = "ON" ]; then
echo "############################################################"
echo "# Building opencv-$version on $release - second pass"
echo "############################################################"
echo "############################################################"
echo "# Building opencv-$version on $release - second pass"
echo "############################################################"

# building cv2.cpp.o for python modules probably failed above - let's
# try once again in single process (so all memory will be available to it)
make
fi
# building cv2.cpp.o for python modules probably failed above - let's
# try once again in single process (so all memory will be available to it)
make

dt2=`date +%Y%m%d-%H%M`
echo "############################################################"
Expand Down
18 changes: 15 additions & 3 deletions opencv/5-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,22 @@ else
fi

cd /usr/local/src/opencv-$version/build
make install

# base OpenCV
make install
echo "/usr/local/opencv-$version/lib" >/etc/ld.so.conf.d/opencv-$version.conf
ldconfig

sed -i -e "/PYTHONPATH=\/usr\/local\/opencv-/d" /root/.bashrc
echo "export PYTHONPATH=/usr/local/opencv-$version/lib/python3.5/dist-packages" >>/root/.bashrc

# Python 2.x support
mkdir -p /usr/local/lib/python2.7/dist-packages
ln -s /usr/local/opencv-$version/lib/python2.7/dist-packages/cv2.so /usr/local/lib/python2.7/dist-packages


# Python 3.x support
if [ "`lsb_release -cs`" = "buster" ] && [[ $version == "3.4."* ]]; then
:
else
sed -i -e "/PYTHONPATH=\/usr\/local\/opencv-/d" /root/.bashrc
echo "export PYTHONPATH=/usr/local/opencv-$version/lib/python3.5/dist-packages" >>/root/.bashrc
fi
14 changes: 14 additions & 0 deletions opencv/6-pack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

if [ "$1" != "" ]; then
version=$1
else
version='4.2.0'
fi

release=`lsb_release -cs`

if [ -d /usr/local/opencv-$version ] && [ ! -f /usr/local/opencv-$version-$release.tar.gz ]; then
cd /usr/local
tar czvf opencv-$version-$release.tar.gz opencv-$version
fi

0 comments on commit 3f70daa

Please sign in to comment.