summaryrefslogtreecommitdiff
path: root/libre/netsurf/PKGBUILD
blob: a010df770fdb3c8fdfa62592710f4ecc6dd5911e (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
# Maintainer (arch): Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor: Paulo Matias <matiasΘarchlinux-br·org>
# Contributor: Georgij Kondratjev <smpuj@bk.ru>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
# Contributor: André Silva <emulatorman@hyperbola.info>
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>


# parabola changes and rationale:
# - remove/replace non-privacy remote services


pkgname=netsurf
pkgver=3.10
pkgrel=3
pkgrel+=.parabola1
pkgdesc='Lightweight and fast web browser'
pkgdesc+=', without non-privacy remote services'
arch=(x86_64)
arch+=(armv7h i686)
url='https://www.netsurf-browser.org/'
license=(MIT GPL2)
depends=(bash curl gtk3 'libhubbub=0.3.7' libjpeg-turbo 'libnsutils=0.1.0'
         'libutf8proc>=2.6.0' 'libwapcaplet>=0.4.3' 'libdom>=0.4.1' libwebp)
# vim is needed only for xxd when building
makedepends=(check inetutils 'libcss>=0.9.1' 'libnsbmp>=0.1.6'
             'libnsgif>=0.2.1' 'nsgenbind>=0.8' perl-html-parser setconf vim)
source=("https://download.netsurf-browser.org/netsurf/releases/source-full/netsurf-all-$pkgver.tar.gz"
        netsurf.sh)
source+=(remove_nonprivacy_options.patch)
sha256sums=('495adf6b6614ce36fca6c605f7c321f9cb4a3df838043158122678ce2b3325b7'
            '34c1f41c02ff3791a1b734197d99ec7f58c403dee05f0f9b7b9b3509d32b51ac')
sha256sums+=('0e5bf14693b932a718a2018689602376b08ff4e41f4530aa1e345180db9c8b43')


prepare() {
  cd "$pkgname-all-$pkgver/$pkgname"

  # Fix compilation issues
  sed -i 's:libutf8proc/::;s:UTF8PROC_CCC_VIRAMA:UTF8PROC_BIDI_CLASS_EN:' utils/idna.c
  # Use "netsurf" as the name of the executable in /usr/bin
  setconf frontends/gtk/res/netsurf-gtk.desktop 'Exec=netsurf %u'

  # remove/replace non-privacy remote services
  cd "${srcdir}"/$pkgname-all-$pkgver/
  echo "applying remove_nonprivacy_options.patch"
  patch -p1 -i ../remove_nonprivacy_options.patch
}

build() {
  CFLAGS="$CFLAGS -w -Os -funroll-loops" \
    make -C "$pkgname-all-$pkgver/$pkgname" \
    NETSURF_UA_FORMAT_STRING='"NetSurf/%d.%d (%s; Arch Linux)"' \
    TARGET=gtk3 \
    LIBDIR=lib \
    INCLUDEDIR=include \
    PREFIX=/usr
}

package() {
  make -C "$pkgname-all-$pkgver/$pkgname" \
    TARGET=gtk3 \
    LIBDIR=lib \
    INCLUDEDIR=include \
    DESTDIR="$pkgdir" \
    PREFIX=/usr \
    install

  # Launch script
  install -Dm755 $pkgname.sh "$pkgdir/usr/bin/$pkgname"

  cd "$pkgname-all-$pkgver/$pkgname"

  # Desktop icon and shortcut
  install -Dm644 frontends/gtk/res/$pkgname.xpm \
    "$pkgdir/usr/share/pixmaps/$pkgname.xpm"
  install -Dm644 frontends/gtk/res/$pkgname-gtk.desktop \
    "$pkgdir/usr/share/applications/$pkgname.desktop"

  # License
  install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}