Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bingcm committed Dec 4, 2023
1 parent 3e23e32 commit 1f42df8
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 12 deletions.
25 changes: 13 additions & 12 deletions install.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import os

url_prefix = 'http://fishros.com/install/install1s/'
url_prefix = '/home/wyh/Desktop/program/env_install/'

base_url = url_prefix+'tools/base.py'

Expand Down Expand Up @@ -32,7 +32,8 @@
12: {'tip':'一键安装:PlateformIO MicroROS开发环境(支持Fishbot)', 'type':INSTALL_SOFTWARE, 'tool':url_prefix+'tools/tool_install_micros_fishbot_env.py' ,'dep':[] },
13: {'tip':'一键配置:python国内源','type':CONFIG_TOOL,'tool':url_prefix+'tools/tool_config_python_source.py' ,'dep':[] },
14: {'tip':'一键安装:科学上网代理工具','type':INSTALL_SOFTWARE,'tool':url_prefix+'tools/tool_install_proxy_tool.py' ,'dep':[8] },
15: {'tip':'一键安装:QQ for Linux', 'type':INSTALL_SOFTWARE, 'tool': url_prefix+'tools/tool_install_qq.py', 'dep':[]},
15: {'tip':'一键安装:QQ for Linux', 'type':INSTALL_SOFTWARE, 'tool': url_prefix+'tools/tool_install_qq.py', 'dep':[]},
16: {'tip':'一键安装:Opencv for Linux', 'type':INSTALL_SOFTWARE, 'tool': url_prefix+'tools/tool_install_opencv_linux.py', 'dep':[]},
# 77: {'tip':'测试模式:运行自定义工具测试'},
}
#
Expand All @@ -53,24 +54,24 @@

def main():
# download base
os.system("wget {} -O /tmp/fishinstall/{} --no-check-certificate".format(base_url,base_url.replace(url_prefix,'')))
#os.system("wget {} -O /tmp/fishinstall/{} --no-check-certificate".format(base_url,base_url.replace(url_prefix,'')))
from tools.base import CmdTask,FileUtils,PrintUtils,ChooseTask,ChooseWithCategoriesTask
from tools.base import encoding_utf8,osversion,osarch
from tools.base import run_tool_file,download_tools
from tools.base import config_helper
# PrintUtils.print_delay(f"检测到你的系统版本信息为{osversion.get_codename()},{osarch}",0.001)
# 使用量统计
CmdTask("wget https://fishros.org.cn/forum/topic/1733 -O /tmp/t1733 -q && rm -rf /tmp/t1733").run()
#CmdTask("wget https://fishros.org.cn/forum/topic/1733 -O /tmp/t1733 -q && rm -rf /tmp/t1733").run()

# check base config
if not encoding_utf8:
print("Your system encoding not support ,will install some packgaes..")
CmdTask("sudo apt-get install language-pack-zh-hans -y",0).run()
CmdTask("sudo apt-get install apt-transport-https -y",0).run()
FileUtils.append("/etc/profile",'export LANG="zh_CN.UTF-8"')
print('Finish! Please Try Again!')
print('Solutions: https://fishros.org.cn/forum/topic/24 ')
return False
# if not encoding_utf8:
# print("Your system encoding not support ,will install some packgaes..")
# CmdTask("sudo apt-get install language-pack-zh-hans -y",0).run()
# CmdTask("sudo apt-get install apt-transport-https -y",0).run()
# FileUtils.append("/etc/profile",'export LANG="zh_CN.UTF-8"')
# print('Finish! Please Try Again!')
# print('Solutions: https://fishros.org.cn/forum/topic/24 ')
# return False
PrintUtils.print_success("基础检查通过...")

book = """
Expand Down
46 changes: 46 additions & 0 deletions tools/tool_install_opencv_linux.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# -*- coding: utf-8 -*-
from .base import BaseTool
from .base import PrintUtils,CmdTask,FileUtils,AptUtils,ChooseTask
from .base import osversion,osarch
from .base import run_tool_file

class Tool(BaseTool):
def __init__(self):
self.name = "一键安装opencv4.5.0及opencv_contrib4.5.0"
self.type = BaseTool.TYPE_INSTALL
self.autor = 'bingcm'

def install_nodejs(self):
PrintUtils.print_info("安装基本依赖")
CmdTask('sudo apt-get install -y build-essential libgtk2.0-dev libgtk-3-dev libavcodec-dev libavformat-dev libjpeg-dev libswscale-dev libtiff5-dev cmake libeigen3-dev ')
CmdTask('sudo apt install -y libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libpng-dev libopenexr-dev libtiff-dev libwebp-dev libgoogle-glog-dev ')
CmdTask('sudo apt-get install -y python-dev python3-dev libssl-dev')
PrintUtils.print_info("基本依赖安装完毕,开始下载4.5.0的opencv及opencv_contrib")
# 根据系统架构下载不同版本的安装包
# CmdTask('mkdir -p ./env/',os_command=True).run()
# CmdTask('wget https://gitee.com/opencv/opencv/repository/archive/4.6.0 -O ./env/opencv',os_command=True).run()
# CmdTask('wget https://gitee.com/opencv/opencv_contrib/repository/archive/4.6.0 -O ./env/opencv_contrib',os_command=True).run()
PrintUtils.print_info("下载完成,接下来为你解压安装")
CmdTask("cd env",os_command=True).run()
CmdTask("unzip opencv",os_command=True).run()
CmdTask("unzip opencv_contrib",os_command=True).run()
CmdTask("mv opencv_contrib-4.6.0 opencv-4.6.0",os_command=True).run()
PrintUtils.print_info("文件解压完毕,开始编译")
CmdTask("cd opencv-4.6.0/",os_command=True).run()

CmdTask("cd .cache/",os_command=True).run()
CmdTask("git clone https://gitee.com/bingcm/opencv_ippiv.git",os_command=True).run()
CmdTask("mv opencv_ippiv/* ./",os_command=True)
CmdTask("cd ..",os_command=True).run()

CmdTask("mkdir build",os_command=True).run()
CmdTask("cd build",os_command=True).run()



CmdTask("cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D ENABLE_NEON=OFF -D ENABLE_FAST_MATH=ON -D WITH_GSTREAMER=ON -D WITH_LIBV4L=ON -D BUILD_opencv_python2=OFF -D BUILD_opencv_python3=ON -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_EXAMPLES=OFF -D WITH_TBB=ON -D BUILD_opencv_world=OFF -D BUILD_opencv_xfeatures2d=OFF -D WITH_OPENGL=ON -D WITH_GTK_2_X=ON -D OPENCV_ENABLE_NONFREE=ON -D EIGEN_INCLUDE_PATH='/usr/include/eigen3' -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib-4.5.0/modules -D WITH_XINE=ON -D WITH_GDAL=ON -D OPENCV_GENERATE_PKGCONFIG=ON .. ",os_command=True).run()

CmdTask("make -j4",os_command=True).run()

def run(self):
self.install_nodejs()

0 comments on commit 1f42df8

Please sign in to comment.