summaryrefslogtreecommitdiff
path: root/libre/min/PKGBUILD
blob: 989253a284b0401eebb3b61cf89b4e2ae9735dbb (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
73
74
75
76
# $Id: PKGBUILD 199506 2016-12-15 13:30:22Z tensor5 $
# Maintainer (Arch): Nicola Squartini <tensor5@gmail.com>
# Maintainer: André Silva <emulatorman@parabola.nu>

pkgname=min
pkgver=1.5.1
pkgrel=1.parabola2
pkgdesc='A smarter, faster web browser, without non-privacy search engines'
arch=('any')
url='https://minbrowser.github.io/min'
license=('Apache')
depends=('electron')
makedepends=('nodejs-grunt-cli' 'npm')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/minbrowser/min/archive/v${pkgver}.tar.gz"
        'min.desktop'
        'min.js'
        'icon.patch'
        'remove_nonprivacy_options.patch')
sha256sums=('7ccaf8fbcc5b72093b4077b184fef68262b1a4d7d94c4b8cfae2a01b5bdefbd4'
            'a779a8daff1d684779ebc6d13ea4c2f09e838df018de41fa19fa3f25aa12e32f'
            'c22324184b72b3fad5a0aadb4e18182414e0294c5596c26426adc204fd473258'
            'f73d138d68f90e11a60128099b57eecb84a7d067e7f6883ff98924c5f4a61ea8'
            '76c8cc886007be01301c619b3ac1fc86369448e641ca9ae667a2cdd84b9c2276')

prepare() {
    cd ${pkgname}-${pkgver}

    patch -Np1 -i "${srcdir}"/icon.patch
    patch -Np1 -i "${srcdir}"/remove_nonprivacy_options.patch
}

build() {
    cd ${pkgname}-${pkgver}

    npm install grunt grunt-contrib-concat grunt-contrib-uglify
    grunt
    npm uninstall grunt grunt-contrib-concat grunt-contrib-uglify

    npm install --production
}

package() {
    cd ${pkgname}-${pkgver}

    appdir=/usr/lib/${pkgname}

    install -dm755 "${pkgdir}"${appdir}
    cp -r * "${pkgdir}"${appdir}

    install -dm755 "${pkgdir}"/usr/share/icons/hicolor/256x256/apps
    mv icons/icon256.png \
        "${pkgdir}"/usr/share/icons/hicolor/256x256/apps/${pkgname}.png

    install -Dm755 "${srcdir}"/${pkgname}.js "${pkgdir}"/usr/bin/${pkgname}
    install -Dm644 "${srcdir}"/${pkgname}.desktop \
            "${pkgdir}"/usr/share/applications/${pkgname}.desktop

    # Clean up
    rm "${pkgdir}"${appdir}/dist/{build,webview}.js
    rm -r "${pkgdir}"${appdir}/icons
    rm -r "${pkgdir}"${appdir}/main
    find "${pkgdir}"${appdir} \
        -name "package.json" \
            -exec sed -e "s|${srcdir}/${pkgname}-${pkgver}|${appdir}|" \
                -i {} \; \
        -or -name ".*" -prune -exec rm -r '{}' \; \
        -or -name "Gruntfile.js" -exec rm '{}' \; \
        -or -name "Makefile" -exec rm '{}' \; \
        -or -name "bower.json" -exec rm '{}' \; \
        -or -name "cmd.js" -exec rm '{}' \; \
        -or -name "coffee" -prune -exec rm -r '{}' \; \
        -or -name "example" -prune -exec rm -r '{}' \; \
        -or -name "gulpfile.js" -exec rm '{}' \; \
        -or -name "test" -prune -exec rm -r '{}' \; \
        -or -name "tests" -prune -exec rm -r '{}' \;
}