当前位置: 首页 > 工具软件 > Ninja UI > 使用案例 >

九、Gtk4-UI设计工具Cambalache和Drafting

谢胤
2023-12-01

1 基础环境

Ubuntu 22.04 adm64 (作者在Ubuntu20.04 arm64系统安装过,但是按照Gobject-intro包,会造成啊appindictor错误,无法开机进入桌面,由于知识水平和时间有限,没有寻找原因)

文中前一部分重复了第一节Gtk4编译过程(因为Cambalache需要broadway-backend=true)

2 基础依赖

sudo apt-get -y install libncurses5
sudo apt-get -y install libelf++0 libelf1 libelf-dev
sudo apt-get -y install libxml2 libxml2-dev libxml2-utils 
sudo apt-get -y install libxslt1-dev libxslt1.1
sudo apt-get -y install sysprof libpango1.0-dev
sudo apt-get -y install libpango-1.0-0 libpangocairo-1.0-0
sudo apt-get -y install libglib2.0-0 libglib2.0-dev
sudo apt-get -y install libxkbcommon-dev libxrandr-dev libxrender-dev
sudo apt-get -y install libxi-dev libxdamage-dev libxfixes-dev
sudo apt-get -y install libxext-dev libxcursor-dev libfontconfig-dev
sudo apt-get -y install libx11-dev libwayland-dev libpng-dev
sudo apt-get -y install libc6-dev libc6 libc6-amd64 libc++-10-dev
sudo apt-get -y install libc++-dev 
sudo apt-get -y install libpng++-dev libpng-dev libpng16-16 
sudo apt-get -y install libjpeg-dev libjpeg62 libjpeg8 libjpeg8-dev
sudo apt-get -y install libspectre-dev libspectre1
sudo apt-get -y install librsvg2-2 librsvg2-dev
sudo apt-get -y install libpixman-1-0 libpixman-1-dev
sudo apt-get -y install libxcb-shm0 libxcb-shm0-dev
sudo apt-get -y install cairo-5c
sudo apt-get -y install libicu-dev libthai-dev
sudo apt-get -y install libvulkan-dev libvulkan1
sudo apt-get -y install libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-dev
sudo apt-get update
sudo apt-get -y install libegl1-mesa libegl1-mesa-dev
sudo apt-get -y install libgles2-mesa-dev libglfw3-dev libglfw3
sudo apt-get -y install libglew-dev libglew2.1
sudo apt-get -y install ffmpeg libatk1.0-dev libglm-dev iso-codes
sudo apt-get -y install libgraphene-1.0-dev libgraphene-1.0-0 
sudo apt-get -y install sassc hicolor-icon-theme libglib2.0-0
sudo apt-get -y install libglib2.0-dev pkg-config bison gettext
sudo apt-get -y install xsltproc 
sudo apt-get -y install python3-dev
# 使用代理 --proxy=127.0.0.1:7890
sudo wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py
sudo python3 get-pip.py -i https://pypi.mirrors.ustc.edu.cn/simple/
sudo python3 -m pip install --upgrade pip -i https://pypi.mirrors.ustc.edu.cn/simple/
sudo python3 -m pip install --upgrade setuptools -i https://pypi.mirrors.ustc.edu.cn/simple/
sudo python3 -m pip install --upgrade wheel -i https://pypi.mirrors.ustc.edu.cn/simple/
sudo python3 -m pip install meson -i https://pypi.mirrors.ustc.edu.cn/simple/
sudo python3 -m pip install ninja -i https://pypi.mirrors.ustc.edu.cn/simple/
sudo python3 -m pip install cmake -i https://pypi.mirrors.ustc.edu.cn/simple/

2 glib-2.75

glib-2.75下载链接
gitlab或者github下载的包,会出现meson subproject meson.build错误

mkdir _build && cd _build && meson --prefix=/usr
ninja -j 8
sudo ninja install

3 vala-0.53.2

sudo apt-get install flex
sudo apt-get install bison
sudo apt-get install graphviz
sudo apt-get install make 
sudo apt-get install autoconf
sudo apt-get install autoconf-archive
sudo apt-get install automake
sudo apt-get install libtool

Graphviz (libgvc) (>= 2.16) to build valadoc
graphviz-7.0.6

# graphvize compile
./configure --prefix=/usr && make -j 8 && sudo make install

vala-0.53.2

# vala compile
./autogen.sh --prefix=/usr && make -j 8 && sudo make install

4 gobject-introspection-1.75.4

gobject-introspection-1.75.4.tar.xz

mkdir _build && cd _build && meson --prefix=/usr
ninja -j 8 && sudo ninja install

5 wayland-1.21.0

wayland-1.21.0

sudo apt install doxygen
sudo apt install xmlto
mkdir _build && cd _build && meson --prefix=/usr
ninja -j 8 && sudo ninja install

6 wayland-protocols-1.31

wayland-protocols-1.31

sudo apt install doxygen
sudo apt install xmlto
sudo apt install libxinerama-dev
sudo aptitude install libgstreamer-plugins-bad1.0-dev

mkdir _build && cd _build && meson --prefix=/usr
ninja -j 8 && sudo ninja install

7 gtk+ -3.24.36

at-spi2-core-AT_SPI2_CORE_2_42_1

sudo apt-get install libxtst-dev
mkdir _build && cd _build && meson --prefix=/usr
ninja -j 8 && sudo ninja install

AT_SPI2_ATK_2_38_0

sudo apt-get install libdbus-1-dev
mkdir _build && cd _build && meson --prefix=/usr
ninja -j 8 && sudo ninja install

gtk±3.24.36

# filename: meson_options.txt
option('broadway_backend', type: 'boolean', value: true,
  description : 'Enable the broadway (HTML5) gdk backend')
mkdir _build && cd _build && meson --prefix=/usr
ninja -j 8 && sudo ninja install

7 harfbuzz-5.3.1

mkdir _build && cd _build && meson --prefix=/usr
ninja -j 8 && sudo ninja install

8 gtk-4.8.3

gtk-4.8.3.tar.xz

# meson_options.txt设定broadway-backend=true 
option('broadway-backend',
       type: 'boolean',
       value: true,
       description : 'Enable the broadway (HTML5) gdk backend')
sudo apt install libepoxy-dev
mkdir _build && cd _build && meson --prefix=/usr
ninja -j 8 && sudo ninja install

9 libadwaita-1.2.1

libadwaita-1.2.1

mkdir _build && cd _build && meson --prefix=/usr
ninja -j 8 && sudo ninja install

错误:如果出现多个基类错误,升级vala

10 libhandy-1.6.3

libhandy-1.6.3

mkdir _build && cd _build && meson --prefix=/usr
ninja -j 8 && sudo ninja install

11 cambalache-0.10.3

cambalache-0.10.3

sudo pip install lxml -i https://pypi.mirrors.ustc.edu.cn/simple/
mkdir _build && cd _build && meson --prefix=/usr
ninja -j 8 && sudo ninja install
 类似资料: