summaryrefslogtreecommitdiff
path: root/PKGBUILD
blob: 2643add66f350a3e74f44d5d641b0940cd3c4df8 (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
# Maintainer: jc_gargma <jc_gargma@iserlohn-fortress.net>
# Maintainer (Arch): Gaetan Bisson <bisson@archlinux.org>
# Contributor (Arch): dorphell <dorphell@archlinux.org>

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

pkgname=w3m
_gitcommit=edc602651c506aeeb60544b55534dd1722a340d3
_pkgver=0.5.3.git20230713-1
pkgver=${_pkgver/-/_}
pkgrel=1
pkgdesc='Text-based Web browser as well as pager'
url='https://salsa.debian.org/debian/w3m'
license=('custom')
arch=('x86_64')
# # 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)
makedepends=('git' 'imlib2')
optdepends=('imlib2: for graphics support')
depends=('openssl' 'gc' 'ncurses' 'gpm')
source=("git+https://salsa.debian.org/debian/w3m.git#commit=${_gitcommit}")
sha256sums=('SKIP')

# There's also the maintainer's github repo, usually in sync with Debian's:
# https://github.com/tats/w3m

build() {
  cd "${srcdir}/${pkgname}"

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

  ./configure \
    --prefix=/usr \
    --libexecdir=/usr/lib \
    --enable-image=x11,fb \
    --with-imagelib=imlib2 \
    --with-termlib=ncurses \
    --disable-w3mmailer \

  make
}

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

  install -d "${pkgdir}"/usr/share/{doc,licenses}/w3m
  install -m644 doc/* "${pkgdir}/usr/share/doc/w3m"
  ln -s ../../doc/w3m/README "${pkgdir}/usr/share/licenses/w3m"
}