summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c5430722b47c56d9d0aeaee730035b56797b5cf8 (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
# Maintainer: Pierre Schmitz <pierre@archlinux.de>

pkgname=proton-mail-export
pkgver=1.0.1
pkgrel=1
pkgdesc='Allows to export emails as eml files'
arch=('x86_64')
url='https://proton.me/support/proton-mail-export-tool'
license=('GPL-3.0-only')
depends=('gcc-libs' 'glibc')
makedepends=('git' 'cmake' 'clang' 'go' 'zip' 'unzip')
options=('!debug')
source=("git+https://github.com/ProtonMail/${pkgname}.git#tag=v${pkgver}")
sha256sums=('SKIP')

prepare() {
    cd "$pkgname"
    git submodule update --init --recursive
    # see https://github.com/ProtonMail/proton-mail-export/issues/4
    sed 's/^\s*execPath = etcpp::getExecutableDir();$/execPath = std::filesystem::current_path();/g' -i cli/bin/main.cpp
}

build() {
    cmake -B build -S "$pkgname" \
        -DCMAKE_BUILD_TYPE='None' \
        -DCMAKE_INSTALL_PREFIX='/usr' \
        -Wno-dev
    cmake --build build
}

check() {
    ctest --test-dir build --output-on-failure
}

package() {
    DESTDIR="$pkgdir" cmake --install build
    install -d -m 755 "$pkgdir/usr/lib"
    mv "$pkgdir"/usr/bin/*.so "$pkgdir/usr/lib"
    rm -rf "$pkgdir/usr/meta"
}