Package Details: filen-desktop-git 3.0.53.r0.g370514d-1

Git Clone URL: https://aur.archlinux.org/filen-desktop-git.git (read-only, click to copy)
Package Base: filen-desktop-git
Description: Desktop client including Syncing, Virtual Drive mounting, S3, WebDAV, File Browsing, Chats, Notes, Contacts and more.Use system-wide electron.
Upstream URL: https://filen.io/
Keywords: client desktop drive explorer s3 sync virtual webdav
Licenses: AGPL-3.0-only
Conflicts: filen-desktop
Provides: filen-desktop
Submitter: zxp19821005
Maintainer: zxp19821005
Last Packager: zxp19821005
Votes: 1
Popularity: 0.000000
First Submitted: 2024-09-12 10:34 (UTC)
Last Updated: 2026-08-21 03:20 (UTC)

Latest Comments

spiraljng commented on 2026-08-21 03:42 (UTC)

@zxp19821005 Thank you for the quick reply!

  1. I did a bit of thinking on this. I do see where the conveinence factor comes in, but I do think that it does feel a bit out of character for the AUR. I think a better approach would to be setting a custom environment variable, like USE_NPM_MIRROR or something similar. Then, during the install process we can add in an error handler and tell the user that the connection to npm failed and recommend that they re-run it with something like USE_NPM_MIRROR=1 paru -S filen-desktop-git. Alternatively, you could skip the ENV middleman entirely and switch to the npm mirror upon error

  2. I stand corrected! I figured that it would break chroot environments, but seeing that exceptions were made for this exact reason, I fully agree that sticking with nvm is the right call here

As for the rest, I am happy to have been of help

zxp19821005 commented on 2026-08-21 02:15 (UTC) (edited on 2026-08-21 02:20 (UTC) by zxp19821005)

@spiraljng Thanks for the detailed review! I appreciate you taking the time to go through the PKGBUILD. Let me address a few of your points:

1. China IP Check

I understand the concern about chroot builds and AUR rules, and I agree it's not ideal. However, this check doesn't affect users outside China at all — it only adds a registry mirror for users inside China. For users in China, without this step the npm install step will almost certainly fail due to network restrictions, making the package unbuildable for them. I'd prefer to keep it as a convenience for Chinese users, but I'm open to discussing alternative approaches if you have suggestions.

2. NVM vs. System nodejs

Using nvm is actually the recommended approach on Arch for packages that need a specific Node.js version. The Arch wiki explicitly recommends nvm for managing Node versions in build environments — see the Node.js page on the Arch Wiki. Pinning to nodejs>=24 from the official repos could cause issues if the system node version drifts or if the project has strict version requirements. I'd like to keep nvm for version stability.

3. _get_electron_version

You're right that it appears unused — that's actually my oversight. I forgot to wire it into the build process, but it is necessary for correctly determining which Electron version to use. I'll make sure it's properly integrated in the next update. For the other points you raised — the ESLint sed quoting fix, the rclone/fetch.mjs not being executed, the .desktop file path, and the arch=('x86_64') change — those are all valid and I'll incorporate them. Thanks for catching those!

spiraljng commented on 2026-08-20 19:12 (UTC) (edited on 2026-08-20 19:34 (UTC) by spiraljng)

I was reading the PGKBUILD and noticed a few things that you should change to clean it up a bit:

  • You should probably remove the China IP check. Chinese users should take it upon themselves to change their npm registry, and I am fairly sure that it is against the AUR rules (or at the very least, it would break chroot builds). I understand you meant no harm by it, but it would be safer and stabler to skip it entirely

  • Using NVM to download node is redundant, seeing as we could just install node directly with Arch's official repos. I would suggest dropping the nvm dependency all-together and using nodejs>=24 or something similar

  • _get_electron_version seems to never be used. Kinda nit picky, but I'd remove it anyway just for readability

  • I changed to arch=('x86_64') because rclone is pre-compiled AMD64

  • While I was compiling this, I encountered an error with ESlint. I was able to fix it by changing line 88 to be find src -type f -exec sed -i "s/process.resourcesPath/\"\/usr\/lib\/${pkgname%-git}\"/g" {} + (the single quotes was what tripped it up)

  • Another issue i encountered while compiling was that rclone/fetch.mjs wasn't executed.

  • I noticed the .desktop file was being saved in the wrong place (Line 104)

After all my tinkering, here was the final PKGBUILD file I was left with.

# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
pkgname=filen-desktop-git
_pkgname="Filen Desktop"
pkgver=3.0.53.r0.g370514d
_electronversion=43
pkgrel=1
pkgdesc="Desktop client including Syncing, Virtual Drive mounting, S3, WebDAV, File Browsing, Chats, Notes, Contacts and more. Use system-wide electron."
arch=('x86_64')
url="https://filen.io/"
_ghurl="https://github.com/FilenCloudDienste/filen-desktop"
license=('AGPL-3.0-only')
conflicts=("${pkgname%-git}")
provides=("${pkgname%-git}=${pkgver%.r*}")
depends=(
    "electron${_electronversion}"
    'libjpeg6-turbo'
    'giflib'
)
makedepends=(
    'gendesk'
    'npm'
    'nodejs>=24'
    'git'
)
source=(
    "${pkgname%-git}.git::git+${_ghurl}"
    "${pkgname%-git}.sh"
)
sha256sums=('SKIP'
            'a774c2f54fbbeeaac3cefc0f7250796d30c86d27f0fd40b7eaf9c0fdb021623d')

pkgver() {
    cd "${srcdir}/${pkgname%-git}.git"
    set -o pipefail
    git describe --long --tags --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/v//g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}

_get_app_dir() {
    find "${srcdir}" -type f -name "resources.pak" -exec dirname {} + | head -n 1
}

_set_build_env() {
    export ELECTRON_DIST="/usr/lib/electron${_electronversion}"
    export ELECTRON_SKIP_BINARY_DOWNLOAD=1
    export SYSTEM_ELECTRON_VERSION="$(electron${_electronversion} -v | sed 's/v//g')"
    export HOME="${srcdir}/.electron-gyp"
    export NPM_CONFIG_CACHE="${srcdir}/.npm_cache"
    export NPM_CONFIG_MAXSOCKETS=32
}

prepare() {
    cd "${srcdir}/${pkgname%-git}.git"

    sed -i -e "
        s/@electronversion@/${_electronversion}/g
        s/@appname@/${pkgname%-git}/g
        s/@runname@/app.asar/g
        s/@cfgdirname@/${_pkgname}/g
    " "${srcdir}/${pkgname%-git}.sh"
    gendesk -q -f -n \
        --pkgname="${pkgname%-git}" \
        --pkgdesc="${pkgdesc}" \
        --categories="Utility" \
        --name="${pkgname%-git}" \
        --exec="${pkgname%-git} %U"

    _set_build_env
    sed -i "s/\"electron\": \"[^\"]*\"/\"electron\": \"${SYSTEM_ELECTRON_VERSION}\"/g" package.json

    # used double quotes
    find src -type f -exec sed -i "s/process.resourcesPath/\"\/usr\/lib\/${pkgname%-git}\"/g" {} +

    NODE_ENV=development npm install
}

build() {
    cd "${srcdir}/${pkgname%-git}.git"
    _set_build_env

    NODE_ENV=production npm run build

    # execute fetch.mjs
    node build/rclone/fetch.mjs

    NODE_ENV=production npm exec -c "electron-builder --linux dir -c.electronDist=${ELECTRON_DIST}"
}

package() {
    install -Dm755 "${srcdir}/${pkgname%-git}.sh" "${pkgdir}/usr/bin/${pkgname%-git}"

    install -Dm755 -d "${pkgdir}/usr/lib/${pkgname%-git}"
    local _app_dir=$(_get_app_dir)
    cp -a "${_app_dir}/resources/"* "${pkgdir}/usr/lib/${pkgname%-git}/"

    # fixed path
    install -Dm644 "${srcdir}/${pkgname%-git}.git/${pkgname%-git}.desktop" -t "${pkgdir}/usr/share/applications"

    icon_sizes=(16x16 24x24 32x32 48x48 64x64 128x128 256x256 512x512 1024x1024)
    for _icons in "${icon_sizes[@]}";do
        install -Dm644 "${srcdir}/${pkgname%-git}.git/build/icons/png/${_icons}.png" \
            "${pkgdir}/usr/share/icons/hicolor/${_icons}/apps/${pkgname%-git}.png"
    done

    install -Dm644 "${srcdir}/${pkgname%-git}.git/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

I hope this helps, and thank you for contributing