tools:在ubuntu 20.04上搭建weston环境

参考:

https://wayland.pages.freedesktop.org/weston/index.html

https://wayland.freedesktop.org/building.html

https://github.com/wayland-project/wayland-build-tools

1.git clone https://github.com/wayland-project/wayland-build-tools

Step 1: Install git, and clone the wayland-build-tools repository

        apt-get install -y git
        git clone git://anongit.freedesktop.org/wayland/wayland-build-tools

Where you place this repository is up to you.

Step 2: Prepare expected directories

        mkdir ~/Wayland # sources and builds will be here
        mkdir -p ~/.config/wayland-build-tools
        cp wl_defines.sh ~/.config/wayland-build-tools/

You can change these directories if you wish, but these are the defaults
and you'll need to edit the scripts to match. See WL_ROOT and WLD in
wl_defines.sh.

Step 3: Install packaged build dependencies

        ./wl_install_deps

Step 4: Clone the necessary repositories

        ./wl_clone

Step 5: Build upstream dependencies, Wayland, and Weston

        ./wl_build

Step 6: Run Weston

        source ~/.config/wayland-build-tools/wl_defines.sh
        weston

如 Readme,主要问题集中于第五步编译:

  1. 某些git库已经不需要【协议库】
  2. 缺少pkgconfig的path
  3. 某些源码需要meson/ninja编译
  4. libxfont需要打patch [已经更新,不再需要]
    maze@maze-VirtualBox:~/Wayland/libXfont$ git diff ./
    diff --git a/configure.ac b/configure.ac
    index e497325..f71ca0c 100644
    --- a/configure.ac
    +++ b/configure.ac
    @@ -54,6 +54,9 @@ AC_CHECK_HEADERS([endian.h poll.h sys/poll.h])
     AC_CHECK_FUNCS([poll readlink])
     AC_SEARCH_LIBS([strlcat], [bsd])
     AC_CONFIG_LIBOBJ_DIR([src/util])
    +if test "$ac_cv_search_strlcat" = "-lbsd"; then
    +  AC_DEFINE(HAVE_LIBBSD,1,[Has libbsd])
    +fi
     AC_REPLACE_FUNCS
  • 3
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
搭建 OpenCV 开发环境需要以下步骤: 1. 安装必要的依赖项 打开终端并执行以下命令: ``` sudo apt-get update sudo apt-get upgrade sudo apt-get install build-essential cmake git pkg-config libgtk-3-dev \ libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \ libxvidcore-dev libx264-dev libjpeg-dev libpng-dev libtiff-dev \ gfortran openexr libatlas-base-dev python3-dev python3-numpy \ libtbb2 libtbb-dev libdc1394-22-dev libopenexr-dev \ libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev ``` 2. 下载 OpenCV 在终端中执行以下命令: ``` cd ~ git clone https://github.com/opencv/opencv.git cd opencv git checkout 4.5.2 ``` 3. 编译和安装 OpenCV 在终端中执行以下命令: ``` cd ~/opencv mkdir build cd build cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D INSTALL_C_EXAMPLES=ON \ -D INSTALL_PYTHON_EXAMPLES=ON \ -D OPENCV_GENERATE_PKGCONFIG=YES \ -D WITH_TBB=ON \ -D WITH_V4L=ON \ -D WITH_QT=OFF \ -D WITH_OPENGL=ON \ -D WITH_CUDA=OFF \ -D BUILD_EXAMPLES=ON .. ``` 编译后,在终端中执行以下命令进行安装: ``` make -j$(nproc) sudo make install sudo ldconfig ``` 4. 验证 OpenCV 安装 创建一个名为 `test.cpp` 的文件,内容如下: ``` #include <opencv2/opencv.hpp> using namespace cv; int main() { Mat img = imread("test.jpg"); imshow("test", img); waitKey(0); return 0; } ``` 将 `test.jpg` 文件放在同一个目录下,然后在终端中执行以下命令: ``` g++ test.cpp -o test `pkg-config --cflags --libs opencv4` ./test ``` 如果一切正常,应该会看到 `test.jpg` 文件被打开并显示在屏幕上。 以上就是在 Ubuntu20.04搭建 OpenCV 开发环境的步骤。
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值