summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ab555cf26d674741d34d110b0002eaef681bb3ec (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
# Maintainer: Alfonso Saavedra "Son Link" <sonlink.dourden@gmail.com>
# Maintainer: Hexchain Tong <i at hexchain dot org>
pkgname=megasync
pkgver=2.9.8.0
_pkgver=${pkgver//./_}
pkgrel=1
pkgdesc="Sync your files to your Mega account. Official app"
arch=('i686' 'x86_64')
url="https://github.com/meganz/megasync"
license=('custom:MEGA LIMITED CODE REVIEW LICENCE')
conflicts=('megatools')
depends=('curl' 'c-ares' 'crypto++' 'libsodium' 'hicolor-icon-theme' 'qt5-base' 'libuv')
makedepends=('git' 'qt5-tools')
optdepends=('sni-qt: fix systray issue on KDE and LXQt')
source=("git+https://github.com/meganz/MEGAsync.git#commit=aee1443420234446534ddbd3513ee1d480f5533c")
md5sums=('SKIP')

prepare(){
    cd "$srcdir/MEGAsync"
    git submodule update --init --recursive
}

build(){
    cd "$srcdir/MEGAsync/src/MEGASync/mega"
    ./autogen.sh
    ./configure \
        --enable-gcc-hardening \
        --disable-silent-rules \
        --disable-megaapi \
        --with-cryptopp \
        --with-sodium \
        --with-zlib \
        --with-sqlite \
        --with-cares \
        --with-curl \
        --without-freeimage \
        --without-readline \
        --without-termcap \
        --disable-examples \
        --prefix=/usr

    cd "$srcdir/MEGAsync/src"
    qmake-qt5 CONFIG+="release" MEGA.pro
    lrelease-qt5 MEGASync/MEGASync.pro
    make
}

package (){
    cd "$srcdir/MEGAsync"
    install -Dm 644 LICENCE.md "$pkgdir/usr/share/licenses/megasync/LICENCE.md"
    install -Dm 644 installer/terms.txt "$pkgdir/usr/share/licenses/megasync/terms.txt"

    cd src/MEGASync
    install -Dm 755 megasync "$pkgdir/usr/bin/megasync"

    cd platform/linux/data
    install -Dm 644 megasync.desktop "$pkgdir/usr/share/applications/megasync.desktop"

    cd icons/hicolor
    for size in 16x16 32x32 48x48 128x128 256x256
    do
        install -Dm 644 "$size/apps/mega.png" "$pkgdir/usr/share/icons/hicolor/$size/apps/mega.png"
    done
}