summaryrefslogtreecommitdiff
path: root/libre/netsurf-libre/PKGBUILD
blob: 78bd1d208f2e5f5f209c80fac210746c4ece23d8 (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
# $Id: PKGBUILD 110427 2014-04-29 13:53:01Z arodseth $
# Maintainer: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Paulo Matias <matiasΘarchlinux-br·org>
# Contributor: Georgij Kondratjev <smpuj@bk.ru>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
# Maintainer (Parabola): André Silva <emulatorman@parabola.nu>

_pkgname=netsurf
pkgname=netsurf-libre
pkgver=3.1
pkgrel=1
pkgdesc='Lightweight and fast web browser, without non-privacy search providers'
arch=('x86_64' 'i686' 'mips64el')
url='http://www.netsurf-browser.org/'
license=('MIT' 'GPL2')
replaces=($_pkgname)
conflicts=($_pkgname)
provides=($_pkgname=$pkgver)
depends=('libmng' 'librsvg' 'libwebp' 'curl' 'lcms' 'desktop-file-utils' 'libnsbmp>=0.1.1' 'libnsgif>=0.1.1' 'libcss>=0.3.0' 'libdom>=0.1.0' 'js185' 'gtk2') # gtk3
makedepends=('js185' 're2c' 'gendesk' 'netsurf-buildsystem' 'perl-html-parser' 'nsgenbind' 'inetutils')
install="$_pkgname.install"
source=("netsurf.png::http://ubuntu.allmyapps.com/data/n/e/netsurf-netsurf-web-browser/icon_48x48_netsurf.png"
        "http://download.$_pkgname-browser.org/$_pkgname/releases/source/$_pkgname-$pkgver-src.tar.gz"
        'netsurf.sh')
sha256sums=('f0dbcc5d80bf03d706aa8b28a322aa7f169a40813848c2d1505691f6e2c7ef00'
            '1ef12b2e2bc68f9eff8465646b7359e3cb483e1042aed750cc283a70dd4c540c'
            '70310682d1612457d7bb3096549110b6ec127f50e97853259fada6be0c52924b')

prepare() {
  cd "$_pkgname-$pkgver"

  # remove non-privacy search providers
  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
          \|Aminet|d
          \|OS4Depot|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
         ' gtk/res/SearchEngines \
           \!NetSurf/Resources/SearchEngines \
           amiga/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|nsgenbind -g|nsgenbind|
         ' javascript/Makefile

  cd ..

  gendesk -f --pkgname "$_pkgname" --pkgdesc "$pkgdesc" --exec 'netsurf %U' \
    --genericname 'Web Browser' --comment 'Lightweight web browser' \
    --mimetypes 'text/html;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/geo'

  # If patching the GTK3 deprecated errors by including files from
  # /usr/include/gtk-3.0/gtk/deprecated, something like this might be useful:
  #setconf "$_pkgname-$pkgver/Makefile.defaults" \
  #  CFLAGS " -DGTK_COMPILATION"
}

build() {
  make -C "$_pkgname-$pkgver" \
    PREFIX=/usr \
    TARGET=gtk \
    NETSURF_USE_WEBP=YES \
    NETSURF_USE_VIDEO=NO
    #NETSURF_GTK_MAJOR=3 # The latest version of GTK3 has deprecated several
                         # features that are used by NetSurf.
}

package() {
  make -C "$_pkgname-$pkgver" install PREFIX=/usr DESTDIR="$pkgdir"
  mv "$pkgdir/usr/bin/$_pkgname" "$pkgdir/usr/bin/$_pkgname.elf"
  install -Dm755 "$_pkgname.sh" "$pkgdir/usr/bin/$_pkgname"
  install -Dm644 "$_pkgname.png" "$pkgdir/usr/share/pixmaps/$_pkgname.png"
  install -Dm644 "$_pkgname.desktop" \
    "$pkgdir/usr/share/applications/$_pkgname.desktop"
  install -Dm644 "$_pkgname-$pkgver/COPYING" \
    "$pkgdir/usr/share/licenses/$_pkgname/LICENSE"
  # use softlinks instead of hardlinks
  rm -r "$pkgdir/usr/share/netsurf/C"
  ln -s '/usr/share/netsurf/en' "$pkgdir/usr/share/netsurf/C"
}

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