summaryrefslogtreecommitdiff
path: root/libre/netsurf/PKGBUILD
blob: 79fce96075d39c042db807ccfc1b69aba856cda5 (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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# $Id: PKGBUILD 196979 2016-11-26 23:12:42Z arodseth $
# Maintainer (Arch): Alexander F Rødseth <xyproto@archlinux.org>
# Contributor (Arch): Paulo Matias <matiasΘarchlinux-br·org>
# Contributor (Arch): Georgij Kondratjev <smpuj@bk.ru>
# Contributor (Arch): Daniel J Griffiths <ghost1227@archlinux.us>
# Maintainer: André Silva <emulatorman@hyperbola.info>

pkgname=netsurf
pkgver=3.6
pkgrel=3.parabola1
pkgdesc='Lightweight and fast web browser, without non-privacy search engines'
arch=('x86_64' 'i686' 'armv7h')
url='http://www.netsurf-browser.org/'
license=('MIT' 'GPL2')
replaces=(${pkgname}-libre)
conflicts=(${pkgname}-libre)
depends=('libmng' 'librsvg' 'curl' 'lcms' 'desktop-file-utils'
         'libnsbmp>=0.1.4' 'libnsgif>=0.1.4' 'libcss>=0.6.1'
         'libdom>=0.3.1' 'libnsutils>=0.0.3' 'libutf8proc>=1.3.1'
         'gtk3' 'duktape')
makedepends=('re2c' 'netsurf-buildsystem' 'perl-html-parser' 'nsgenbind>=0.3'
             'inetutils' 'libutf8proc>1.3.1' 'git' 'setconf' 'check' 'gtk3'
             'duktape')
# git.netsurf-browser.org has an invalid https certificate
source=("git://git.netsurf-browser.org/netsurf.git#commit=c56ecfd924b16d15bf74385c4d556a6b7002e8a6"
        'openssl.patch'
        'netsurf.sh'
        'remove_nonprivacy_options.patch')
sha256sums=('SKIP'
            '0601ca86e59a40aa6feaaab9db0e79c4952b018c724f7255279d902a79d090d9'
            'f2e2f61f1864da57cafa74ffdbefac2f9e1d55d9627e82ef923d4931684c5c49'
            '61bec340c47a089b1b5c33d3ae330a340999a1e40be7fc8768fa572c6ca3b617')

prepare() {
  cd "$pkgname"

  patch -p1 -i "$srcdir/openssl.patch"
  sed 's:netsurf-gtk:netsurf:' -i frontends/gtk/res/netsurf-gtk.desktop
  sed 's:libutf8proc/::' -i utils/idna.c
  sed 's:UTF8PROC_CCC_VIRAMA:UTF8PROC_BIDI_CLASS_EN:' -i utils/idna.c
  sed 's:utf8proc_normalise:utf8proc_reencode:' -i utils/idna.c

  setconf Makefile.defaults NETSURF_USE_DUKTAPE YES
  setconf Makefile.defaults NETSURF_UA_FORMAT_STRING \
    '"NetSurf/%d.%d (%s; Parabola GNU/Linux-libre)"'

  # remove non-privacy search engines
  sed -i '\|Google|d
          \|Yahoo|d
          \|Bing|d
          \|Business.com|d
          \|Omgili|d
          \|BBC News|d
          \|Ubuntu Packages|d
          \|Ask[.]com|d
          \|Answers.com|d
          \|Youtube|d
          \|AeroMp3|d
          \|AOL|d
          \|Baidu|d
          \|Amazon|d
          \|Ebay|d
          \|IMDB|d
          \|ESPN|d
          s|DuckDuckGo|DuckDuckGo HTML|
          s|duckduckgo[.]com|duckduckgo.com/html|
          s|duckduckgo[.]com/html/favicon.ico|duckduckgo.com/favicon.ico|
          s|seeks-project.info|seeks.fr|g
         ' \!NetSurf/Resources/SearchEngines \
           resources/SearchEngines
  sed -i '\|readable name such as| s|google|duckduckgo|
          \|readable name such as| s|yahoo|seeks|
          \|host address such as www[.]google[.]com| s|google[.]com|duckduckgo.com/html|
          s|google[.]com?search=%s|duckduckgo.com/html/?q=%s|
          \|return strdup| s|google[.]com|duckduckgo.com/html|
          \|return strdup| s|google|duckduckgo|
          \|return strdup| s|duckduckgo[.]com/html/favicon[.]ico|duckduckgo.com/favicon.ico|
          s|www[.]google[.]com/search?q=%s|duckduckgo.com/html/?q=%s|
         ' desktop/searchweb.c
  sed -i 's|google[.][.a-z]\{0,6\}/search|duckduckgo.com/html/search|
          s|Google-Suche|DuckDuckGo HTML|
          s|Google Search|DuckDuckGo HTML|
          s|Ricerca Google|DuckDuckGo HTML|
          s|Google検索|DuckDuckGo HTML|
          \|BBC News|d
          \|Reuters|d
          \|CNN|d
          \|Slashdot|d
          \|Ars Technica|d
          \|The Register|d
          \|W3C|d
          s|google[.][.a-z]\{0,6\}|duckduckgo.com/html|
          s|Google|DuckDuckGo HTML|
          s|[.a-z]\{0,4\}yahoo[.]co[.a-z]\{0,4\}|www.seeks.fr|
          s|Yahoo!|Seeks|
          \|IMDB|d
          s|The Icon Bar|Creative Commons|
          s|www[.]iconbar[.]com|creativecommons.org|
          s|ROOL|Dictionary.com|
          s|www[.]riscosopen[.]org|dictionary.reference.com|
          \|riscos.info|d
         ' \!NetSurf/Resources/de/welcome.html\,faf \
           \!NetSurf/Resources/en/welcome.html\,faf \
           \!NetSurf/Resources/it/welcome.html\,faf \
           \!NetSurf/Resources/ja/welcome.html\,faf
  sed -i 's|Google|DuckDuckGo HTML|
         ' frontends/amiga/dist/NetSurf.guide
  # patch and remove anything that's left
  patch -p1 -i ../remove_nonprivacy_options.patch
}

build() {
  make -C "$pkgname" \
    NETSURF_GTK_MAJOR=3 \
    TARGET=gtk \
    LIBDIR=lib \
    INCLUDEDIR=include \
    PREFIX=/usr
}

package() {
  cd "$pkgname"

  make install LIBDIR=lib INCLUDEDIR=include PREFIX=/usr TARGET=gtk \
    NETSURF_GTK_MAJOR=3 DESTDIR="$pkgdir"

  # Launcher script
  install -Dm755 "../$pkgname.sh" "$pkgdir/usr/bin/$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"
}

# vim:set ts=2 sw=2 et: