Ubuntu 22.4 LTS 源码编译Tigervnc

1、安装前的依赖软件准备

复制代码
-- make version > 3.10
apt install cmake      

-- tigervnc依赖         
apt install zlib1g-dev libpixman-1-dev  libjpeg-turbo8-dev libfltk1.3-dev

apt install libsystemd-dev libavutil-dev

apt-get install gettext  libffmpeg-ocaml-dev libgmp-dev libnettle-dev  libgnutls28-dev libxi-dev

-- Xorg xserver使用
apt install xutils-dev 

以上依赖在cmake中都有检查,不存在会提示。

2、Xorg Xserver

软件仓地址:

Files · server-1.20-branch · xorg / xserver · GitLab

tigervnc 1.14的官方指导安装文档是基于 server-1.20-branch的,在这个版本以上的高版本都不存在configure.ac

3、安装tigervnc的官方指导构建

复制代码
Building the TigerVNC Server (Xvnc) is a bit trickier. Xvnc is typically built
to use the X11 shared libraries provided with the system.  The procedure for
this is system-specific, since it requires specifying such things as font
directories, but the general outline is as follows (this procedure assumes
that the viewer has already been built, per above.)

  > cd {build_directory}

    If performing an out-of-tree build:
  > cp -R {source_directory}/unix/xserver unix/

  > cp -R {xorg_source}/* unix/xserver/
    (NOTE: {xorg_source} is the directory containing the Xorg source for the
    machine on which you are building TigerVNC.  The most recent versions of
    Red Hat/CentOS/Fedora, for instance, provide an RPM called
    "xorg-x11-server-source", which installs the Xorg source under
    /usr/share/xorg-x11-server-source.)

  > cd unix/xserver/
  > patch -p1 < {source_directory}/unix/xserver{version}.patch
    (where {version} matches the X server version you are building, such as
    "120" for version 1.20.x.)
  > autoreconf -fiv

  > ./configure --with-pic --without-dtrace --disable-static --disable-dri \
      --disable-xinerama --disable-xvfb --disable-xnest --disable-xorg \
      --disable-dmx --disable-xwin --disable-xephyr --disable-kdrive \
      --disable-config-hal --disable-config-udev --disable-dri2 --enable-glx \
      --with-default-font-path="catalogue:/etc/X11/fontpath.d,built-ins" \
      --with-xkb-path=/usr/share/X11/xkb \
      --with-xkb-output=/var/lib/xkb \
      --with-xkb-bin-directory=/usr/bin \
      --with-serverconfig-path=/usr/lib64/xorg \
      {additional configure options}
    (NOTE: This is merely an example that works with Red Hat Enterprise/CentOS
    9 and recent Fedora releases.  You should customize it for your particular
    system.  In particular, it will be necessary to customize the XKB
    directory.)

    For a regular, in-tree build:
  > make TIGERVNC_SRCDIR={source_directory}
    If performing an out-of-tree build:
  > make TIGERVNC_SRCDIR={source_directory} TIGERVNC_BUILDDIR={build_directory}
    (NOTE: Use absolute paths for source_directory and build_directory)

值得一提的是,前几步是在构建xserver,直到make TIGERVNC_SRCDIR={source_directory}才是构建tigervnc。

该操作指导,是一个in-tree和out-of-tree是指xserver。xserver的构建是放在tigervnc源码的unix/xserver中构建,还是使用单独的目录构建,上文中的{build_directory}就是用用来存在xserver的代码,和tigervnc对xserver的扩展。

如果使用in-tree方式构建,直接将xserver源码copy到tigervnc的源码的unix/xserver目录中。

如果使用out-of-tree方式构建,则新建文件夹{build_directory},并创建Unix目录,将xserver源码copy到Unix目录中,将tigervnc对xserver的扩展hw也copy到Unix下。此种方式,在构建tigervnc时,需要在make命令中指定tigervnc的源码目录和新建的{build_directory}。

4、将构建后的二进制打包

在tigervnc源码目录中,执行make tarball,可将构建的所有文件打到一个tar包中。

5、不包含xserver的构建

在构建时,如果直接在tigervnc中执行构建,只能构建x0vncserver,xvnc不能得到构建,因为其依赖xserver,xvnc是tigervnc的核心。正如其介绍:

Xvnc - the TigerVNC Server for Unix. Xvnc is both a VNC server and an X

server with a "virtual" framebuffer. You should normally use the vncserver service to start Xvnc.

x0vncserver - an inefficient VNC server which continuously polls any X

display, allowing it to be controlled via VNC. It is intended mainly as a demonstration of a simple VNC server.

相关推荐
0+1113 小时前
Linux --从 poll 到 epoll多路转接
linux·服务器·1024程序员节
青瓦梦滋4 小时前
WebSocket协议
linux·服务器·网络·c++·websocket·网络协议·http
桌面运维家4 小时前
旧电脑跑不动课程软件,VDI云桌面怎样接着用?
运维·服务器·虚拟化·pve·vdi·云桌面
zhang133830890754 小时前
传统机械三杯式风速传感器易磨损冻堵?CG-88金属超声波风速风向传感器给出免运维方案
运维·服务器·网络·人工智能·自动化
知已难寻5 小时前
第 2 篇 · 云的地基:服务器、存储、网络三大基础设施
运维·服务器·网络·云原生·云计算·负载均衡·1024程序员节
2601_949847757 小时前
bcrypt.js 跨端三方库仓颉适配全流程
linux·运维·ubuntu
m0_639906947 小时前
Linux 操作系统入门:目录结构、服务排查常用命令、Shell 脚本基础
linux·运维·后端
今天重构了吗7 小时前
Linux 上 rm -rf 删错了能找回吗
运维·服务器
Smoothcloud润云8 小时前
GPU远程纳管安全吗?最小权限、网络边界与日志审计实战
服务器·网络·人工智能·安全·gpu算力·gpu
ai大模型-探索者8 小时前
Function Call与MCP(区别、联系与实战)
java·服务器·网络