GIMP-2.10编译说明

2023-12-08  本文已影响0人  Wancho

目标版本

GIMP 2.10.34 Released: GEGL, babl

安装编译依赖

本文档使用的Linux发行版是Ubuntu 22.04.3 LTS

安装编译工具链

sudo apt update
sudo apt install meson

安装编译依赖

sudo cp /etc/apt/sources.list /etc/apt/sources.list~
sudo sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list
sudo apt-get update

sudo apt build-dep gimp

Building GIMP for Linux: Debian flavors and derivatives using apt

配置编译环境

创建环境变量脚本

mkdir ~/gimp && cd ~/gimp

touch definitions.sh

拷贝以下内容至~/gimp/definitions.sh

export GIMP_PREFIX=${HOME}/gimp/prefix
 
# Used to find programs/tools during build
export PATH="${GIMP_PREFIX}/bin:$PATH"

# Used to detect the build dependencies
export PKG_CONFIG_PATH="${GIMP_PREFIX}/share/pkgconfig:${GIMP_PREFIX}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
# Assuming a 64-bit build. Remove otherwise.
export PKG_CONFIG_PATH="${GIMP_PREFIX}/lib64/pkgconfig:$PKG_CONFIG_PATH"

# Used to find the glib-introspection dependencies
export XDG_DATA_DIRS="${XDG_DATA_DIRS:+$XDG_DATA_DIRS:}${GIMP_PREFIX}/share:/usr/local/share:/usr/share"

# Used to find the libraries at runtime
export LD_LIBRARY_PATH="${GIMP_PREFIX}/lib:${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"

# Used by Autotools to find its tools
export ACLOCAL_FLAGS="-I $INSTALL_PREFIX/share/aclocal $ACLOCAL_FLAGS"

# Used to find introspection files
GI_TYPELIB_PATH="${GIMP_PREFIX}/lib/girepository-1.0:${GI_TYPELIB_PATH:+:$GI_TYPELIB_PATH}"

arch="$(dpkg-architecture -qDEB_HOST_MULTIARCH 2> /dev/null)"
export PKG_CONFIG_PATH="${GIMP_PREFIX}/lib/${arch}/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="${GIMP_PREFIX}/lib/${arch}:${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
export GI_TYPELIB_PATH="${GIMP_PREFIX}/lib/${arch}/girepository-1.0:${GI_TYPELIB_PATH:+:$GI_TYPELIB_PATH}"

使环境变量生效

source ~/gimp/definitions.sh

Building GIMP: Preparing for Building

下载代码

cd ~/gimp

git clone https://gitlab.gnome.org/GNOME/babl.git
git clone https://gitlab.gnome.org/GNOME/gegl.git
git clone https://gitlab.gnome.org/GNOME/gimp.git

Building GIMP: Download with git

编译

babl

cd ~/gimp/babl

git checkout BABL_0_1_102

meson _build \
    --prefix=${GIMP_PREFIX} \
    --buildtype=release \
    -Db_lto=true

cd _build
ninja
ninja install

GEGL

cd ~/gimp/gegl

git checkout GEGL_0_4_42

meson _build \
    --prefix=${GIMP_PREFIX} \
    --buildtype=release \
    -Db_lto=true

cd _build
ninja
ninja install

GIMP

cd ~/gimp/gimp

git checkout GIMP_2_10_34

./autogen.sh --disable-python --prefix=${GIMP_PREFIX}

make -j8 #用编译机器的CPU核心数代替数字8
make install

Building GIMP: Build the source code

运行

(source ~/gimp/definitions.sh ; $GIMP_PREFIX/bin/gimp-2.10)
上一篇 下一篇

猜你喜欢

热点阅读