Explore the field guideDocumentationField guidesCommunitySearchStoreJournal

2024-09-30

Application building, part 5: openKylin 2.0 and tar archives

Turn a tar-archive application into a Linyaps project on openKylin 2.0, following the original preparation and packaging example.

On this pageBuilding Linyaps applications on openKylin 2.0Linyaps conversion of tar archive format

Building Linyaps applications on openKylin 2.0

The original text is reproduced from: https://bbs.deepin.org/post/278738

Author:Ziggy


Linyaps conversion of tar archive format

After completing the previous running demonstration, we are about to start showing the effect of Linyaps conversion of the tar archive format. The complete explanation here is to use the tar archive format to compress and encapsulate Linux application binary files. Let’s choose one here Java based Application 几何画板5 , In order to ensure a high degree of standardization and reserve development space for possible future automation, the projects I will demonstrate later have normative characteristics, including but not limited to: Directory standardization and construction process standardization et al.
It should be noted that currently Linyaps’ own running environment Foundation or Runtime does not currently contain jre related libraries , so if we need to run Java based applications in Linyaps containers, we need to Built-in jre running environment in the program directory . In addition, for general graphical applications, a good experience should also include desktop files and icon files to ensure that ordinary users can start the application through the launcher.

Material Requirements

Therefore, the following files will be used in this case:

  1. Java based applications that need to be converted 几何画板5 Binaries Corresponding tar archive compressed package
  2. OpenJDK Binaries Corresponding tar archive compressed package
  3. Java based applications that need to be converted Icon file
  4. Java based applications that need to be converted desktop file

As you can see, our case contains two tar archive compressed packages, the contents of which are binary program files.

Preparation

Since the Linyaps build tool still has the function of decompressing the tar archive compressed package, I recommend that you decompress the compressed package into the project in advance and prepare other materials before building the project.
In order to save time, I have prepared the above files and decompressed the compressed package to show you the structure of several important directories.

Build directory structure:

ziggy@kylin-standardpc:~/linglong-build$ tree -L 1
.
├── binary
├── linglong.yaml
├── template_app
2-1.png

Icon, desktop file resource directory structure (template_app):

template_app/
├── applications
│   └── geogebra.desktop
└── icons
    └── hicolor
        ├── 128x128
        │   ├── apps
                └── geogebra.png
2-2.png

During the whole process, we need to focus on two files that need to be changed:

desktop file.

The Exec field must match the path, application id, and execution command after the Linyaps project is built. The execution command is the same as mentioned below. yaml configuration file The "command" value in remains consistent.

**"command"** value in the case yaml configuration file:

command:
  - /opt/apps/org.geogebra.geogebra5/files/bin/start.sh

The Icon field takes into account the current compatibility differences on different distributions, so it is recommended to fill it in directly here. Absolute path Otherwise, the icon may not be displayed

Directory paths for reference:

## desktop应用启动文件Exec
Exec=/opt/apps/$id/$version/files/bin/start.sh

## 应用Icon目录
Icon=/var/lib/linglong/layers/main/$id/$version/x86_64/binary/entries/share/icons/hicolor

Two points to note:

  1. Generally, icon files of different sizes are stored in the hicolor directory. It is recommended to fill in the path of the specific icon file in the Icon field of the desktop application startup file after selecting the appropriate size.
  2. ** here id *** refers to Linyaps application id , ***version** refers to the installed version number of the Linyaps application, and the specific actual value needs to be filled in
[Desktop Entry]
Name=GeoGebra5
Name[zh_CN]=几何画板5
GenericName=Dynamic mathematics software
Comment=Create interactive mathematical constructions and applets.
Comment[zh_CN]=免费的课堂活动数字工具, 用于绘图计算, 几何作图, 白板协作等等
Exec=/opt/apps/org.geogebra.geogebra5/files/bin/start.sh %U
Icon=/var/lib/linglong/layers/main/org.geogebra.geogebra5/0.0.0.1/x86_64/binary/
     files/share/icons/hicolor/256x256/apps/geogebra.png
Type=Application
StartupWMClass=geogebra-GeoGebra
Categories=Education;Math;
MimeType=application/vnd.geogebra.file;application/vnd.geogebra.tool;

Terminal=false
StartupNotify=true
2-3.png

yaml configuration file.

At present, what I am sharing with you is the file after modular transformation. You mainly modify the following variable contents and the specific contents written to start.sh.
Due to standardized design, the jre runtime directory is uniformly set to $PREFIX/bin/jdk, so we mainly modify the directory where the program installation file is located, which is the penultimate line of the template. After confirming that all the content has been modified and preparations are complete, we can start building the export project.

  echo "cd $PREFIX/bin/geogebra5/bin/ && ./geogebra5-desktop" >> $PREFIX/bin/start.sh
2-4.png
Variables need to be replaced Explanation
LL_APPID Linyaps application id
LL_NAME Linyaps application name
LL_VERSION Linyaps application version

After the build is completed, we perform debugging in the project directory to see if it runs normally

ziggy@kylin-standardpc:~/linglong-build$ ll-builder run
2-5.png

English edition: Linglong editorial · 18 October 2026. Original publication: 2024-09-30.