PKGBUILD 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. # Maintainer (Arch): Alexander F. Rødseth <xyproto@archlinux.org>
  2. # Contributor (Arch): Paulo Matias <matiasΘarchlinux-br·org>
  3. # Contributor (Arch): Georgij Kondratjev <smpuj@bk.ru>
  4. # Contributor (Arch): Daniel J Griffiths <ghost1227@archlinux.us>
  5. # Maintainer (Hyperbola): André Silva <emulatorman@hyperbola.info>
  6. # Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
  7. pkgname=netsurf
  8. pkgver=3.9
  9. pkgrel=2
  10. pkgrel+=.par1
  11. pkgdesc='Lightweight and fast web browser'
  12. pkgdesc+=', without non-privacy search engines'
  13. arch=(x86_64)
  14. arch+=(i686 armv7h)
  15. url='https://www.netsurf-browser.org/'
  16. license=(MIT GPL2)
  17. replaces=(${pkgname}-libre)
  18. conflicts=(${pkgname}-libre)
  19. depends=(curl gtk3 'libhubbub=0.3.6' libjpeg-turbo 'libnsutils=0.0.5-4'
  20. 'libutf8proc>=2.4.0' 'libwapcaplet>=0.4.2' 'libdom>=0.4.0')
  21. # vim is needed only for xxd when building
  22. makedepends=(check inetutils 'libcss>=0.9.0' 'libnsbmp>=0.1.5'
  23. 'libnsgif>=0.2.1' 'nsgenbind>=0.7' perl-html-parser setconf vim)
  24. source=("https://download.netsurf-browser.org/netsurf/releases/source-full/netsurf-all-$pkgver.tar.gz"
  25. netsurf.sh
  26. remove_nonprivacy_options.patch)
  27. sha256sums=('11e384eaf47e65c186da5001f1055a02f2d72ff17b50f403b8392546a2cf65ff'
  28. '34c1f41c02ff3791a1b734197d99ec7f58c403dee05f0f9b7b9b3509d32b51ac'
  29. '61bec340c47a089b1b5c33d3ae330a340999a1e40be7fc8768fa572c6ca3b617')
  30. prepare() {
  31. cd "$pkgname-all-$pkgver/$pkgname"
  32. # Fix compilation issues
  33. sed -i 's:libutf8proc/::;s:UTF8PROC_CCC_VIRAMA:UTF8PROC_BIDI_CLASS_EN:' \
  34. utils/idna.c
  35. # Use "netsurf" as the name of the executable in /usr/bin
  36. setconf frontends/gtk/res/netsurf-gtk.desktop 'Exec=netsurf %u'
  37. # Set build configuration in Makefile.defaults
  38. for opt in \
  39. NETSURF_UA_FORMAT_STRING='"NetSurf/%d.%d (%s; Arch Linux)"' \
  40. NETSURF_USE_DUKTAPE=YES
  41. do
  42. setconf Makefile.defaults "$opt"
  43. done
  44. # remove non-privacy search engines
  45. sed -i '\|Google|d
  46. \|Yahoo|d
  47. \|Bing|d
  48. \|Business.com|d
  49. \|Omgili|d
  50. \|BBC News|d
  51. \|Ubuntu Packages|d
  52. \|Ask[.]com|d
  53. \|Answers.com|d
  54. \|Youtube|d
  55. \|AeroMp3|d
  56. \|AOL|d
  57. \|Baidu|d
  58. \|Amazon|d
  59. \|Ebay|d
  60. \|IMDB|d
  61. \|ESPN|d
  62. s|DuckDuckGo|DuckDuckGo HTML|
  63. s|duckduckgo[.]com|duckduckgo.com/html|
  64. s|duckduckgo[.]com/html/favicon.ico|duckduckgo.com/favicon.ico|
  65. s|seeks-project.info|seeks.fr|g
  66. ' frontends/riscos/appdir/Resources/SearchEngines \
  67. resources/SearchEngines
  68. sed -i '\|readable name such as| s|google|duckduckgo|
  69. \|readable name such as| s|yahoo|seeks|
  70. \|host address such as www[.]google[.]com| s|google[.]com|duckduckgo.com/html|
  71. s|google[.]com?search=%s|duckduckgo.com/html/?q=%s|
  72. \|return strdup| s|google[.]com|duckduckgo.com/html|
  73. \|return strdup| s|google|duckduckgo|
  74. \|return strdup| s|duckduckgo[.]com/html/favicon[.]ico|duckduckgo.com/favicon.ico|
  75. s|www[.]google[.]com/search?q=%s|duckduckgo.com/html/?q=%s|
  76. ' desktop/searchweb.c
  77. sed -i 's|google[.][.a-z]\{0,6\}/search|duckduckgo.com/html/search|
  78. s|Google-Suche|DuckDuckGo HTML|
  79. s|Google Search|DuckDuckGo HTML|
  80. s|Ricerca Google|DuckDuckGo HTML|
  81. s|Google検索|DuckDuckGo HTML|
  82. \|BBC News|d
  83. \|Reuters|d
  84. \|CNN|d
  85. \|Slashdot|d
  86. \|Ars Technica|d
  87. \|The Register|d
  88. \|W3C|d
  89. s|google[.][.a-z]\{0,6\}|duckduckgo.com/html|
  90. s|Google|DuckDuckGo HTML|
  91. s|[.a-z]\{0,4\}yahoo[.]co[.a-z]\{0,4\}|www.seeks.fr|
  92. s|Yahoo!|Seeks|
  93. \|IMDB|d
  94. s|The Icon Bar|Creative Commons|
  95. s|www[.]iconbar[.]com|creativecommons.org|
  96. s|ROOL|Dictionary.com|
  97. s|www[.]riscosopen[.]org|dictionary.reference.com|
  98. \|riscos.info|d
  99. ' frontends/riscos/appdir/Resources/de/welcome.html\,faf \
  100. frontends/riscos/appdir/Resources/en/welcome.html\,faf \
  101. frontends/riscos/appdir/Resources/it/welcome.html\,faf \
  102. frontends/riscos/appdir/Resources/ja/welcome.html\,faf \
  103. frontends/riscos/appdir/Resources/nl/welcome.html\,faf
  104. sed -i 's|Google|DuckDuckGo HTML|
  105. ' frontends/amiga/dist/NetSurf.guide
  106. # patch and remove anything that's left
  107. patch -p1 -i ../../remove_nonprivacy_options.patch
  108. }
  109. build() {
  110. CFLAGS="$CFLAGS -w -Os -funroll-loops" make \
  111. -C "$pkgname-all-$pkgver/$pkgname" \
  112. NETSURF_GTK_MAJOR=3 \
  113. TARGET=gtk \
  114. LIBDIR=lib \
  115. INCLUDEDIR=include \
  116. PREFIX=/usr
  117. }
  118. package() {
  119. make -C "$pkgname-all-$pkgver/$pkgname" \
  120. TARGET=gtk \
  121. NETSURF_GTK_MAJOR=3 \
  122. LIBDIR=lib \
  123. INCLUDEDIR=include \
  124. DESTDIR="$pkgdir" \
  125. PREFIX=/usr \
  126. install
  127. # Launch script
  128. install -Dm755 $pkgname.sh "$pkgdir/usr/bin/$pkgname"
  129. cd "$pkgname-all-$pkgver/$pkgname"
  130. # Desktop icon and shortcut
  131. install -Dm644 frontends/gtk/res/$pkgname.xpm \
  132. "$pkgdir/usr/share/pixmaps/$pkgname.xpm"
  133. install -Dm644 frontends/gtk/res/$pkgname-gtk.desktop \
  134. "$pkgdir/usr/share/applications/$pkgname.desktop"
  135. # License
  136. install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
  137. }
  138. # vim: ts=2 sw=2 et: