summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8f9e0c1d94d1762742e75a8e7bda2deee9ac60ed (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
87
88
89
90
91
92
93
94
95
96
97
98
99
# Maintainer icasdri <icasdri at gmail dot com>
# Contributor: Yardena Cohen <yardenack at gmail dot com>
# Contributor: Boohbah <boohbah at gmail.com>
# Contributor: Eric Belanger <eric at archlinux.org>
# Contributor: Daniel J Griffiths <ghost1227 at archlinux.us>
# Contributor: Wesley Merkel <ooesili at gmail.com>

##### OPTIONS ###############################################################

# Set the following variable accordingly:
#    * x if you would like to use x as the kill-process shortcut in htop
#    * d if you would like to use d as the kill-process shortcut in htop
# (we need one of these as htop's default shortcut k conflicts with vim
#  movement keys!)

kill_process_shortcut=x
#kill_process_shortcut=d

#############################################################################

_pkgname=htop
pkgname=htop-vim-solarized-git
pkgver=649.e906c0d
pkgrel=2
pkgdesc="Interactive process viewer with solarized and vim keybindings patch"
arch=('i686' 'x86_64')
url="https://github.com/hishamhm/${_pkgname}"
license=('GPL')
depends=('ncurses')
makedepends=('git' 'python2')
optdepends=('lsof: show files opened by a process'
            'strace: attach to a running process')
provides=('htop')
conflicts=('htop')
options=('!emptydirs')
source=("git+${url}.git"
        'solarized-colors.patch'
        'vim-keybindings-common.patch'
        )
sha256sums=('SKIP'
            '787042745bab62731ec14734d0bc3ae18e11dbb87cfed189942887a58f2cd6a7'
            'f85195b2280b660d2e9cbcb46630c66b879f14081f23016a845f4d4a46d2f030'
            )


# See the kill_process_shortcut option at the top of this PKGBUILD
if [[ "$kill_process_shortcut" == "d" ]]
then
    msg2 "Using '$kill_process_shortcut' as the kill-process shortcut in htop"
    source+=('vim-keybindings-d-for-kill.patch')
    sha256sums+=('b583caaab3fff1f28bd358f966ad33187a8f9bed607fec08607a030219db70d9')
else  # default to $kill_process_shortcut = x
    msg2 "Using 'x' as the kill-process shortcut in htop"
    source+=('vim-keybindings-x-for-kill.patch')
    sha256sums+=('dfdcd296508e725572f475308182d9a5d1a4cf7ae8c464f33b9907d92e243a09')
fi

pkgver() {
    cd "${srcdir}/${_pkgname}"
    local ver="$(git rev-list --count HEAD).$(git rev-parse --short HEAD)"
    printf "%s" "${ver//-/.}"
}

prepare() {
    cd "${srcdir}/${_pkgname}"

    for _p in "${source[@]}"
    do
        if [[ "$_p" == *.patch ]]
        then
            msg2 "Applying $_p"
            patch -p1 -i "../$_p"
        fi
    done

    ./autogen.sh

    sed -i 's|ncursesw/curses.h|curses.h|' RichString.[ch] configure
    sed -i 's|python|python2|' scripts/MakeHeader.py

    ./configure \
        --prefix=/usr \
        --enable-unicode \
        --enable-openvz \
        --enable-vserver \
        --enable-cgroup \
        --enable-oom
}

build() {
    cd "${srcdir}/${_pkgname}"
    make
}

package() {
    cd "${srcdir}/${_pkgname}"
    make DESTDIR="${pkgdir}" install
}