Skip to content
On this page

构建配置文件简介

linglong.yaml 是玲珑项目工程的描述文件,记录构建所需的相关信息。如构建产物的名称、版本、源码地址、构建依赖等。

工程目录结构

bash
{project-root}
├── linglong.yaml
└── .linglong-target

{user-home}
└── .cache
    └── linglong-builder
        ├── repo
        └── layers

字段定义

软件包元信息配置

yaml
package:
  id: org.deepin.calculator
  name: deepin-calculator
  version: 5.7.21
  kind: app
  description: |
    calculator for deepin os.
namedescription
description构建产物的详细描述
id构建产物的唯一名称
kind构建产物的类型:app、runtime、lib,依次代表应用、运行时、库
version构建产物的版本

运行时(runtime)

应用运行时依赖,同时也是构建依赖。

yaml
runtime:
  id: org.deepin.Runtime
  version: 23.0.0
  # NOT IMPLEMENTATION NOW
  digest: 4d85525f09211381c77d2085c9c1057

可简写为以下形式:

text
runtime:
  id: org.deepin.Runtime/23.0.0
namedescription
id运行时(runtime)的唯一名称
version运行时(runtime)版本
digest(暂未使用, 该字段可用来绑定唯一版本的运行时)

依赖项

描述应用的构建依赖与运行依赖。

yaml
depends:
  - id: dde-qt-dbus-factory
    version: 5.5.12
  - id: googletest
    version: 1.8.1
  - id: icu
    version: 63.1.0
    type: runtime
  - id: xcb-util
    version: 0.3.8.1
    type: runtime
namedescription
id依赖的唯一名称
type依赖的类型,类型为 runtime 的依赖,将会和构建内容一起被提交;未设置type时, 该依赖仅参与构建
version依赖的版本
digest(暂未使用,该字段可用来绑定唯一版本的依赖)

ll-builder在项目构建时将从远程存储库拉取dpends下包含的依赖到本地。若远程存储库不存在该依赖或其无法满足要求, 可新增source与build内容, ll-builder将优先构建包含source与build类型的依赖并应用到项目构建中。

yaml
depends: 
  - id: icu
    version: 63.1.0
    source:
      kind: git
      url: https://github.com/deepin-community/icu.git
      version: master
      commit: 3c651bcc40748fc5d02d9134fcaee14fda44ab62
    build:
      kind: autotools

源码

描述源码信息。

yaml
source:
  kind: git
  url: https://github.com/linuxdeepin/deepin-calculator.git
  version: master
  commit: d7e207b4a71bbd97f7d818de5044228c1a6e2c92
  patch: 
    - patches/fix-install-prefix-path.patch
    - patches/fix-lib-install-path.patch
namedescription
kind源码类型,可选类型 local、archive、git
url源码地址,类型为 archive、git 时填写
version源码分支版本,类型为 git 时填写
digest归档文件的hash值,使用sha256算法加密,类型为archive时填写
commit源码某次提交 hash 值,类型为 git 时填写
patch源码补丁路径

构建规则

描述构建规则。

yaml
build:
  kind: manual
  manual:
    configure: |
      mkdir build
      cd build
      qmake -r PREFIX=${PREFIX} ..
    build: |
      make -j
      make test
    install: |
      make -j install
yaml
build:
  kind: autotools
  manual: 
    configure: |
      ./bootstrap.sh 
namedescription
build构建时build规则
configure构建时configure规则
install构建时install规则
kind构建类型,可选类型 manual、autotools、cmake、qmake
manual构建规则,声明使用 manual 时,表示自定义规则,即对build、install、configure 重写

变量

描述构建可以使用的变量,配合build构建使用。

yaml
variables:
  build_dir: |
  dest_dir: |
  conf_args: |
    --prefix=${PREFIX}
    --libdir=lib/${TRIPLET}
  extra_args: |
    --doc=enable
  jobs: |
    -j64

build:
  kind: manual
  manual:
    configure: |
      ./configure ${conf_args} ${extra_args}
    build: |
      make ${jobs}
    install: |
      make DESTDIR=${dest_dir} install
namedescription
build_dir内置变量之一,variables字段下自定义赋值,build字段下使用
dest_dir同build_dir
conf_args同build_dir
extra_args同build_dir
jobs同build_dir
PREFIX环境变量之一,可在variable、build字段下使用;提供构建时的安装路径
TRIPLET环境变量之一,可在variable、build字段下使用;提供包含架构信息的三元组,如x86_64-linux-gnu

完整示例

构建应用

yaml
package:
  id: org.deepin.calculator
  name: deepin-calculator
  version: 5.7.21
  kind: app
  description: |
    calculator for deepin os.

runtime:
  id: org.deepin.Runtime
  version: 23.0.0

depends:
  - id: dde-qt-dbus-factory
    version: 5.5.12
  - id: googletest
    version: 1.8.1
  - id: icu
    version: 63.1.0
    type: runtime
  - id: xcb-util
    version: 0.3.8.1
    type: runtime

source:
  kind: git
  url: https://github.com/linuxdeepin/deepin-calculator.git
  version: master
  commit: d7e207b4a71bbd97f7d818de5044228c1a6e2c92

variables:
  extra_args: |
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_SAFETYTEST_ARG="CMAKE_SAFETYTEST_ARG_OFF" \
    -DAPP_VERSION=5.7.21 \
    -DVERSION=5.7.21

build:
  kind: cmake

构建依赖库

yaml
package:
  id: libopenjp2
  kind: lib
  version: 2.4.0

base:
  id: org.deepin.base
  version: 23.0.0

source:
  kind: git
  url: https://github.com/uclouvain/openjpeg
  version: 2.4.0
  commit: 37ac30ceff6640bbab502388c5e0fa0bff23f505

build:
  kind: cmake

构建运行时

yaml
package:
  id: org.deepin.Runtime
  kind: runtime
  version: 23.0.0
  description: |
    runtime of deepin

base:
  id: org.deepin.base/23.0.0

depends:
  - id: qtbase/5.15.7
  - id: qttranslations/5.15.7
  - id: qt3d/5.15.7
  - id: qtcharts/5.15.7
  - id: qtconnectivity/5.15.7
  - id: qtgamepad/5.15.7
  - id: qtsensors/5.15.7
  - id: qtspeech/5.15.7
  - id: qtvirtualkeyboard/5.15.7
  - id: qtserialport/5.15.7
  - id: qtnetworkauth/5.15.7
  - id: qttools/5.15.7
  - id: qtx11extras/5.15.7
  - id: qtdeclarative/5.15.7
  - id: qtsvg/5.15.7
  - id: qtscript/5.15.7
  - id: qtgraphicaleffects/5.15.7
  - id: qtquickcontrols/5.15.7
  - id: qtquickcontrols2/5.15.7
  - id: qtxmlpatterns/5.15.7
  - id: qtwayland/5.15.7
  - id: qtmultimedia/5.15.7
  - id: qtwebchannel/5.15.7
  - id: qtwebsockets/5.15.7
  - id: qtimageformats/5.15.7
  - id: qtlocation/5.15.7
  - id: spdlog/1.10.0
  - id: fmtlib/10.1.2
  - id: dtkcommon/5.6.0.3
  - id: dtkcore/5.6.0.9
  - id: dtkgui/5.6.0.13
  - id: dtkwidget/5.6.0.6
  - id: dtkdeclarative/5.6.0.7
  - id: qt5integration/5.6.0.5
  - id: qt5platform-plugins/5.6.0.5
  - id: libqtxdg/3.6.0.1
  - id: double-conversion/3.1.0.3
  - id: deepin-shortcut-viewer/5.0.6.1
  - id: fcitx-qt5/1.2.6.6
  - id: gsettings-qt/0.3.1.1
  - id: linglong-config/0.0.1.2

build:
  kind: manual
  manual:
    configure: |
      echo skip configure

package 类型为runtime时,将提交所有依赖内容。

构建工具模板

automake类型构建模板

autotools.yaml 提供了通用的 automake 类型构建模板, 模板文件如下:

yaml
variables:
  build_dir: build_dir
  conf_args: |
    --prefix=${PREFIX} \
    --libdir=${PREFIX}/lib/${TRIPLET}
  extra_args: |
  dest_dir: |
  jobs: -j${JOBS}

build:
  kind: autotools
  manual:
    configure: |
      #autogon.sh, bootstrap.sh
      autoreconf -ivf
      ./configure ${conf_args} ${extra_args}
    build: |
      make ${jobs}
    install: |
      make ${jobs} DESTDIR=${dest_dir} install

使用方法:

yaml
build:
  kind: autotools

qmake构建模板

qmake.yaml 提供了通用的 qmake 构建模板, 模板文件如下:

yaml
variables:
  build_dir: build_dir
  conf_args: |
    PREFIX=${PREFIX} \
    LIB_INSTALL_DIR=${PREFIX}/lib/${TRIPLET}
  extra_args: |
  dest_dir: |
  jobs: -j${JOBS}

build:
  kind: qmake
  manual :
    configure: |
      qmake -makefile ${conf_args} ${extra_args}
    build: |
      make ${jobs}
    install: |
      make ${jobs} DESTDIR=${dest_dir} install

使用方法:

yaml
build:
  kind: qmake

cmake构建模板

cmake.yaml 提供了通用的 cmake 构建模板, 模板文件如下:

yaml
variables:
  build_dir: build_dir
  conf_args: |
    -DCMAKE_INSTALL_PREFIX=${PREFIX} \
    -DCMAKE_INSTALL_LIBDIR=${PREFIX}/lib/${TRIPLET}
  extra_args: |
  dest_dir: |
  jobs: -j${JOBS}

build:
  kind: cmake
  manual :
    configure: |
      cmake -B ${build_dir} ${conf_args} ${extra_args}
    build: |
      cmake --build ${build_dir} -- ${jobs}
    install: |
      env DESTDIR=${dest_dir} cmake --build ${build_dir} --target install

使用方法:

yaml
build:
  kind: cmake

runtime 23.0.0 包含依赖项

idversion
qtbase5.15.7
qt3d5.15.7
qtcharts5.15.7
qtconnectivity5.15.7
qtgamepad5.15.7
qtsensors5.15.7
qtspeech5.15.7
qtvirtualkeyboard5.15.7
qtserialport5.15.7
qtnetworkauth5.15.7
qttools5.15.7
qtx11extras5.15.7
qtdeclarative5.15.7
qtsvg5.15.7
qtscript5.15.7
qtgraphicaleffects5.15.7
qtquickcontrols5.15.7
qtquickcontrols25.15.7
qtxmlpatterns5.15.7
qtwayland5.15.7
qtmultimedia5.15.7
qtwebchannel5.15.7
qtwebsockets5.15.7
qtimageformats5.15.7
qtlocation5.15.7
dtkcommon5.6.0.3
dtkcore5.6.0.9
dtkgui5.6.0.13
dtkwidget5.6.0.6
dtkdeclarative5.6.0.7
libqtxdg3.6.0.3
qt5integration5.6.0.5
double-conversion3.1.0.2
deepin-shortcut-viewer5.0.6.1
fcitx-qt51.2.6.6
gsettings-qt0.3.1.1
qt5platform-plugins5.6.0.5
spdlog1.10.0
fmtlib10.1.2

其他可用依赖

idversion
aria21.34.0
bzip21.0.6
cdparanoia3.10.2
dde-control-center5.5.23
dde-dock5.5.15
disomaster5.0.7
djvulibre3.5.27.1
ffmpeg4.1.8
ffmpegthumbnailer2.1.1
freeimage3.18.0
gio-qt0.0.11
gst-plugins-good1.01.14.5
gstreamer1.01.14.6
ilmbase2.2.1
image-editor1.0.9
jxrlib1.1.1
karchive5.54.0
kcodecs5.54.0
kconfig5.54.0
kcoreaddons5.54.0
kcrash5.54.0
kdbusaddons5.54.0
kglobalaccel5.54.0
ki18n5.54.0
kservice5.54.0
ksyntax-highlighting5.54.0
kwayland5.57.0
kwindowsystem5.54.0
leveldb1.20
libarchive3.3.3
libchardet1.0.4
libdbusmenu-qt0.9.3
libdmr5.9.13
libdv1.0.0
libepoxy1.5.3
libevent2.1.8
libraw0.19.2
libvisual0.4.0
libxrandr1.5.1
libxtst5.5.15
libzip1.5.1.8
minizip1.1.1
mpv0.29.1.37
opencv3.2.0
openexr2.2.1.4
procps3.3.15
qtdbusextended0.0.3
qtmpris0.1.0.1
sqlite33.27.2.3
taglib1.11.1
uchardet0.0.6
udisks2-qt55.0.3
vlc3.0.11
xcb-util0.3.8.1
icu63.1
dde-qt-dbus-factory5.5.12
gst-plugins-base1.01.14.4.2
libdvdnav6.0.0
libdvdread6.0.0
libical33.0.4
libva2.4.0
libxcursor1.1.15
orc0.4.28
poppler0.71.0.2
kmod26.1
pciutils3.5.2.4
xz-utils5.2.4.1
libxslt1.1.32.3
v4l-utils1.20.0
portaudio1919.6.0
gst-plugins-bad1.01.14.4.2
gst-plugins-ugly1.01.14.4.2
nettle3.4.1.2
aom1.0.0.1
codec20.8.1
libdc13942.2.5
libmysofa0.6
x2640.155.2917
x2652.9
xavs21.4.1
cunit2.1
lapack3.8.0.1
openblas0.3.5
crystalhd0.0.1
davs21.7.1
elfutils0.176.2