summaryrefslogtreecommitdiff
path: root/PKGBUILD
blob: 99ef5534d9ea2104d617dde1836900049aaea540 (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
# Maintainer: jc_gargma <jc_gargma@iserlohn-fortress.net>
# Maintainer (Arch): Christian Hesse <mail@eworm.de>

# I maintain this because:
# AUR version lacks additional optimization and hardening flags

pkgname=tmux
pkgver=3.5_a
pkgrel=1
pkgdesc='Terminal multiplexer'
url='https://github.com/tmux/tmux/wiki'
arch=('x86_64')
license=('BSD')
depends=('libevent' 'libevent_core-2.1.so'
         'libutempter'
         'ncurses' 'libncursesw.so')
# # For some reason this breaks compiling. "error: C compiler cannot create executables"
# # But old-fashioned raw injection of -flto=auto via export doesn't.
options=('!lto')
source=("https://github.com/tmux/tmux/releases/download/${pkgver/_/}/tmux-${pkgver/_/}.tar.gz")
sha256sums=('16216bd0877170dfcc64157085ba9013610b12b082548c7c9542cc0103198951')
b2sums=('2314bc127f805071c9f2fe28be549b0948042a153aa68d997efc1dc0d6eba198b04aa16932d0a84b03250567100fb81c464919fcc8ba98660d3d0750ff5fe879')


build() {
  cd "$pkgname-${pkgver/_/}"

  export CFLAGS="$CFLAGS -O3 -fstack-protector-all -fPIE -flto=auto"
  export CXXFLAGS="$CXXFLAGS -O3 -fstack-protector-all -fPIE -flto=auto"
  export LDFLAGS="$LDFLAGS,-pie"

  ./configure \
    --prefix=/usr \
    --enable-sixel \
    --enable-utempter
  make
}

package() {
  cd "$pkgname-${pkgver/_/}"

  make install DESTDIR="$pkgdir"
  install -D -m0644 COPYING "$pkgdir/usr/share/licenses/tmux/LICENSE"
}