classfang / AIHub

一款集合多家大模型能力的客户端。拥有丰富的个性化功能。现已支持:OpenAI,Ollama,谷歌 Gemini,讯飞星火,百度文心,阿里通义,天工,月之暗面,智谱,阶跃星辰,DeepSeek 🎉🎉🎉。A collection of large model capabilities of the client. Has a wealth of personalized functions. English UI support.
Apache License 2.0
216 stars 29 forks source link

[Bugs] ArchLinux下编译失败 #1

Closed zxp19821005 closed 10 months ago

zxp19821005 commented 10 months ago

如题。 原本我看发行版里面没有关于Linux的,所以我想将其移植到ArchLinux的AUR。

环境信息

报错信息

The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
error during build:
Error: build entry field required for the electron vite main config
    at configResolved (/home/zxp-endeavouros/.cache/paru/clone/aihub/src/aihub/node_modules/electron-vite/dist/chunks/lib-30d3117e.js:260:31)
    at file:///home/zxp-endeavouros/.cache/paru/clone/aihub/src/aihub/node_modules/vite/dist/node/chunks/dep-R0I0XnyH.js:67760:24
    at Array.map (<anonymous>)
    at resolveConfig (file:///home/zxp-endeavouros/.cache/paru/clone/aihub/src/aihub/node_modules/vite/dist/node/chunks/dep-R0I0XnyH.js:67760:10)
    at async Module.build (file:///home/zxp-endeavouros/.cache/paru/clone/aihub/src/aihub/node_modules/vite/dist/node/chunks/dep-R0I0XnyH.js:66647:20)
    at async build (/home/zxp-endeavouros/.cache/paru/clone/aihub/src/aihub/node_modules/electron-vite/dist/chunks/lib-0b6fdb51.js:29:13)
    at async CAC.<anonymous> (/home/zxp-endeavouros/.cache/paru/clone/aihub/src/aihub/node_modules/electron-vite/dist/cli.js:80:9)

不论是使用npm还是使用yarn,都是报同样的错误。 部分PKGBUILD文件如下:

# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
pkgname=aihub
_pkgname=AIHub
pkgver=1.1.8
_electronversion=28
pkgrel=1
pkgdesc="A collection of large model capabilities, AI capabilities Electron client, with a minimalist interface, will support more AI capabilities in the future.一款集合众多大模型能力、AI能力的Electron客户端,具有极简的界面,将在未来支持更多AI能力."
arch=('any')
url="https://github.com/classfang/AIHub"
license=('Apache')
provides=("${pkgname}")
conflicts=("${pkgname}")
depends=(
    "electron${_electronversion}"
)
makedepends=(
    'npm'
    'nodejs'
    'gendesk'
    'git'
)
source=(
    "${pkgname}::git+${url}.git#tag=v${pkgver}"
    "${pkgname}.sh"
)
sha256sums=('SKIP'
            '5ce46265f0335b03568aa06f7b4c57c5f8ffade7a226489ea39796be91a511bf')
build() {
    sed -e "s|@electronversion@|${_electronversion}|" \
        -e "s|@appname@|${pkgname}|g" \
        -e "s|@appasar@|app.asar|g" \
        -i "${srcdir}/${pkgname}.sh"
    gendesk -q -f -n --categories "Utility" --name "${_pkgname}" --exec "${pkgname}"
    cd "${srcdir}/${pkgname}"
    sed '/- snap/d;/- deb/d' -i electron-builder.yml
    export npm_config_build_from_source=true
    #这个是npm的
    export npm_config_cache="${srcdir}/.npm_cache"
    export ELECTRON_SKIP_BINARY_DOWNLOAD=1
    export SYSTEM_ELECTRON_VERSION="$(electron${_electronversion} -v | sed 's/v//g')"
    export ELECTRONVERSION="${_electronversion}"
    npm install --force
    npm run build build:linux
    #这个是yarn的
    export npm_config_cache="${srcdir}/.npm_cache"
    export SYSTEM_ELECTRON_VERSION="$(electron${_electronversion} -v | sed 's/v//g')"
    export ELECTRONVERSION="${_electronversion}"
    yarn install --cache-folder "${srcdir}/.yarn_cache"
    yarn build build:linux
}
classfang commented 10 months ago

你可以尝试一下 yarn build:linux 命令,感谢你的关注。

zxp19821005 commented 10 months ago

感谢您的回复!最新的1.1.9版本成功编译。 AUR地址: