Skip to content
On this page

TIP

This document is applicable to version 1.6.x, Please use the command ll-cli --version to check your LingLong program version.


Manifests

linglong.yaml is the description file of a Linglong project, which stores the relevant information required for building. Such as the name, version, source address, build dependencies, etc., of the build product.

Project directory structure

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

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

Field definitions

App meta info

yaml
package:
  id: org.deepin.calculator
  name: deepin-calculator
  version: 5.7.21.0
  kind: app
  description: |
    calculator for deepin os.
namedescription
descriptionDetailed description of the build product
idUnique name of the build product
kindThe type of build product: app, runtime, representing Application and Runtime
versionversion of the build product, require a four-digit number.

Base

The minimum root filesystem.

namedescription
idUnique name of the base
versionBase version, A three-digit number can be loosely matched with a potential fourth digit

Runtime

Describes the build and run dependencies of the application.

text
runtime: org.deepin.Runtime/23.0.1
namedescription
idUnique name of the runtime
versionRuntime version, A three-digit number can be loosely matched with a potential fourth digit

Source

Describes the source information.

yaml
sources:
  kind: git
  url: https://github.com/linuxdeepin/deepin-calculator.git
  version: master
  commit: d7e207b4a71bbd97f7d818de5044228c1a6e2c92
namedescription
kindSource code type, optional types git, file, archive, git
urlSource address, fill in when the type is archive or git
digestThe Hash value of archive file encrypted using sha256 algorithm, fill in when the type is archive or file
commitThe hash value of a source code commit, fill in when the type is git

Build rules

Describes the build rules.

yaml
build: |
  qmake -makefile PREFIX=${PREFIX} LIB_INSTALL_DIR=${PREFIX}/lib/${TRIPLET}
  make
  make install
namedescription
buildbuild rules at build time

Variables

Describes the variables that can be used by the build.

namedescription
PREFIXOne of the environment variables, which can be used under the variable and build fields; provide the installation path when buildingTRIPLET, such as /opt/apps/org.deepin.calculator
TRIPLETOne of the environment variables, which can be used under the variable and build fields; provide a triple containing architecture information, such as x86_64-linux-gnu

Complete example

Build Root FileSystem

bash
git clone [email protected]:linglongdev/org.deepin.foundation.git
cd org.deepin.foundation
bash build_base.sh eagle amd64

The project is designed to construct the root filesystem utilized by Linglong, with "eagle" referring to the codename of the distribution and "amd64" indicating the architecture.

Distribution versionArch
eagle (UOS 20)amd64、arm64、loongarch64
beige (deepin 23)amd64、arm64

Build runtime

yaml
git clone [email protected]:linglongdev/org.deepin.Runtime.git -b v23
cd org.deepin.Runtime
./depend-deb-list.sh | ./tools/download_deb_depend.bash
ll-builder build --skip-fetch-source

On the basis of the rootfs, add fundamental environments such as Qt.

Build app

calculator

yaml
version: "1"

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

command:
  - /opt/apps/org.deepin.demo/files/bin/deepin-calculator

base: org.deepin.foundation/23.0.0
runtime: org.deepin.Runtime/23.0.1

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

  - kind: git
    url: https://github.com/linuxdeepin/dde-qt-dbus-factory.git
    version: master

build: |
  # build dde-qt-dbus-factory
  cd /project/linglong/sources/dde-qt-dbus-factory.git
  qmake -makefile \
        PREFIX=${PREFIX} \
        LIB_INSTALL_DIR=${PREFIX}/lib/${TRIPLET} \
        INSTALL_ROOT=${PREFIX}

  make
  make install

  # build calculator
  cd /project/linglong/sources/deepin-calculator.git
  cmake -Bbuild \
        -DCMAKE_INSTALL_PREFIX=${PREFIX} \
        -DCMAKE_INSTALL_LIBDIR=${PREFIX}/lib/${TRIPLET}
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_SAFETYTEST_ARG="CMAKE_SAFETYTEST_ARG_OFF" \
        -DAPP_VERSION=5.7.21 \
        -DVERSION=5.7.21

  cmake --build build
  cmake --build build --target install