diff --git a/arm64/linglong.yaml b/arm64/linglong.yaml index 0dd470f8..8f0c9a5f 100644 --- a/arm64/linglong.yaml +++ b/arm64/linglong.yaml @@ -25,6 +25,8 @@ build: | # 获取版本号 VERSION=$(head -1 debian/changelog | awk -F'[()]' '{print $2}') + # 使用sed命令替换version的值 + sed -i "s/^ version: .*/ version: ${VERSION}.1/" linglong.yaml cmake -B build ${conf_args} \ -DCMAKE_SAFETYTEST_ARG="CMAKE_SAFETYTEST_ARG_OFF" \ @@ -34,7 +36,15 @@ build: | -DVERSION=${VERSION} cmake --build build -j`nproc` - cmake --build build --target install + cmake --build build --target install > install.log 2>&1 + + # 项目生成应用名和动态隐式加载的依赖库,ldd无法找到的其他库 + LDD_FILES=( + deepin-font-manager + ) + + # 生成.install 文件 + bash ./deploy_dep "${LDD_FILES[@]}" sources: # - kind: git diff --git a/debian/changelog b/debian/changelog index 80036c10..021dc627 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +deepin-movie-reborn (6.5.2) unstable; urgency=medium + + * New version 6.5.2 + * Slimming down the linglong layer package. + + -- re2zero Fri, 27 Sep 2024 14:55:16 +0800 + deepin-font-manager (6.5.1) unstable; urgency=medium * feat: [translation]add transifex config(Task: 361363) @@ -9,7 +16,7 @@ deepin-font-manager (6.5.0) unstable; urgency=medium * New version 6.5.0 * Adapt linglong. --- re2zero Fri, 13 Sep 2024 14:06:16 +0800 + -- re2zero Fri, 13 Sep 2024 14:06:16 +0800 deepin-font-manager (6.0.4) unstable; urgency=medium diff --git a/deploy_dep b/deploy_dep new file mode 100644 index 00000000..808261dc --- /dev/null +++ b/deploy_dep @@ -0,0 +1,74 @@ +# SPDX-FileCopyrightText: 2023-2024 UnionTech Software Technology Co., Ltd. +# +# SPDX-License-Identifier: GPL-3.0-or-later + +#!/bin/bash +set -e + +# 生成安装目录/文件和运行时依赖的必要库 +# 获取应用id +ID_VALUE=$(awk -F ': ' '/^ id: / {print $2}' linglong.yaml) + +## 获取安装的文件列表并写入安装脚本(排除头文件、pc和cmake文件) +# cmake 安装 +if ! grep -- "-- Installing:" install.log | awk '{print $NF}' | grep -vE '\.(h|cmake|pc)$' > ${ID_VALUE}.install; then + echo "cmake install files are empty!" +fi +# qmake 安装 +if ! grep -- "-install qinstall" install.log | awk '{print $NF}' | grep -vE '\.(h|cmake|pc)$' >> ${ID_VALUE}.install; then + echo "qmake install files are empty!" +fi +# 动态库软连接 +if ! grep -- "^ln -f -s " install.log | awk '{print $NF}' >> ${ID_VALUE}.install; then + echo "Get library softlink empty!" +fi + +# glib-compile-schemas 文件添加到 install 文件 +for SCHEMAS in "${PREFIX}"/share/glib-2.0/schemas/gschema*; do + if [[ -f "$SCHEMAS" ]]; then + echo "$SCHEMAS" >> "${ID_VALUE}.install" + fi +done + +# 获取依赖的所有文件 +for LDFILE in "$@"; do + + # 判断文件是否以 .so 结尾 + if [[ "$LDFILE" == *.so ]]; then + FILE_PATH="${PREFIX}/lib/${TRIPLET}/$LDFILE" + + # 添加依赖库到 install 文件 + for SOFILE in "${PREFIX}/lib/${TRIPLET}"/${LDFILE}*; do + if [[ -f "$SOFILE" ]]; then + echo "$SOFILE" >> "${ID_VALUE}.install" + fi + done + else + FILE_PATH="${PREFIX}/bin/$LDFILE" + fi + + # 获取依赖库 + DEPENDENCIES=$(ldd "$FILE_PATH" | grep "$PREFIX") || continue + if [[ ! -z "$DEPENDENCIES" ]]; then + echo "$DEPENDENCIES" | while IFS= read -r line; do + LIB_PATH=${line##*=> } + LIB_PATH=${LIB_PATH%%(*} + + # 获取基本库名并匹配相关库 + LIB_DIR=$(dirname "$LIB_PATH") + BASE_LIB_NAME=$(basename "$LIB_PATH") + + # 使用通配符查找相关库文件并将结果倒序存储到 install 文件 + for FILE in "$LIB_DIR"/${BASE_LIB_NAME%.*}*; do + if [[ -f "$FILE" ]]; then + echo "$FILE" + fi + done | sort -r >> "${ID_VALUE}.install" + + done + fi +done + +# 排除静态链接库 +#echo '^'${PREFIX}'/'${TRIPLET}'/.+(?> "${ID_VALUE}.install" +#echo '^'${PREFIX}'/lib/.+(?> "${ID_VALUE}.install" \ No newline at end of file diff --git a/linglong.yaml b/linglong.yaml index 6bdbc0f8..32cf77eb 100644 --- a/linglong.yaml +++ b/linglong.yaml @@ -7,7 +7,7 @@ version: "1" package: id: org.deepin.fontmanager name: "deepin-font-manager" - version: 6.5.0.1 + version: 6.5.2.1 kind: app description: | font manager for deepin os. @@ -25,6 +25,8 @@ build: | # 获取版本号 VERSION=$(head -1 debian/changelog | awk -F'[()]' '{print $2}') + # 使用sed命令替换version的值 + sed -i "s/^ version: .*/ version: ${VERSION}.1/" linglong.yaml cmake -B build ${conf_args} \ -DCMAKE_SAFETYTEST_ARG="CMAKE_SAFETYTEST_ARG_OFF" \ @@ -34,7 +36,15 @@ build: | -DVERSION=${VERSION} cmake --build build -j`nproc` - cmake --build build --target install + cmake --build build --target install > install.log 2>&1 + + # 项目生成应用名和动态隐式加载的依赖库,ldd无法找到的其他库 + LDD_FILES=( + deepin-font-manager + ) + + # 生成.install 文件 + bash ./deploy_dep "${LDD_FILES[@]}" sources: # - kind: git