From e47fe9598c374b73bce2b1ed4f611a20bb26fb61 Mon Sep 17 00:00:00 2001 From: shenmo Date: Fri, 12 Sep 2025 22:56:18 +0800 Subject: [PATCH] support discord --- README.md | 5 +++ amd64/discord/build.sh | 89 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 README.md create mode 100755 amd64/discord/build.sh diff --git a/README.md b/README.md new file mode 100644 index 0000000..1826cbb --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# 打包的例子看HMCL + +# 拖github release 看 HMCL,如果上游直接有deb就看 github 仓库 + +# 从别的源偷包随便找一个就是 \ No newline at end of file diff --git a/amd64/discord/build.sh b/amd64/discord/build.sh new file mode 100755 index 0000000..17f4b8e --- /dev/null +++ b/amd64/discord/build.sh @@ -0,0 +1,89 @@ +#!/bin/bash +# Special thank to Shiroko, he give me the insight of coding in proper way + +################################# Here we import our tools +source /opt/bashimport/sbs-utils.bashimport +source /opt/bashimport/sbs-build-helper.bashimport + +if [ "$1" = "amd64" ] || [ "$1" = "x64" ];then +ARCH="amd64" +ARCH_ANOTHERWAY="-amd64" +ARCH_STORE_PATH="amd64-store" +elif [ "$1" = "arm64" ] || [ "$1" = "arm" ];then +ARCH="arm64" +ARCH_ANOTHERWAY="-aarch64" +ARCH_STORE_PATH="arm64-store" +elif [ "$1" = "loong64" ];then +ARCH="loong64" +ARCH_ANOTHERWAY="-loong64" +ARCH_STORE_PATH="loong64-store" +else +log.error "Err:Invalid Architecture" +exit 1 +fi + +################################# Here we set the configs +REALPATH=`realpath $0` +HERE_PATH=`dirname $REALPATH` +REPO_PATH="${REPO_PATH:-/root/store-dir/}" +WORKDIR=`mktemp -d` + +PKG_NAME="discord" +APP_NAME="Discord" +SOURCE_LIST_FILE="discord.list" +GITHUB_REPO="" +VERSION="" #Here we use other way to get version so do not write here +TAGS="ubuntu;deepin;uos;debian" +CATAGORY="chat" #https://gitee.com/deepin-community-store/spark-store/blob/dev/DOCS/spk-doc.md +DETAIL="Discord,聊天软件,是一家游戏聊天应用与社区,Discord从游戏语音、IM工具服务起家,随后转向直播平台,进而开设游戏商店的社区平台,成为游戏玩家在游戏中沟通协作的首选工具" # This should be written as json format +MAINTAINER="shenmo" +HOMEPAGE="https://discord.com" + +STORE_APP_PATH="${REPO_PATH}/${ARCH_STORE_PATH}/${CATAGORY}/${PKG_NAME}/" +################################# Fill the variables below only if you use write_control function + +SECTION="" +PRIORITY="" +DEPENDS="" +DESCRIPTION_SHORT="" +DESCRIPTION_LONG="" +PROVIDES="" +REPLACES="" +RECOMMENDS="" + + + + +function prepare(){ +# aptss_get_update + PKG_VER_APTSS=`get_version_from_source_list_file ${PKG_NAME}:${ARCH} /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore${ARCH_ANOTHERWAY}.list` + PKG_VER_UPSTREAM=`get_version_from_source_list_file ${PKG_NAME}:${ARCH} /etc/apt/sources.list.d/${SOURCE_LIST_FILE}` + compare_version ${PKG_VER_APTSS} ${PKG_VER_UPSTREAM} + # Compare version will also give the value to $VERSION + # Now we should have the $VERSION + if [ -e $VERSION ];then + log.error "VERSION is empty. This should not happen! exit." + fi +} + + + + +function build(){ + + + +pushd $WORKDIR +apt download ${PKG_NAME}:${ARCH}=${VERSION} +PKG_FILE="${PKG_NAME}_${VERSION}_${ARCH}.deb" +mv -v ${PKG_FILE} ${STORE_APP_PATH} +popd + +} + + +prepare +build +write_json $STORE_APP_PATH + +rm -rf $WORKDIR