# Maintainer: Serge K # Contributor: Felix Golatofski # For Issues, Pull Requests # https://github.com/phnx47/pkgbuilds _pkgbin=ledger-live-desktop pkgname=ledger-live pkgdesc="Ledger Live - Desktop" pkgver=2.55.0 pkgrel=1 arch=('x86_64') url='https://github.com/LedgerHQ/ledger-live' license=('MIT') depends=('ledger-udev') makedepends=('python>=3.5' 'node-gyp' 'fnm' 'pnpm') _extdir=ledger-live--ledgerhq-live-desktop-${pkgver} source=("${_pkgbin}-${pkgver}.tar.gz::https://github.com/LedgerHQ/ledger-live/archive/refs/tags/@ledgerhq/live-desktop@${pkgver}.tar.gz") sha512sums=('28442dec3a9ac8f275e5bad4e2e3490dee23f02458eaf06851134bc62e0c0343278dbf82b9f2c904c17dd7a7bc56c83d651dfb3fe415787715ed9e5644c28b94') _fnm_use() { export FNM_DIR="${srcdir}/.fnm" eval "$(fnm env --shell bash)" fnm use --install-if-missing } _check_nodejs() { exp_ver=$(cat .nvmrc) use_ver=$(node -v) if [[ "${exp_ver}" != "${use_ver}" ]] then echo "Using the wrong version of NodeJS! Expected [${exp_ver}] but using [${use_ver}]." exit 1 fi } build() { cd "${_extdir}" _fnm_use _check_nodejs export GIT_REVISION=${pkgver} pnpm i --filter="ledger-live-desktop..." --filter="ledger-live" --frozen-lockfile --unsafe-perm pnpm build:lld:deps pnpm desktop build # Correct .desktop sed -e "s/AppRun --no-sandbox/${_pkgbin}/g" -i "apps/${_pkgbin}/dist/__appImage-x64/${_pkgbin}.desktop" sed -e "/X-AppImage-Version/d" -i "apps/${_pkgbin}/dist/__appImage-x64/${_pkgbin}.desktop" } package() { cd "${_extdir}/apps/${_pkgbin}" install -Dm644 "dist/__appImage-x64/${_pkgbin}.desktop" "${pkgdir}/usr/share/applications/${_pkgbin}.desktop" install -dm755 "${pkgdir}/opt/${pkgname}" cp -r "dist/linux-unpacked/." "${pkgdir}/opt/${pkgname}" install -dm755 "${pkgdir}/usr/bin" ln -s "/opt/${pkgname}/${_pkgbin}" "${pkgdir}/usr/bin/${_pkgbin}" install -Dm644 "build/icons/icon.png" "${pkgdir}/usr/share/icons/hicolor/64x64/apps/${_pkgbin}.png" for i in 128 256 512 1024; do install -Dm644 "build/icons/icon@${i}x${i}.png" "${pkgdir}/usr/share/icons/hicolor/${i}x${i}/apps/${_pkgbin}.png" done install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" }