summaryrefslogtreecommitdiff
path: root/pcr/xombrero/PKGBUILD
blob: d2257a643f7cbde2bd62cd8a213e3dc307fa841a (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
77
78
79
80
81
82
83
84
85
86
# Maintainer (Arch): Kyle Keen <keenerd@gmail.com>

pkgbase=xombrero
#pkgname=('xombrero' 'xombrero3')
pkgname=xombrero
#pkgname=xombrero3  # uncomment to package the gtk3 version instead
pkgver=1.6.3
pkgrel=2
pkgdesc="A minimalists web browser, vi-like but with traditional web browser behavior."
arch=('i686' 'x86_64')
url="https://opensource.conformal.com/wiki/xombrero"
_watch="https://opensource.conformal.com/snapshots/xombrero/"
license=('custom:ISC')
depends=('webkitgtk2' 'libbsd' 'desktop-file-utils')
if [[ "$pkgname" == "xombrero3" ]]; then
    depends=('webkitgtk3' 'libbsd' 'desktop-file-utils')
fi
install=$pkgbase.install
replaces=('xxxterm')
conflicts=('xxxterm')
options=('!emptydirs')
source=(http://opensource.conformal.com/snapshots/$pkgname/$pkgbase-$pkgver.tgz \
        LICENSE)
md5sums=('11248a0f40542265022e8dfe692644da'
         'f3eeb6e8b70a3dcccb8ee57daf584c9e')

build() {
    cd "$srcdir/$pkgbase-$pkgver"
    # no spam
    sed -i 's|https://www.cyphertite.com|https://archlinux.org|' xombrero.{c,conf,h}
    # relocations
    sed -i 's|/etc/ssl/cert.pem|/etc/ssl/certs/ca-certificates.crt|' xombrero.conf
    #sed -i 's|/usr/local/share/xombrero/style.css|/usr/share/xombrero/style.css|' xombrero.conf
    sed -i 's|/usr/local/share/|/usr/share/|' {unix.c,xombrero.conf,xombrero.h}
    cd ..

    mkdir -p build-gtk{2,3}
    if [[ "$pkgname" == "xombrero" ]]; then
        cp -R "$srcdir/$pkgbase-$pkgver" build-gtk2
        pushd "build-gtk2/$pkgbase-$pkgver"
        make PREFIX="/usr" -C linux GTK_VERSION=gtk2
        popd
    fi

    if [[ "$pkgname" == "xombrero3" ]]; then
        cp -R "$srcdir/$pkgbase-$pkgver" build-gtk3
        pushd "build-gtk3/$pkgbase-$pkgver"
        make PREFIX="/usr" -C linux GTK_VERSION=gtk3
        popd
    fi
}

# non-split aur compatibility function (remove for real split pkg)
package() {
    if [[ "$pkgname" == "xombrero" ]]; then
        package_xombrero
    elif [[ "$pkgname" == "xombrero3" ]]; then
        package_xombrero3
    fi
}

package_xombrero() {
    depends=('webkitgtk2' 'libbsd' 'desktop-file-utils')
    conflicts=('xxxterm' 'xombrero3')

    cd "$srcdir/build-gtk2/$pkgbase-$pkgver"
    mkdir -p "$pkgdir/usr/share/applications/"  # buggy makefile
    make PREFIX="/usr" DESTDIR="$pkgdir" install -C linux GTK_VERSION=gtk2
    install -Dm644 xombrero.conf     "$pkgdir/etc/skel/.xombrero.conf"
    install -Dm644 xombrero.desktop  "$pkgdir/usr/share/applications/xombrero.desktop"
    install -Dm755 config-checker.pl "$pkgdir/usr/bin/config-checker.pl"
    install -Dm644 "$srcdir/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

package_xombrero3() {
    depends=('webkitgtk3' 'libbsd' 'desktop-file-utils')
    conflicts=('xombrero')

    cd "$srcdir/build-gtk3/$pkgbase-$pkgver"
    mkdir -p "$pkgdir/usr/share/applications/"  # buggy makefile
    make PREFIX="/usr" DESTDIR="$pkgdir" install -C linux GTK_VERSION=gtk3
    install -Dm644 xombrero.conf     "$pkgdir/etc/skel/.xombrero.conf"
    install -Dm644 xombrero.desktop  "$pkgdir/usr/share/applications/xombrero.desktop"
    install -Dm755 config-checker.pl "$pkgdir/usr/bin/config-checker.pl"
    install -Dm644 "$srcdir/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}