summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7994c86d45a1fb8cbba73b5164e52cbb236be2d8 (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
# Maintainer: Mahdi Sarikhani <mahdisarikhani@outlook.com>
# Contributor: kleintux <reg-archlinux AT klein DOT tuxli DOT ch>
# Contributor: Nicola Squartini <tensor5@gmail.com>

pkgname=min
pkgver=1.33.1
pkgrel=1
pkgdesc='A fast, minimal browser that protects your privacy'
arch=('any')
url='https://minbrowser.org'
license=('Apache-2.0')
_electron=electron32
depends=('bash' "${_electron}" 'nodejs')
makedepends=('git' 'npm')
source=("https://github.com/minbrowser/min/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz"
        "${pkgname}.desktop"
        "${pkgname}.sh"
        'build.patch')
sha256sums=('f4d760323b5531910ea5c1af67e5a1f7f6169e0c0318c9103fd5e579a3ed4d38'
            'bca3356dbf5c783b44d5eb0919e0dbb263869f5d89224cc210d50610f67f3c3c'
            '6dcadaf3e1ae6e619569df9c5500c7786eaebd0f978df14476f92147bc7cd34f'
            'ac7c5ceaf6da8fbeeb2720aa2c11098dcaff4dde1254d022dbf804599020e0d6')

prepare() {
    cd "${pkgname}-${pkgver}"
    patch -Np1 -i "${srcdir}/build.patch"

    sed "s|@ELECTRON@|${_electron}|" -i "${srcdir}/${pkgname}.sh"
    sed -e "s|@ELECTRON_DIST@|/usr/lib/${_electron}|" \
        -e "s|@ELECTRON_VERSION@|$(cat /usr/lib/${_electron}/version)|" \
        -i scripts/createPackage.js

    npm install --omit=optional
}

build() {
    cd "${pkgname}-${pkgver}"
    npm run build
    node ./scripts/buildLinux.js
}

package() {
    cd "${pkgname}-${pkgver}"
    install -d "${pkgdir}/usr/lib"
    cp -r dist/app/linux-unpacked/resources "${pkgdir}/usr/lib/${pkgname}"
    install -Dm755 "${srcdir}/${pkgname}.sh" "${pkgdir}/usr/bin/${pkgname}"
    install -Dm644 "${srcdir}/${pkgname}.desktop" -t "${pkgdir}/usr/share/applications"
    install -Dm644 icons/icon256.png "${pkgdir}/usr/share/pixmaps/${pkgname}.png"
}