Skip to content

TIP

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


Manifests

linglong.yaml is the description file of a linyaps 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.dtk/23.1.0
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 and retrieve it in the 'linglong/sources' directory of the same level path as linglong.yaml.

The kind is Git

yaml
sources:
  kind: git
  url: https://github.com/linuxdeepin/deepin-calculator.git
  version: master
  commit: d7e207b4a71bbd97f7d818de5044228c1a6e2c92
namedescription
kindgit, Download using the Git tool
urlSource address, fill in when the type is archive or git
versionSource repository branches
commitThe hash value of a source code commit, fill in when the type is git

The kind is file

yaml
sources:
  kind: file
  url: https://github.com/linuxdeepin/deepin-calculator/archive/refs/tags/6.5.4.tar.gz
  digest: 9675e27395891da9d9ee0a6094841410e344027fd81265ab75f83704174bb3a8
namedescription
kindgit, Download file
urlFile download address
digestThe hash value of the file is encrypted using the sha256 algorithm

The kind is archive

bash
sources:
  kind: archive
  url: https://github.com/linuxdeepin/deepin-calculator/archive/refs/tags/6.5.4.tar.gz
  digest: 9675e27395891da9d9ee0a6094841410e344027fd81265ab75f83704174bb3a8
namedescription
kindarchive, Download the compressed file tar.tz and it will automatically decompress
urlFile download address
digestThe hash value of the file is encrypted using the sha256 algorithm

The kind is dsc

bash
sources:
  kind: dsc
  url: https://cdn-community-packages.deepin.com/deepin/beige/pool/main/d/deepin-calculator/deepin-calculator_6.0.1.dsc
  digest: ce47ed04a427a887a52e3cc098534bba53188ee0f38f59713f4f176374ea2141
namedescription
kinddsc, Source code package description file
urlFile download address
digestThe hash value of the file is encrypted using the sha256 algorithm

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 git@github.com: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 linyaps, 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 git@github.com: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.calculator/files/bin/deepin-calculator

base: org.deepin.base/23.1.0
runtime: org.deepin.runtime.dtk/23.1.0

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
    commit: d952e1913172c5507af080f644a654f9ba5fed95

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