summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c36621b33d2588e0415bd71b73acbb89ed77309f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Maintainer: zhullyb <zhullyb [at] outlook dot com>
# Contributor: weearc <q19981121 [at] 163 dot com>
# Contributor: JimMoen <LnJimMoen [at] outlook dot com>
pkgname=motrix
_pkgname=Motrix
pkgver=1.8.19
pkgrel=3
epoch=
pkgdesc="A full-featured download manager (release version)"
arch=("x86_64")
url="https://github.com/agalwood/Motrix"
license=('MIT')
groups=()
depends=('gtk3' 'libxcb' 'electron22')
makedepends=('npm' 'yarn' 'nodejs' 'python')
checkdepends=()
optdepends=()
provides=()
conflicts=('motrix-git')
replaces=()
backup=()
options=()
install=
changelog=
source=("motrix.desktop"
    "motrix"
    "https://github.com/agalwood/Motrix/archive/v${pkgver}.tar.gz")
noextract=()
sha256sums=('c5f185162cdb83c387399e314be355585837a9efcd8ac35425656e4d24f7a5b3'
            'bb1432adbac2120ef5c59d718f1cd48ef5fc920d3d1231ba32390c700465f3a5'
            'd2a48692549d426e9dfa0fad9897dddf200b7b82198d59e64819d419114a10d8')
validpgpkeys=()

#_ensure_local_nvm() {
    # let's be sure we are starting clean
#    which nvm >/dev/null 2>&1 && nvm deactivate && nvm unload
#    export NVM_DIR="${srcdir}/.nvm"

    # The init script returns 3 if version specified
    # in ./.nvrc is not (yet) installed in $NVM_DIR
    # but nvm itself still gets loaded ok
#    source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]]
#}

#prepare() {
#    _ensure_local_nvm
#    nvm install 14
#}

build() {
    cd ${srcdir}/${_pkgname}-${pkgver}
#    _ensure_local_nvm
    export YARN_CACHE_FOLDER="${srcdir}/yarn_cache"
    yarn
    yarn run build:dir
}

package() {

    install -Dm 644 ${srcdir}/${_pkgname}-${pkgver}/release/linux-unpacked/resources/app.asar ${pkgdir}/usr/lib/${pkgname}/app.asar
    install -Dm 755 ${srcdir}/${_pkgname}-${pkgver}/release/linux-unpacked/resources/engine/aria2c ${pkgdir}/usr/lib/${pkgname}/engine/aria2c
    install -Dm 644 ${srcdir}/${_pkgname}-${pkgver}/release/linux-unpacked/resources/engine/aria2.conf ${pkgdir}/usr/lib/${pkgname}/engine/aria2.conf

    # binary wrapper
    install -Dm 775 ${srcdir}/motrix ${pkgdir}/usr/bin/${pkgname}

    # desktop enrty
    install -Dm 644 ${srcdir}/motrix.desktop ${pkgdir}/usr/share/applications/${pkgname}.desktop

    # icons
    install -Dm 644 ${srcdir}/${_pkgname}-${pkgver}/build/256x256.png ${pkgdir}/usr/share/icons/${pkgname}.png
}